Database normalization 1NF 2NF 3NF flashcards

This set of flashcards covers the essentials of database normalization, including the concepts of 1NF, 2NF, and 3NF, along with their importance in relational database design.

JacobLlama7r·40 flashcards·40 questions
collegecomputer_sciencedatabases
0
Known
1 / 40
0
Learning
Front

What is First Normal Form (1NF)?

Tap to flip
Back

1NF is a property of a relational database table. It requires that each column contains atomic values, and each entry in a column is unique.

Tap to flip
Got it
Still learning

Quiz(40 questions)

Question 1 of 40

1. What is the primary purpose of Third Normal Form (3NF) in database design?

Terms in this Study Set(40)

First Normal Form (1NF)(12)

What is First Normal Form (1NF)?

1NF is a property of a relational database table. It requires that each column contains atomic values, and each entry in a column is unique.

True or False: 1NF allows repeating groups in columns.

False. 1NF prohibits repeating groups or arrays in columns, ensuring data is stored in a flat structure.

List the key requirements of 1NF.

- Each column must contain atomic values. - Each record must be unique. - Each column must have unique names.

Fill in the blank: A table is in 1NF if it contains ____ values.

Only atomic values.

How does 1NF affect data redundancy?

1NF reduces data redundancy by ensuring that each piece of data is stored in only one place, eliminating duplicate entries.

Give an example of a table that is not in 1NF.

A table with a 'phone numbers' column containing multiple numbers per entry, like '555-1234, 555-5678'.

What happens when a table violates 1NF?

It can lead to data anomalies, making it difficult to retrieve or manipulate data accurately.

Comparison: 1NF vs. 2NF.

1NF focuses on atomicity and unique entries, while 2NF addresses partial dependencies and requires that all non-key attributes depend on the entire primary key.

What is an atomic value?

An atomic value is a single, indivisible value, such as 'John Doe' or '100' dollars.

True or False: A primary key can have multiple values in 1NF.

False. A primary key must be unique and cannot have multiple values.

How do you convert a table to 1NF?

Identify and separate repeating groups into individual rows, ensuring that all entries are atomic and unique.

Example of a 1NF compliant table.

| ID | Name | Phone | |----|----------|----------| | 1 | John Doe | 555-1234 | | 2 | Jane Doe | 555-5678 |

Second Normal Form (2NF)(14)

What is the definition of 2NF?

Second Normal Form (2NF) eliminates partial dependencies of non-prime attributes on any candidate key.

True or False: A table in 2NF can have partial dependencies.

False. 2NF requires no partial dependencies; all non-prime attributes must depend on the whole key.

How does 2NF relate to 1NF?

- 1NF ensures atomic values - 2NF removes partial dependencies

Give an example of a partial dependency.

If a table has a composite key (A, B) and a non-prime attribute depends only on A, it's a partial dependency.

What is required for a table to be in 2NF?

It must be in 1NF and have no partial dependencies.

Cause → Effect: Why eliminate partial dependencies?

To ensure data integrity and reduce redundancy by making sure non-key attributes depend on the entire key.

List steps to convert a table to 2NF.

- Identify partial dependencies - Separate non-key attributes - Create new tables for each dependency

What are prime attributes?

Attributes that are part of any candidate key in a table.

Fill in the blank: In 2NF, all non-prime attributes must fully depend on the _____.

entire candidate key.

Example: Table with ID, Name, and Course, where Course depends only on ID.

This table is not in 2NF due to partial dependency of Course on ID.

What happens after achieving 2NF?

The table is more structured, reducing data anomalies and improving data integrity.

True or False: 2NF can exist with transitive dependencies.

True. 2NF addresses partial dependencies but not transitive dependencies.

Compare 1NF and 2NF.

- 1NF: Atomic values - 2NF: No partial dependencies

What is the role of a candidate key in 2NF?

It helps identify which attributes should fully depend for a table to meet 2NF requirements.

Third Normal Form (3NF)(14)

What does 3NF address in databases?

Third Normal Form eliminates transitive dependencies, ensuring that non-key attributes depend only on the primary key.

True or False: 3NF allows transitive dependencies.

False. 3NF prohibits transitive dependencies to maintain data integrity.

Define transitive dependency.

A transitive dependency occurs when a non-key attribute depends on another non-key attribute rather than directly on the primary key.

How to achieve 3NF?

- Remove transitive dependencies - Ensure all attributes are dependent only on the primary key.

Provide an example of a transitive dependency.

If 'A' is the primary key, and 'B' depends on 'C', where 'C' depends on 'A', then 'B' is transitively dependent on 'A'.

What is the goal of normalization?

To reduce redundancy and improve data integrity in a database.

Fill in the blank: A table is in 3NF if it is in 2NF and has no _________ dependencies.

transitive

How does 3NF improve data integrity?

By ensuring that every non-key attribute is functionally dependent on the primary key only.

Comparison: 2NF vs 3NF.

2NF removes partial dependencies; 3NF removes transitive dependencies.

What is a non-key attribute?

An attribute in a table that is not part of the primary key.

Example: Table with student grades.

Student_ID (PK), Course_ID, Instructor_Name. Here, Instructor_Name is transitively dependent on Student_ID.

Transitioning to 3NF requires which step?

Decomposing tables to eliminate transitive dependencies.

True or False: 3NF can improve query performance.

True. By reducing redundancy, queries may execute faster.

What is the primary key's role in 3NF?

It uniquely identifies each record, ensuring all other attributes depend only on it.

Questions in this Study Set(40)

1. What is the primary purpose of Third Normal Form (3NF) in database design?

A.To eliminate transitive dependencies
B.To create surrogate keys
C.To enforce referential integrity
D.To allow duplicate data

2. What is the main characteristic of a table in Second Normal Form (2NF)?

A.No partial dependencies
B.All attributes are atomic
C.Uses only primary keys
D.Allows duplicate rows

3. What does it mean for a database table to be in First Normal Form (1NF)?

A.All columns must contain atomic values.
B.It can have repeating groups.
C.Each column must have multiple values.
D.The primary key can be composite.

4. True or False: A table in 3NF can have attributes that depend on other non-key attributes.

A.True
B.False
C.Only under certain conditions
D.It depends on the database system

5. Which of the following statements is true about Second Normal Form?

A.It requires 1NF to be satisfied.
B.It cannot be applied to a table already in 3NF.
C.It eliminates all types of dependencies.
D.It is unrelated to the concept of candidate keys.

6. Which of the following is NOT a requirement for 1NF?

A.Each column must have unique names.
B.Each record must be unique.
C.Columns can contain arrays.
D.Each column must contain atomic values.

7. What does a transitive dependency imply in a database table?

A.A non-key attribute relies on another non-key attribute
B.A primary key relates to only one attribute
C.An attribute can be duplicated
D.All attributes depend on the primary key

8. Which of the following is an example of a partial dependency?

A.Course depends on Student ID and Student Name.
B.Student Name depends only on Student ID.
C.Course depends on Course ID.
D.Enrollment Date depends on Course ID and Student ID.

9. How does 1NF help in reducing data anomalies?

A.By allowing multiple values in columns.
B.By ensuring that each piece of data is stored uniquely.
C.By using composite primary keys.
D.By allowing repeating groups.

10. To achieve 3NF, which of the following steps is necessary?

A.Remove transitive dependencies
B.Add more foreign keys
C.Increase the number of tables
D.Use composite keys

11. Why is it important to eliminate partial dependencies in a database?

A.To ensure non-key attributes depend on the entire key.
B.To allow for more complex queries.
C.To facilitate data duplication.
D.To keep attributes non-atomic.

12. Fill in the blank: A table is in 1NF if it has ____ values.

A.Only atomic values.
B.Some repeating groups.
C.Composite primary keys.
D.Multiple data types in one column.

13. Which of the following is an example of a transitive dependency?

A.Student_ID -> Course_ID -> Instructor_Name
B.Course_ID -> Student_ID
C.Instructor_Name -> Course_ID
D.Student_ID -> Instructor_Name

14. What must be true for a table to be considered to be in 2NF?

A.It must be in 1NF and have no partial dependencies.
B.It must contain only atomic values.
C.It can have transitive dependencies.
D.It must have a single primary key only.

15. What is an example of a violation of 1NF?

A.A table with a 'birthdates' column containing '01/01/1990'.
B.A table with a 'phone numbers' column listing '555-1234, 555-5678'.
C.A table where each ID is unique.
D.A table where every column has different names.

16. What does normalization aim to achieve in databases?

A.Increase redundancy
B.Enhance data integrity
C.Simplify database queries
D.Facilitate data duplication

17. Which scenario demonstrates a table that is NOT in 2NF?

A.A table where a non-prime attribute depends on the whole key.
B.A table where an attribute relies on only a part of a composite key.
C.A table with atomic values and no duplicates.
D.A table that has only single attributes.

18. Which of the following statements about primary keys in 1NF is true?

A.A primary key can contain multiple values.
B.A primary key must be unique for each record.
C.A primary key can have repeating values.
D.A primary key is always optional.

19. Fill in the blank: To be in Third Normal Form, a table must first be in Second Normal Form and not have any _________ dependencies.

A.partial
B.transitive
C.primary
D.foreign

20. What is the first step in converting a table to 2NF?

A.Identify partial dependencies.
B.Create new tables for each dependency.
C.Ensure all attributes are atomic.
D.Remove all candidate keys.

21. What effect does violating 1NF have on data retrieval?

A.It simplifies data retrieval.
B.It can complicate data retrieval and manipulation.
C.It enhances data organization.
D.It makes data entries more readable.

22. How does 3NF contribute to better data integrity?

A.By allowing duplicate records
B.By ensuring non-key attributes depend solely on the primary key
C.By deleting non-key attributes
D.By merging tables

23. True or False: 2NF allows for the presence of transitive dependencies.

A.True
B.False
C.Only in specific cases.
D.Depends on the database system.

24. Which requirement differentiates 1NF from tables that are not in 1NF?

A.All columns contain atomic values.
B.At least one column has repeating groups.
C.Data can be organized in multiple dimensions.
D.Multiple data types can exist in a single column.

25. What is the key difference between Second Normal Form (2NF) and 3NF?

A.2NF removes transitive dependencies; 3NF does not
B.2NF removes partial dependencies; 3NF addresses transitive dependencies
C.There is no difference
D.2NF requires more tables than 3NF

26. What defines prime attributes in the context of 2NF?

A.Attributes that are part of any candidate key.
B.Attributes that are not dependent on any keys.
C.Attributes that are always unique.
D.Attributes that do not depend on other attributes.

27. When converting a table to 1NF, what is the first step?

A.Identify and separate repeating groups.
B.Add more columns with non-unique data.
C.Remove all primary keys.
D.Merge similar records.

28. Which of the following is a non-key attribute?

A.Student_ID
B.Course_ID
C.Instructor_Name
D.All of the above are key attributes

29. In the context of 2NF, what does the term 'candidate key' refer to?

A.A unique identifier for each record in a table.
B.An attribute that can become a foreign key.
C.An attribute that can have repeated values.
D.A key that is not used in any relationships.

30. Which of the following tables is in 1NF?

A.| ID | Name | Phone | |----|----------|----------| | 1 | John Doe | 555-1234 | | 2 | Jane Doe | 555-5678 |
B.| ID | Name | Phone | |----|----------|----------| | 1 | John Doe | 555-1234, 555-5678 | | 2 | Jane Doe | 555-5678 |
C.| ID | Name | Phone | |----|----------|----------| | 1 | John Doe | 555-1234 | | 1 | John Doe | 555-1234 |
D.| ID | Name | Phone | |----|----------|----------| | 1 | John Doe | NULL | | 2 | Jane Doe | 555-5678 |

31. In a table with student records, if Student_ID is the primary key, which of these is a transitive dependency?

A.Student_ID -> Course_ID
B.Course_ID -> Instructor_Name
C.Instructor_Name -> Student_ID
D.Student_ID -> Student_Name

32. Which of the following statements accurately compares 1NF and 2NF?

A.1NF focuses on atomic values; 2NF removes partial dependencies.
B.1NF is about relationships; 2NF is about data types.
C.1NF requires complex keys; 2NF allows duplicate values.
D.1NF only deals with numeric data; 2NF applies to all data types.

33. What is the primary focus of 1NF in database design?

A.Minimizing data redundancy and ensuring atomicity.
B.Creating composite primary keys.
C.Enabling the use of multiple data types.
D.Organizing data into hierarchical structures.

34. What is the effect of achieving 3NF on query performance?

A.It makes queries more complicated
B.It can improve query performance
C.It never affects query performance
D.It slows down query execution

35. After achieving 2NF, what is a likely result regarding data structure?

A.Improved data integrity and reduced anomalies.
B.More complex relationships between tables.
C.Increased duplication of non-key attributes.
D.Less frequency of data updates required.

36. Which scenario demonstrates a table that is NOT in First Normal Form (1NF)?

A.A table with a 'hobbies' column containing entries like 'reading, biking'
B.A table where each 'ID' is unique and each 'Name' is a single individual
C.A table that separates first and last names into different columns
D.A table with unique phone numbers for each person

37. What role does the primary key play in the context of 3NF?

A.It acts as a foreign key
B.It identifies records uniquely and maintains attribute dependency
C.It is irrelevant to normalization
D.It can be duplicated

38. Fill in the blank: In 2NF, all non-prime attributes must fully depend on the _____.

A.entire candidate key
B.primary key only
C.first attribute
D.composite key alone

39. Which of the following statements is NOT true regarding Third Normal Form (3NF)?

A.3NF eliminates transitive dependencies.
B.3NF requires that all attributes depend only on the primary key.
C.3NF allows non-key attributes to depend on other non-key attributes.
D.3NF improves data integrity by reducing redundancy.

40. Which of the following statements is NOT true about Second Normal Form (2NF)?

A.All non-prime attributes must depend on the entire candidate key.
B.A table in 2NF can still have partial dependencies.
C.A table must be in 1NF to be in 2NF.
D.2NF reduces data redundancy.

Related Study Sets

Create Your Own Study Set

Upload a PDF, paste your notes, or describe a topic – AI generates flashcards, quizzes and more in seconds.