Câu hỏi phỏng vấn Databases
Câu hỏi

What is Normalisation?

Câu trả lời

Normalization is a database design technique used to organize data in a relational database to reduce redundancy and improve data integrity. The process involves structuring a database according to a series of normal forms, each with specific rules and requirements. The primary goals of normalization are to eliminate redundant data, ensure data dependencies are logical, and protect the database from anomalies such as insertion, update, and deletion anomalies.

Key Concepts of Normalization

  1. First Normal Form (1NF):

    • Ensures that the table is organized such that each column contains atomic (indivisible) values and each record is unique.
    • Eliminates repeating groups by creating separate tables for related data and identifying each set of related data with a primary key[1][4][5].
  2. Second Normal Form (2NF):

    • Builds on 1NF by ensuring that all non-key attributes are fully functionally dependent on the primary key.
    • Removes partial dependencies, where an attribute is dependent on only a part of a composite primary key[1][4][5].
  3. Third Normal Form (3NF):

    • Extends 2NF by ensuring that all non-key attributes are not only fully functionally dependent on the primary key but also independent of each other.
    • Eliminates transitive dependencies, where non-key attributes depend on other non-key attributes[1][4][5].
  4. Boyce-Codd Normal Form (BCNF):

    • A stricter version of 3NF, which requires that every determinant is a candidate key.
    • Addresses certain types of anomalies not covered by 3NF[1][4][5].
  5. Fourth Normal Form (4NF):

    • Ensures that there are no multi-valued dependencies, where one attribute in a table uniquely determines another attribute, which can have multiple values.
    • Requires that a table be in BCNF and that it contains no multi-valued dependencies[1][4][5].
  6. Fifth Normal Form (5NF):

    • Also known as "Projection-Join Normal Form" (PJNF), it ensures that a table can be reconstructed from its projections without any loss of data.
    • Requires that a table be in 4NF and that it contains no join dependencies[1][4][5].

Benefits of Normalization

  • Reduces Data Redundancy: By dividing larger tables into smaller, re...
junior

junior

Gợi ý câu hỏi phỏng vấn

expert

How does database Indexing work?

middle

What is Optimistic Locking?

junior

What are the advantages of NoSQL over traditional RDBMS?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào