click below
click below
Normal Size Small Size show me how
DatabaseDesign&SQL
Normailization
| Question | Answer |
|---|---|
| 1st Rule Of Normalization | Eliminate Repeating Groups (of columns by making another table) |
| Why is the first rule of normalization so important? | Execution Speed and Scalability |
| Give an example of a table with repeating groups of columns | TTeams intTeamID strTeam strPlayer01FirstName strPlayer01LastName ... strPlayer10FirstName strPlayer10LastName |
| What do you do if you have nested groups of repeating columns? | Collapse all nested repeating groups and apply the 1st rule of normalization one level at a time. |
| A | Identify the repeating groups. |
| B | Determine how many groups there are, how many times each group repeats and how many columns are in each group. |
| C | Collapse nested repeating groups and fix them one level at a time. Next repeating groups usually have two sets of numbers in the column names. |
| D | For each set of repeating groups create a new table. |
| E | Into the new table(s) copy ***all of the primary key columns*** from the original table and make them part of the primary key in the new table(s). |
| F | In the new table (s) create an integer index column and make it part of the primary key. That will make a primary key constraint with at least two columns. |
| G | For each repeating group take one set of repeating columns from the original table and add them to the appropriate new table. |
| H | Remove the number from the column names in the new tables. |
| I | Remove the repeating group (s) from the original table. |
| J | To name the new table (s) use the complete name of the original table plus a word or phrase that describes the group of repeating columns. Replace the ? in the index column with the descriptive word or phrase. |