SECTION 6 LESSON 2: Normalization and First Normal Form Lesson Vocabulary Directions: Identify the vocabulary word for each definition below. First Normal Form (1NF) Normalization The outcome of the first step of database normalization. 1NF eliminates repeating groups by putting each into a separate table and connecting them with a 1:M relationship A series of steps followed to obtain a database design that allows for efficient access and storage of data in a relational database. These steps reduce data redundancy and the chances of data becoming inconsistent Try It / Solve It 1. When checking a database model for first normal form what are you doing exactly? Solution: Verifying that each entity contains attributes that are appropriate for it; insuring that the entity has a UID; checking each attribute against its UID and verifying that the attribute only contains a single value. 2. What is the rule of 1NF in the normalization process? Solution: 1NF rule has three parts: d) identify the related data parts (attributes) and place them together in one entity; if multiple entities exist, attributes should be listed one time only and in the best possible location e) identify the UID of the entity f) remove any attribute that contains repeating groups (multiple values) and place it in its own entity; create a 1:M relationship between the two entities 3. Check to see if each ERD is in 1NF. If not, make the necessary changes to correct it. a.
b. c. Solution: Problems a. and b. need to be altered. Problem c. is in 1NF..
SECTION 6 LESSON 3: Second Normal Form Lesson Vocabulary Directions: Identify the vocabulary word for the definition below. Second Normal Form (2NF) The outcome of the second step of database normalization Try It / Solve It 1. The UID of a library book includes its BOOK number and SHELF number. Does this ERD follow the rules of Second Normal Form? If you spot a violation, correct it. Solution: Give this example, if necessary: A BOOK UID is something like A961234G, where A96 refers to a SHELF number and 1234G is the BOOK number. No, it does not follow the rules of 2NF shelf size belongs in the SHELF entity.
2. Class Enrollment is the intersection entity that resolves the M:M between STUDENT and CLASS. Does the ERD follow the rules of Second Normal Form? If you spot a violation, correct it. Solution: Review the UID of ENROLLMENT. It is the relationships to CLASS and STUDENT. Do you need to know both the CLASS id and the STUDENT id to find out the room the class is being held in?
3. A store can be located in several shopping malls, and a shopping mall may house several stores. To locate a particular store in a specific neighborhood, you will need to know the name and address of the nearby shopping mall, plus the name of the store. Does the ERD follow the rules of Second Normal Form? If you spot a violation, correct it. Solution: Give an example, if necessary: There are several [give the name of a store with multiple locations in your area such as a specific sportinggoods chain or bakery chain or other type of chain store] stores. To find a specific one in your vicinity, you have to know the malls in the area. This example violates 2NF because the store specialty (books, shoes, etc.) depends solely on the store.
SECTION 6 LESSON 4: Third Normal Form Lesson Vocabulary Directions: Identify the vocabulary word for each definition below. Third Normal Form or 3NF Transitive dependency The form of database normalization where all nonkey fields are dependent on the key, the whole key, and nothing but the key. A condition that exists when any attribute in an entity is dependent upon any other non-uid attribute in that entity. Try It / Solve It 1. Identify the transitive dependency in the model below. State which attributes violate Third Normal Form. Solution: Store name and store address violates 3 rd NF, and they are not dependent on the Key of Product, which is Number. 2. Define the rule of Third Normal Form. Solution: All attributes must be dependent on the key, the whole key, and nothing but the key.
3. A color scheme for a car includes specifications for paint color for the body and the interior colors and materials. For example: The Desert color scheme includes silver paint and gray leather interior; the Sunburst color scheme includes gold paint and cream leather interior. Does the model below follow the rules of Third Normal Form? If you spot a violation, correct it. Solution: Paint color and interior color are attributes of color scheme. Create a new entity for color scheme and create a relationship to CAR. 4. Assume the following business rules: An athlete employs one agent. An agent may work for one or more athletes. An athlete may play for one team. A team may have one or more players Does the model below contain one or more transitive dependencies? Identify the attributes involved in the transitive dependencies. Solution: This can be tricky because there are two transitive dependencies: team coach depends on team, and agent commission depends on agent. Two new entities have to be created.
Team coach is an attribute of team. Agent commission is an attribute of agent. Create an entity TEAM and an entity AGENT, both with relationships to ATHLETE. 5. Now that you have an idea of what makes a good UID, you need to be aware of the controversy, benefits, and difficulty of uniquely identifying someone. Consider the idea of a national ID card. What kinds of problems would the card create and what kinds of problems would it solve? If your country already uses a national ID card, what are the benefits and issues associated with this? In your opinion, could DNA mapping become the national ID card? Why or why not? Solution: The goal of this activity is to have students think about the issue of personal identification and its implementation in a database. This issue could be a hot button for some students. The Internet has many articles about national ID cards and DNA profiling (use the keywords: identity cards, national ID cards, DNA profiling ). Encourage students to find data instead of just voicing unsubstantiated opinions. Possible responses for pros/cons might include: CONS o Potential loss of personal freedom o Use of database for other purposes, such as tracking buying patterns (e.g., book purchases) of individuals who belong to certain religious groups (this is a violation of privacy) PROS o Reduce identity theft o Reduce the number of pieces of identification one would need