Chapter 3: Designing a SQL Server Database
Lesson 1: Introduction to Database DesignExercise 1: Exploring the Basic Concepts of Database Designpage 104
To view the contents of a table
Review the columns and rows within the table.What are the column names (attributes) in the Categories table, and how many rows of data are displayed?CategoryID, CategoryName, Description, and Picture (eight rows of data are displayed, not counting the header)
page 104
To normalize a database design
Keeping in mind the table's design, apply the four basic rules that you should follow when designing a database. The rules are listed here for your convenience:
A table should have an identifier.
A table should store data for only a single type of entity.
A table should avoid nullable columns.
A table should not have repeating values or columns.
Which rule is being violated in the Customers table?The table does not have an identifier.
Modify the table's design so that it adheres to the basic rules of normalization. Use your paper and pencil to draw the table and its data.How should you modify the data?Add a column that serves as an identifier. For example, you can add a column named CustID. For each row, add a unique value to the column so that each customer has a unique customer ID.
Modify the database design so that it adheres to the rules of normalization.How should you modify the current design?Ensure that a table exists in the database that lists the various products that the company sells. This table should include an identifier for each product. Create another table that matches customer IDs to product IDs to track which products each customer purchased.
Modify the database design so that it adheres to the rules of normalization.How should you modify the current design?Create a separate table for the products so that all product and manufacturing information is in a table separate from the Customers table. The products table should include an identifier for each product. Create another table that matches customer IDs to product IDs to track which products each customer purchased.
page 106
To view entity relationships in a database diagram
View the connector that links the Authors table to the TitleAuthor table and the connector that links the Titles table to the TitleAuthor table.The connector indicates that a relationship exists between the tables. Notice that there is no connector between the Author table and the Titles table because no direct relationship exists between the tables.At one end of the connector is a key, which indicates one. The other side of the connector is an infinity sign, which indicates many. These symbols tell you that a one-to-many relationship exists between the Authors table and the TitleAuthor table and that a one-to-many relationship exists between the Titles table and the TitleAuthor table.What is the implied relationship between the Titles table and the Authors table?Many-to-many
What type of table is the TitleAuthor table (in terms of the implied relationship between Titles and Authors)?A junction table