1. Home
  2. Explore
  3. Computer Science
  4. Database Normalization Basics

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Database Normalization Basics

  • 31Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Introduction to Normalization

What is the primary purpose of database normalization?

31 questions

  1. 1

    What is the primary purpose of database normalization?

    1. A

      To maximize storage efficiency by allowing duplicate data

    2. B

      To ensure all tables have at least one index

    3. C

      To structure a table so that redundant information cannot be expressed

    4. D

      To enforce that every column has a default value

    Correct answer
    C

    To structure a table so that redundant information cannot be expressed

    Explanation

    Normalization structures a table so that it cannot express redundant information, which helps maintain data integrity.

  2. 2

    Which of the following is NOT a benefit of proper database normalization?

    1. A

      Easier to enhance and extend

    2. B

      Faster query performance on all queries

    3. C

      Easier to understand

    4. D

      Protection from insertion, update, and deletion anomalies

    Correct answer
    B

    Faster query performance on all queries

    Explanation

    Normalization can sometimes reduce query performance due to more joins; speed is not a guaranteed benefit.

  3. 3

    In the safety assessment analogy, achieving the next normal form is like:

    1. A

      Building a completely new bridge

    2. B

      Reducing the number of safety checks

    3. C

      Adding more lanes to the bridge

    4. D

      Passing a stricter safety assessment for a bridge

    Correct answer
    D

    Passing a stricter safety assessment for a bridge

    Explanation

    Normal forms are analogous to safety levels: each higher form requires passing a stricter assessment.

  4. 4

    Which of the following is a violation of First Normal Form?

    1. A

      Creating an index on a column

    2. B

      Having a column that stores integers and strings

    3. C

      Using a primary key that consists of two columns

    4. D

      Storing dates in a separate table

    Correct answer
    B

    Having a column that stores integers and strings

    Explanation

    First Normal Form prohibits mixing data types within the same column.

  5. 5

    What is the problem with using row order to convey information in a table?

    1. A

      It violates First Normal Form because row order is not guaranteed

    2. B

      It simplifies indexing

    3. C

      It is required for primary keys

    4. D

      It improves query performance

    Correct answer
    A

    It violates First Normal Form because row order is not guaranteed

    Explanation

    Row order in a relational database is arbitrary; using it to convey meaning violates First Normal Form.

  6. 6

    Why must every table in First Normal Form have a primary key?

    1. A

      To allow multiple rows with the same identifier

    2. B

      To satisfy a requirement of the SQL standard only

    3. C

      To uniquely identify each row and prevent duplicate or contradictory rows

    4. D

      To improve the speed of data retrieval

    Correct answer
    C

    To uniquely identify each row and prevent duplicate or contradictory rows

    Explanation

    A primary key uniquely identifies each row and prevents insertion of duplicate or contradictory rows.

  7. 7

    Which of the following is an example of a repeating group violation of First Normal Form?

    1. A

      Using a composite primary key

    2. B

      Having a column that stores only integers

    3. C

      Storing a player's name in one column and ID in another

    4. D

      Storing a player's inventory as a single text string

    Correct answer
    D

    Storing a player's inventory as a single text string

    Explanation

    Storing a repeating group (like inventory items) as a single string lumps multiple values together, violating 1NF.

  8. 8

    In a normalized table, how should data about a player's inventory items be represented?

    1. A

      One row per player with multiple columns for each item type

    2. B

      A separate table for each item type

    3. C

      One row per player-item-type combination with a quantity column

    4. D

      A single text column listing all items

    Correct answer
    C

    One row per player-item-type combination with a quantity column

    Explanation

    Each unique combination of player and item type gets its own row, with a column for quantity, avoiding repeating groups.

  9. 9

    What type of anomaly occurs when deleting a row causes the loss of unrelated information?

    1. A

      Deletion anomaly

    2. B

      Update anomaly

    3. C

      Insertion anomaly

    4. D

      Referential integrity anomaly

    Correct answer
    A

    Deletion anomaly

    Explanation

    A deletion anomaly occurs when deleting a row removes facts about other attributes that are not directly related to the deleted row.

  10. 10

    An update anomaly can lead to:

    1. A

      Violation of a foreign key constraint

    2. B

      The same fact being represented inconsistently across rows

    3. C

      Inability to insert a new row because of missing data

    4. D

      Loss of data when a row is deleted

    Correct answer
    B

    The same fact being represented inconsistently across rows

    Explanation

    An update anomaly occurs when updating some but not all occurrences of a fact leads to inconsistency.

  11. 11

    What is an insertion anomaly?

    1. A

      Inserting a row with a null primary key

    2. B

      The inability to insert a new row because some required data is missing

    3. C

      Inserting a row that causes referential integrity violation

    4. D

      Inserting duplicate rows accidentally

    Correct answer
    B

    The inability to insert a new row because some required data is missing

    Explanation

    An insertion anomaly occurs when a row cannot be added because some attribute (like a rating) cannot be recorded due to missing dependent data.

  12. 12

    What is the rule for Second Normal Form?

    1. A

      Each non-key attribute must be dependent on the entire primary key

    2. B

      Each attribute must be dependent on the entire primary key

    3. C

      Repeating groups must be removed

    4. D

      No transitive dependencies allowed

    Correct answer
    A

    Each non-key attribute must be dependent on the entire primary key

    Explanation

    Second Normal Form requires that every non-key attribute is functionally dependent on the whole primary key, not just part of it.

  13. 13

    In the Player_Inventory table with columns (Player, Item_Type, Item_Quantity, Player_Rating), which column causes the violation of Second Normal Form?

    1. A

      Item_Quantity, because it depends on both Player and Item_Type

    2. B

      Player, because it is part of the primary key

    3. C

      Item_Type, because it is part of the primary key

    4. D

      Player_Rating, because it depends only on Player, not on Item_Type

    Correct answer
    D

    Player_Rating, because it depends only on Player, not on Item_Type

    Explanation

    Player_Rating depends only on Player, which is part of the primary key, causing a partial dependency that violates 2NF.

  14. 14

    What is the solution to bring the Player_Inventory table with Player_Rating into Second Normal Form?

    1. A

      Split the table into a Player table and a Player_Inventory table

    2. B

      Remove the Player_Rating column entirely

    3. C

      Add more columns to the primary key

    4. D

      Make Player_Rating part of the primary key

    Correct answer
    A

    Split the table into a Player table and a Player_Inventory table

    Explanation

    Splitting the table so that Player_Rating goes into a separate Player table eliminates the partial dependency.

  15. 15

    Third Normal Form primarily addresses which type of dependency?

    1. A

      Functional dependencies on the key

    2. B

      Partial dependencies

    3. C

      Transitive dependencies

    4. D

      Multivalued dependencies

    Correct answer
    C

    Transitive dependencies

    Explanation

    Third Normal Form prohibits transitive dependencies, where a non-key attribute depends on another non-key attribute.

  16. 16

    In the Player table with columns (Player_ID, Player_Rating, Player_Skill_Level), which dependency causes a violation of Third Normal Form?

    1. A

      Player_Rating depends directly on Player_ID

    2. B

      Player_Rating depends on Player_Skill_Level, which depends on Player_ID

    3. C

      Player_Skill_Level depends on Player_ID

    4. D

      Player_ID depends on Player_Rating

    Correct answer
    B

    Player_Rating depends on Player_Skill_Level, which depends on Player_ID

    Explanation

    Player_Rating transitively depends on Player_ID through Player_Skill_Level, violating 3NF.

  17. 17

    What is the fix for a transitive dependency in Third Normal Form?

    1. A

      Remove the attribute that causes the chain

    2. B

      Create a separate table for the attributes involved in the transitive dependency

    3. C

      Create a composite primary key

    4. D

      Add more columns to the primary key

    Correct answer
    B

    Create a separate table for the attributes involved in the transitive dependency

    Explanation

    Removing the transitive dependency by splitting the table so that each non-key attribute depends only on the key resolves the issue.

  18. 18

    The guideline 'Every attribute in a table should depend on the key, the whole key, and nothing but the key' describes which normal form?

    1. A

      Third Normal Form

    2. B

      Fourth Normal Form

    3. C

      Boyce-Codd Normal Form

    4. D

      Second Normal Form

    Correct answer
    C

    Boyce-Codd Normal Form

    Explanation

    This guideline, which drops 'non-key', defines Boyce-Codd Normal Form (BCNF), a slightly stronger version of 3NF.

  19. 19

    How does Boyce-Codd Normal Form differ from Third Normal Form?

    1. A

      BCNF is weaker than 3NF

    2. B

      BCNF only applies to tables with composite keys

    3. C

      BCNF requires that even key attributes depend on the whole key, making it stricter

    4. D

      BCNF allows transitive dependencies

    Correct answer
    C

    BCNF requires that even key attributes depend on the whole key, making it stricter

    Explanation

    BCNF requires that every attribute (including those that are part of a candidate key) depend on the whole key, which is slightly stricter than 3NF.

  20. 20

    In practice, how often does a table in Third Normal Form fail to be in Boyce-Codd Normal Form?

    1. A

      Only when there are no primary keys

    2. B

      Always, because BCNF is the same as 3NF

    3. C

      Almost never, because it requires multiple overlapping candidate keys

    4. D

      Frequently, because 3NF is weaker

    Correct answer
    C

    Almost never, because it requires multiple overlapping candidate keys

    Explanation

    The only tables in 3NF that are not in BCNF are those with multiple overlapping candidate keys, which are exceedingly rare in practice.

  21. 21

    What is a multivalued dependency?

    1. A

      A dependency where one attribute determines a set of values for another attribute

    2. B

      A dependency that involves more than two attributes

    3. C

      A dependency where one attribute determines exactly one value of another attribute

    4. D

      A dependency between two different tables

    Correct answer
    A

    A dependency where one attribute determines a set of values for another attribute

    Explanation

    A multivalued dependency means that for a given value of one attribute, there is a set of associated values of another attribute, independent of other attributes.

  22. 22

    Fourth Normal Form forbids:

    1. A

      Composite primary keys

    2. B

      Functional dependencies that are not on the key

    3. C

      Multivalued dependencies that are not on the key

    4. D

      All multivalued dependencies

    Correct answer
    C

    Multivalued dependencies that are not on the key

    Explanation

    4NF allows only multivalued dependencies that are on the key (i.e., the key determines the set).

  23. 23

    In the DesignMyBirdhouse.com example, the table with columns Model, Color, Style violates Fourth Normal Form because:

    1. A

      The table has no primary key

    2. B

      The table is in Third Normal Form

    3. C

      There are multivalued dependencies of Color and Style on Model, but Model is not the key

    4. D

      Color and Style have a functional dependency on each other

    Correct answer
    C

    There are multivalued dependencies of Color and Style on Model, but Model is not the key

    Explanation

    Both Color and Style have multivalued dependencies on Model (each model has a set of colors and a set of styles), but the primary key is all three columns, so Model is not a key, violating 4NF.

  24. 24

    How do you fix a Fourth Normal Form violation in the DesignMyBirdhouse example?

    1. A

      Add more columns to the primary key

    2. B

      Split the table into two tables: one for Model-Color pairs and one for Model-Style pairs

    3. C

      Remove the Color column

    4. D

      Make Model the primary key and keep all columns

    Correct answer
    B

    Split the table into two tables: one for Model-Color pairs and one for Model-Style pairs

    Explanation

    Splitting into two tables eliminates the multivalued dependencies not on the key, making the design 4NF compliant.

  25. 25

    Fifth Normal Form is concerned with:

    1. A

      Whether a table has a composite primary key

    2. B

      Whether a table has multivalued dependencies

    3. C

      Whether a table can be logically derived by joining other tables

    4. D

      Whether a table has transitive dependencies

    Correct answer
    C

    Whether a table can be logically derived by joining other tables

    Explanation

    5NF requires that a table cannot be decomposed into smaller tables without losing information; it must not be possible to reconstruct it from joins of other tables.

  26. 26

    In the ice cream example, what was the mistake in the initial design?

    1. A

      Combining brand-flavor, person-brand, and person-flavor information into a single table

    2. B

      Not including a primary key

    3. C

      Storing redundant brand information

    4. D

      Using too many tables

    Correct answer
    A

    Combining brand-flavor, person-brand, and person-flavor information into a single table

    Explanation

    The mistake was conflating independent facts (which brands offer which flavors, which people like which brands, which people like which flavors) into one table, violating 5NF.

  27. 27

    What is the correct way to represent the ice cream information in Fifth Normal Form?

    1. A

      Use a single table with all attributes

    2. B

      Use two tables: Person_Preference and Brand_Flavor

    3. C

      Use three separate tables: Brand_Flavor, Person_Brand, Person_Flavor

    4. D

      Use a single table with a composite primary key of Person, Brand, Flavor

    Correct answer
    C

    Use three separate tables: Brand_Flavor, Person_Brand, Person_Flavor

    Explanation

    Representing each independent relationship as its own table ensures 5NF compliance and avoids anomalies.

  28. 28

    To be in Fifth Normal Form, a table must also be in:

    1. A

      No other normal form is required

    2. B

      Second Normal Form only

    3. C

      Fourth Normal Form

    4. D

      Third Normal Form only

    Correct answer
    C

    Fourth Normal Form

    Explanation

    A table must satisfy all lower normal forms (1NF through 4NF) to be in 5NF.

  29. 29

    Which normal form prohibits partial dependencies?

    1. A

      Second Normal Form

    2. B

      Fourth Normal Form

    3. C

      First Normal Form

    4. D

      Third Normal Form

    Correct answer
    A

    Second Normal Form

    Explanation

    Second Normal Form requires that every non-key attribute depend on the whole primary key, thus prohibiting partial dependencies.

  30. 30

    Which normal form is violated when a table lacks a primary key?

    1. A

      Fourth Normal Form

    2. B

      Second Normal Form

    3. C

      Third Normal Form

    4. D

      First Normal Form

    Correct answer
    D

    First Normal Form

    Explanation

    First Normal Form requires that every table have a primary key.

  31. 31

    The rule 'Every non-key attribute in a table should depend on the key, the whole key, and nothing but the key' defines:

    1. A

      Second Normal Form

    2. B

      First Normal Form

    3. C

      Third Normal Form

    4. D

      Boyce-Codd Normal Form

    Correct answer
    C

    Third Normal Form

    Explanation

    This is the classic definition of Third Normal Form, which prohibits both partial and transitive dependencies.

Question 1 of 31
Question 1 of 31

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent