Table column count competition
-
I have a table in the application i am developing of 155 columns i dare anyone to beat me:mad: ps. the table is already in 3rd normal form
-
I have a table in the application i am developing of 155 columns i dare anyone to beat me:mad: ps. the table is already in 3rd normal form
Erm... :^) One database I worked on had a table that had to be split into two as there were more than 255 columns that were required for each row.... It's not as rare as it may sound particularly when you are dealing with something as complex as the human body(it was a medical database). That said - I am sure there are better ways of representing data than having so many columns populated for each row...
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
-
Erm... :^) One database I worked on had a table that had to be split into two as there were more than 255 columns that were required for each row.... It's not as rare as it may sound particularly when you are dealing with something as complex as the human body(it was a medical database). That said - I am sure there are better ways of representing data than having so many columns populated for each row...
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
guess I am one the 2nd place so far!!
-
Erm... :^) One database I worked on had a table that had to be split into two as there were more than 255 columns that were required for each row.... It's not as rare as it may sound particularly when you are dealing with something as complex as the human body(it was a medical database). That said - I am sure there are better ways of representing data than having so many columns populated for each row...
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
GuyThiebaut wrote:
required for each row
GuyThiebaut wrote:
medical database
I'm not convinced -- if the table had columns for right and left arm etc., what did you do for patients with missing arms? Leave NULLs? I'd prefer to have different tables for different body parts. :-D
-
Erm... :^) One database I worked on had a table that had to be split into two as there were more than 255 columns that were required for each row.... It's not as rare as it may sound particularly when you are dealing with something as complex as the human body(it was a medical database). That said - I am sure there are better ways of representing data than having so many columns populated for each row...
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
GuyThiebaut wrote:
I am sure there are better ways of representing data
I would imagine in that case you could have broken it down into sections like specific body parts/systems. But then again I have no idea what the data looked like, it may not have been that simple (or not clearly divided enough).
-
I have a table in the application i am developing of 155 columns i dare anyone to beat me:mad: ps. the table is already in 3rd normal form
Darn, highest I could find was 84, using this query:
SELECT
t.Name AS [Table Name],
COUNT(*) AS [Column Count]
FROM sys.Tables AS t
JOIN sys.Columns AS C
ON t.Object_ID = c.Object_ID
GROUP BY
t.Name
ORDER BY
COUNT(*) DESCCredit to Pinal Dave for most of the code.
-
GuyThiebaut wrote:
required for each row
GuyThiebaut wrote:
medical database
I'm not convinced -- if the table had columns for right and left arm etc., what did you do for patients with missing arms? Leave NULLs? I'd prefer to have different tables for different body parts. :-D
and how would you represent a person that is a dick head?
VS2010/Atmel Studio 6.0 ToDo Manager Extension
Version 3.0 now available. There is no place like 127.0.0.1 -
and how would you represent a person that is a dick head?
VS2010/Atmel Studio 6.0 ToDo Manager Extension
Version 3.0 now available. There is no place like 127.0.0.1I'd add a record to the [Brendan Fraser] table.
-
and how would you represent a person that is a dick head?
VS2010/Atmel Studio 6.0 ToDo Manager Extension
Version 3.0 now available. There is no place like 127.0.0.1:laugh: :laugh: :laugh: +5
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
-
I have a table in the application i am developing of 155 columns i dare anyone to beat me:mad: ps. the table is already in 3rd normal form
-
I'd add a record to the [Brendan Fraser] table.
-
and how would you represent a person that is a dick head?
VS2010/Atmel Studio 6.0 ToDo Manager Extension
Version 3.0 now available. There is no place like 127.0.0.1Referential integrity would prevent that.
-
Referential integrity would prevent that.
So would birth control!
VS2010/Atmel Studio 6.0 ToDo Manager Extension
Version 3.0 now available. There is no place like 127.0.0.1 -
Darn, highest I could find was 84, using this query:
SELECT
t.Name AS [Table Name],
COUNT(*) AS [Column Count]
FROM sys.Tables AS t
JOIN sys.Columns AS C
ON t.Object_ID = c.Object_ID
GROUP BY
t.Name
ORDER BY
COUNT(*) DESCCredit to Pinal Dave for most of the code.
-
So would birth control!
VS2010/Atmel Studio 6.0 ToDo Manager Extension
Version 3.0 now available. There is no place like 127.0.0.1Too late for that.
-
Too late for that.
I'd recommend a lobotomy, but I'm afraid Mr. Fraiser has already had his!
VS2010/Atmel Studio 6.0 ToDo Manager Extension
Version 3.0 now available. There is no place like 127.0.0.1 -
Too late for that.
-
I have a table in the application i am developing of 155 columns i dare anyone to beat me:mad: ps. the table is already in 3rd normal form
Move it to the fourth normal and get rid of the nulls.
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
-
I have a table in the application i am developing of 155 columns i dare anyone to beat me:mad: ps. the table is already in 3rd normal form
We have a table with 289 columns. It's in our insurance reserves calculating database, and I have no idea what the table actually does, and I don't think I want to know (there are 7 tables with more than 140 columns)
-
GuyThiebaut wrote:
required for each row
GuyThiebaut wrote:
medical database
I'm not convinced -- if the table had columns for right and left arm etc., what did you do for patients with missing arms? Leave NULLs? I'd prefer to have different tables for different body parts. :-D
Yes there are better ways of representing the data - it all depends on what you are going to do with it. If you are just looking at a simple full table scan then a wide row can be the best approach. The difficulty is that when you design your tables inevitably six months later there will be a better way to store the data based on how you now want to query it. In the end you just do the best you can with the information you have at the time and rely on the database engine to do the optimisation for you later - if things get really slow you can always de-normalise your data...
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens