database-normalization

Which normal form does this table violate?

风格不统一 提交于 2019-11-30 22:40:22
Consider this table: +-------+-------+-------+-------+ | name |hobby1 |hobby2 |hobby3 | +-------+-------+-------+-------+ | kris | ball | swim | dance | | james | eat | sing | sleep | | amy | swim | eat | watch | +-------+-------+-------+-------+ There is no priority on the types of hobbies, thus all the hobbies belong to the same domain. That is, the hobbies in the table can be moved on any hobby# column. It doesn't matter on which column, a particular hobby can be in any column. Which database normalization rule does this table violate? Edit Q. Is "the list of hobbies [...] in an arbitrary

6NF and historical attribute data

北慕城南 提交于 2019-11-30 20:45:05
When using a database normalized accoring to 6NF principles, how would you store historical attribute data? Let say for example we take this example from @PerformanceDBA but with the following extra requirement: We need to store historical data for all our products, we should be able to just enter a date and get a snapshot of the attributes of the product at that particular time. A more practical example : Suppose the disks and CPU's from the example above are virtual and a user can change the disk capacity at will. How can we alter the database so that we can retrieve the attributes of a

Convert row with columns of data into column with multiple rows in Excel 2007

末鹿安然 提交于 2019-11-30 19:25:41
问题 I have a row of data as follows: header1 header2 header3 header4 header5 row key datavalue1 datavalue2 datavalue3 datavalue4 datavalue5.... so basically, I have a denormalized data set where the datavalues may or may not be empty on a row-by-row basis. I need to normalize them. ie 12345678 NULL 10 3 NULL 14 would become: 12345678 header2 10 12345678 header3 3 12345678 header5 14 I could do this by using a paste special transform, but I have thousands of rows and I'd need to make sure that I

Which normal form does this table violate?

怎甘沉沦 提交于 2019-11-30 17:35:29
问题 Consider this table: +-------+-------+-------+-------+ | name |hobby1 |hobby2 |hobby3 | +-------+-------+-------+-------+ | kris | ball | swim | dance | | james | eat | sing | sleep | | amy | swim | eat | watch | +-------+-------+-------+-------+ There is no priority on the types of hobbies, thus all the hobbies belong to the same domain. That is, the hobbies in the table can be moved on any hobby# column. It doesn't matter on which column, a particular hobby can be in any column. Which

How many fields is 'too many' in a table?

女生的网名这么多〃 提交于 2019-11-30 08:55:47
问题 I have a coworker who is planning a database for a new app that will have several tables with over 30 fields each. Is this excessive? Maybe I'm just not enterprisey enough to understand. Edit: Also, a lot of the fields are option-type sort of things (like on a request form, would you like your widget to be yellow or green, he has a field for 'colour' with an enum). It's quite likely that these will be added to or removed over time. I haven't really done database design and try to stay away

6NF and historical attribute data

百般思念 提交于 2019-11-30 04:51:23
问题 When using a database normalized accoring to 6NF principles, how would you store historical attribute data? Let say for example we take this example from @PerformanceDBA but with the following extra requirement: We need to store historical data for all our products, we should be able to just enter a date and get a snapshot of the attributes of the product at that particular time. A more practical example : Suppose the disks and CPU's from the example above are virtual and a user can change

How to understand the 5th Normal Form?

社会主义新天地 提交于 2019-11-29 20:01:51
I'm using two online sources for gaining an understanding of the 5NF, without any rigor of Math and proofs. A Simple Guide to Five Normal Forms in Relational Database Theory (by Kent. This one seems to have been reviewed and endorsed in one of his writings by none other than CJ Date himself) Fifth Normal Form (Wikipedia article) However, I'm unable to understand either of these references! Let's first examine Reference #1 (Kent's). It says: "But suppose that a certain rule was in effect: if an agent sells a certain product, and he represents a company making that product, then he sells that

Drupal Database Structure - Efficient/Inefficient?

我们两清 提交于 2019-11-29 16:29:40
I'm certainly no Drupal expert, but I've schemed and built a few databases before, so am puzzled by the structure of a database a 3rd party team is working on that I had Sequel Pro'd into to add some dummy content. I presume the structure wouldn't be apparent if one were to use Drupal's back end GUI, but I don't have creds, just ftp, and ssh access. I was a bit horrified to see not the single table I would have expected for, say, an Organization, with columns for ID, Name, Address, Email, Zip Code, etc. etc. Instead, there is a table for each bit of data. That is, a separate table for Name,

Violation of 3NF if we use an auto-incremented identity column along with a PK

﹥>﹥吖頭↗ 提交于 2019-11-29 11:59:47
As it is said in the book of Database Solutions Second Edition written by Thomas Connolly and Carolyn Begg page 180: Third normal form (3NF) A table that is already in 1NF and 2NF, and in which the values in all non-primary-key columns can be worked out from only the primary key column(s) and no other columns. I have seen many scenarios where people use an identity column though they already have a primary key column in their table. A record can also be worked out from the identity column, so isn't it a violation of 3NF if we use an auto-incremented identity column along with a primary key in

How many fields is 'too many' in a table?

…衆ロ難τιáo~ 提交于 2019-11-29 09:09:29
I have a coworker who is planning a database for a new app that will have several tables with over 30 fields each. Is this excessive? Maybe I'm just not enterprisey enough to understand. Edit: Also, a lot of the fields are option-type sort of things (like on a request form, would you like your widget to be yellow or green, he has a field for 'colour' with an enum). It's quite likely that these will be added to or removed over time. I haven't really done database design and try to stay away from it myself, so maybe I'm being completely stupid, but surely there's a better way of doing this??