Database Normalization Explained

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the primary goal of normalization in database design?

  • To organize tables in a way that reduces redundancy and dependency. (correct)
  • To increase the size of tables for better data storage.
  • To introduce redundancy and dependency in data.
  • To minimize relationships between tables.

Which characteristic is NOT typically associated with a properly normalized database?

  • Minimal use of NULL values.
  • No multiple values in a single field.
  • Maximum loss of information. (correct)
  • Absence of redundancy.

As the level of normalization increases, what generally happens to the number of tables and the level of redundancy in a database?

  • Number of tables increases; redundancy decreases. (correct)
  • Number of tables increases; redundancy increases.
  • Number of tables decreases; redundancy increases.
  • Number of tables decreases; redundancy decreases.

Which normal form requires that the domain of each attribute contains only atomic values?

<p>First Normal Form (1NF) (C)</p> Signup and view all the answers

In First Normal Form (1NF), what is done with repeating fields in a table?

<p>They are separated into new database tables, along with the key from the original table. (C)</p> Signup and view all the answers

Consider a 'Course' table that initially contains 'Course ID' and 'Content' as attributes, where content includes multiple programming languages. What 1NF transformation should you apply?

<p>Create separate columns for each piece of content (e.g., Content1, Content2, Content3) for each course. (C)</p> Signup and view all the answers

What is the result of applying 1NF to a table with a 'Borrowed books' attribute that contains multiple book titles for each patron?

<p>The table is restructured so that each row contains only one book title per patron. (D)</p> Signup and view all the answers

What does it mean when one set of attributes in a table 'determines' another set of attributes?

<p>It means there is a functional dependency, where the value of one set predicts the value of the other. (C)</p> Signup and view all the answers

In the context of functional dependencies, what does $X \rightarrow Y$ mean?

<p>X determines Y; for each value of X, there is exactly one corresponding value of Y. (A)</p> Signup and view all the answers

What is a key requirement for a table to be in Second Normal Form (2NF)?

<p>It must be in First Normal Form (1NF) and have no partial dependencies. (B)</p> Signup and view all the answers

What is 'partial dependency' in the context of database normalization?

<p>When a non-key attribute depends on only part of the primary key. (D)</p> Signup and view all the answers

Consider a scenario where 'Course Name' depends only on 'CourseID', which together with 'SemesterID' forms the primary key. How do you resolve this partial dependency to achieve 2NF?

<p>Create a new table containing 'CourseID' and 'Course Name', and leave 'CourseID' and 'SemesterID' in the original table. (A)</p> Signup and view all the answers

In the context of 2NF, if a data item is functionally dependent on only part of the primary key, what should you do?

<p>Move that data item and the part of the primary key it depends on to a new table. (C)</p> Signup and view all the answers

Which statement accurately describes the relationship between functional dependencies and normalization?

<p>Normalization uses functional dependencies to decompose tables and reduce redundancy. (D)</p> Signup and view all the answers

Consider a database table 'Books' with attributes ISBN, Title, AuName, AuPhone, PubName, PubPhone, and Price. Given the functional dependencies {ISBN} -> {Title, PubName} and {ISBN, AuName} -> {AuPhone}, which primary key best supports normalization efforts?

<p>ISBN (A)</p> Signup and view all the answers

In a 1NF transformation, what is the most important characteristic of the new table's primary key regarding its origin?

<p>It can be an attribute or combined attributes with unique values. (A)</p> Signup and view all the answers

What is the primary impact of increasing the level of normalization on database queries?

<p>Queries may require more joins, but data redundancy is reduced. (A)</p> Signup and view all the answers

In a table not in 1NF, an attribute contains multiple values (e.g., a list of skills for an employee). How is this addressed when converting to 1NF?

<p>A new table is created to list each value as a separate row, linked to the original table through a foreign key. (D)</p> Signup and view all the answers

When transitioning a database schema from NOT 2NF to 2NF, what conditions must the original schema fail to meet?

<p>It must have a partial dependancy. (A)</p> Signup and view all the answers

You have a table 'Employees' with columns 'EmployeeID', 'ProjectID', and 'ProjectName'. Each project has a unique 'ProjectID', and 'ProjectName' is solely determined by 'ProjectID'. How would this table be restructured to satisfy 2NF?

<p>Create a separate 'Projects' table with 'ProjectID' and 'ProjectName', and keep 'EmployeeID' and 'ProjectID' in the 'Employees' table. (C)</p> Signup and view all the answers

Flashcards

What is Normalization?

A database design technique that reduces redundancy and dependency by organizing tables, dividing larger tables into smaller ones, and linking them using relationships.

Characteristics of a Normalized Database?

A database should not have multiple values in a single field, should have absence of redundancy, should have minimual use of NULL values and minimal loss of information.

What are the Levels of Normalization?

First Normal Form, Second Normal Form, Third Normal Form, Boyce-Codd Normal Form, Fourth Normal Form, Fifth Normal Form, and Domain Key Normal Form.

What is First Normal Form (1NF)?

Each attribute contains only atomic values, each attribute has a defined domain and each attribute only contains single values from that domain. Repeating fields are separated into new tables, linked by keys.

Signup and view all the flashcards

What is an Atomic Value?

A value that cannot be further subdivided. It's indivisible.

Signup and view all the flashcards

What is a Domain?

A set of valid values for an attribute.

Signup and view all the flashcards

Functional Dependency?

That one set of attributes in a table determines another set of attributes in a table.

Signup and view all the flashcards

X → Y?

For each value of X, there is exactly one corresponding value of Y.

Signup and view all the flashcards

What is Second Normal Form (2NF)?

In 2NF the database must be in first normal form and all nonkey attributes in the table must be functionally dependent on the entire primary key.

Signup and view all the flashcards

What is a Partial Dependency?

It refers to when an attribute depends on only a part of the primary key.

Signup and view all the flashcards

Study Notes

  • Normalization is a database design technique that organizes tables to reduce redundancy and dependency of data.
  • Normalization divides larger tables into smaller tables and links them through relationships.

Characteristics of a Properly Normalized Database

  • Should not contain multiple values in a single field.
  • Absence of redundancy.
  • Minimal use of NULL values.
  • Minimal loss of information.

Levels of Normalization

  • Levels are based on the amount of redundancy in the database.
  • First Normal Form (1NF)
  • Second Normal Form (2NF)
  • Third Normal Form (3NF)
  • Boyce-Codd Normal Form (BCNF)
  • Fourth Normal Form (4NF)
  • Fifth Normal Form (5NF)
  • Domain Key Normal Form (DKNF)

1NF Explained

  • Tables must contain only atomic values within each attribute's domain.
  • The value of each attribute contains only a single value from that domain.
  • Repeating fields should be separated into new tables, along with the key from the original unnormalized table.

Functional Dependencies

  • If one set of attributes in a table determines another set of attributes, the latter is functionally dependent on the first.
  • If for each value of X, there is exactly one corresponding value of Y, shown as X → Y.

Partial Dependency

  • A candidate key is a minimal set of attributes that can uniquely determine all other attributes in the table.

Requirements for 2NF

  • Must be in 1NF.
  • All non-key attributes must be fully functionally dependent on the entire primary key.

Rules of 2NF

  • If a data item depends on only part of the primary key, move it and that part of the key to a new table.
  • Move other items dependent on the same key part to the new table as well.
  • Copied partial primary key then becomes the primary key for the newly created table.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

Use Quizgecko on...
Browser
Browser