Q1
True / FalseMySQL, normalization involves organizing data to minimize redundancy.
Normalization is the process of structuring a relational database in a way that reduces redundancy and improves data integrity.
Q2
True / FalseMySQL, the first normal form (1NF) requires that all columns in a table have unique values.
The first normal form (1NF) requires that each column contains only atomic (indivisible) values and that each column contains values of a single type, not necessarily unique values.
Q3
True / FalseMySQL, a table is in the second normal form (2NF) if it is already in the first normal form (1NF) and has no partial dependencies
Second normal form (2NF) eliminates partial dependencies, meaning all non-key attributes must depend on the entire primary key.
Q4
True / FalseMySQL, the third normal form (3NF) is achieved when a table is in second normal form (2NF) and there are no transitive dependencies.
Third normal form (3NF) requires that all the attributes in a table are dependent only on the primary key and not on any other non-key attribute.
Q5
True / FalseMySQL, denormalization is the process of applying normalization principles to a database design.
Denormalization is the process of combining normalized tables to improve read performance at the cost of write performance and increased redundancy.
Q6
True / FalseMySQL, normalization to the Boyce-Codd Normal Form (BCNF) can sometimes require decomposing tables into smaller tables.
BCNF is a stricter version of 3NF, and achieving BCNF often requires further decomposing tables to eliminate anomalies.
Q7
True / FalseMySQL, a table in fourth normal form (4NF) must also be in Boyce-Codd Normal Form (BCNF).
Fourth normal form (4NF) requires that the table is already in BCNF and that it eliminates multi-valued dependencies.
Q8
True / FalseMySQL, a table in fifth normal form (5NF) eliminates all join dependencies and is also known as project-join normal form (PJNF).
Fifth normal form (5NF), or project-join normal form (PJNF), ensures that a table is decomposed to the point where it cannot be further decomposed without losing data integrity
Q9
True / FalseMySQL, tables in domain-key normal form (DKNF) can have redundancy if domain constraints are not enforced.
Domain-key normal form (DKNF) ensures that all constraints and rules are enforced by domain and key constraints, leaving no room for redundancy.
Q10
True / FalseMySQL, achieving sixth normal form (6NF) is essential for all database designs to ensure minimal redundancy and maximum data integrity.
Sixth normal form (6NF) is not commonly used in practice. It is typically applicable only in very specific scenarios involving temporal data. Most practical database designs aim for 3NF or BCNF to balance normalization and performance.
Q21
Multiple ChoiceWhich SQL statement demonstrates normalization by splitting a table into two to eliminate redundancy?
SQL Code
CREATE TABLE customers (
customer_id INT PRIMARY KEY,
name VARCHAR(100)
);
CREATE TABLE orders (
order_id INT PRIMARY KEY,
customer_id INT,
order_date DATE,
FOREIGN KEY (customer_id) REFERENCES customers(customer_id)
);
Normalization involves structuring a database to reduce redundancy and dependency by organizing data into separate related tables.
Q22
Multiple ChoiceWhich SQL code illustrates the concept of first normal form (1NF) in a table design?
SQL Code
CREATE TABLE employees (
employee_id INT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
address VARCHAR(255)
);
First Normal Form (1NF) ensures that each column contains atomic values, and each record is unique. The table design shown is compliant with 1NF principles.
Q23
Multiple ChoiceWhich SQL statement correctly moves a database design from first normal form (1NF) to second normal form (2NF)?
SQL Code
CREATE TABLE departments (
department_id INT PRIMARY KEY,
department_name VARCHAR(100)
);
CREATE TABLE employees (
employee_id INT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
department_id INT,
FOREIGN KEY (department_id) REFERENCES departments(department_id)
);
Second Normal Form (2NF) eliminates partial dependencies by ensuring that non-primary key attributes are fully dependent on the primary key. This is achieved by creating separate tables for related data.
Q24
Multiple ChoiceWhich SQL code snippet is an example of achieving third normal form (3NF) in a table design?
SQL Code
CREATE TABLE products (
product_id INT PRIMARY KEY,
product_name VARCHAR(100),
category_id INT,
FOREIGN KEY (category_id) REFERENCES categories(category_id)
);
CREATE TABLE categories (
category_id INT PRIMARY KEY,
category_name VARCHAR(100)
);
Third Normal Form (3NF) eliminates transitive dependencies by ensuring that all attributes are dependent only on the primary key. The design provided adheres to 3NF by separating product information from category information.
Q25
Multiple ChoiceSelect the SQL code that demonstrates normalization by breaking down a table to eliminate redundancy and ensure referential integrity.
SQL Code
CREATE TABLE customers (
customer_id INT PRIMARY KEY,
customer_name VARCHAR(100)
);
CREATE TABLE orders (
order_id INT PRIMARY KEY,
customer_id INT,
order_date DATE,
FOREIGN KEY (customer_id) REFERENCES customers(customer_id)
);
Normalization reduces data redundancy by organizing data into multiple related tables, each with a unique primary key and foreign key relationships to ensure referential integrity.
Q26
Multiple ChoiceWhich SQL statement best demonstrates the transition from second normal form (2NF) to third normal form (3NF) by eliminating transitive dependencies?
SQL Code
CREATE TABLE employees (
employee_id INT PRIMARY KEY,
employee_name VARCHAR(100),
department_id INT,
salary DECIMAL(10, 2),
FOREIGN KEY (department_id) REFERENCES departments(department_id)
);
CREATE TABLE departments (
department_id INT PRIMARY KEY,
department_name VARCHAR(100)
);
Third Normal Form (3NF) is achieved by removing transitive dependencies, ensuring that non-primary key attributes are dependent only on the primary key. This is done by creating a separate table for departments.
Q27
Multiple ChoiceWhich SQL code effectively demonstrates the normalization process by removing partial dependencies in a relational table?
SQL Code
CREATE TABLE projects (
project_id INT PRIMARY KEY,
project_name VARCHAR(100),
manager_id INT,
FOREIGN KEY (manager_id) REFERENCES managers(manager_id)
);
CREATE TABLE managers (
manager_id INT PRIMARY KEY,
manager_name VARCHAR(100)
);
Normalization, particularly moving from 1NF to 2NF, involves removing partial dependencies, which means ensuring that all non-primary key attributes are fully functionally dependent on the primary key.
Q28
Multiple ChoiceWhich SQL code demonstrates how normalization helps in eliminating data anomalies by organizing data into related tables?
SQL Code
CREATE TABLE students (
student_id INT PRIMARY KEY,
student_name VARCHAR(100)
);
CREATE TABLE enrollments (
enrollment_id INT PRIMARY KEY,
student_id INT,
course_id INT,
FOREIGN KEY (student_id) REFERENCES students(student_id)
);
Normalization eliminates data anomalies such as insertion, update, and deletion anomalies by organizing data into related tables, ensuring that each table stores data relevant only to a specific entity.
Q29
Multiple ChoiceChoose the SQL code that effectively demonstrates third normal form (3NF) by eliminating all non-key dependencies in a table design.
SQL Code
CREATE TABLE employees (
employee_id INT PRIMARY KEY,
employee_name VARCHAR(100),
department_id INT,
salary DECIMAL(10, 2),
FOREIGN KEY (department_id) REFERENCES departments(department_id)
);
CREATE TABLE departments (
department_id INT PRIMARY KEY,
department_name VARCHAR(100)
);
Third Normal Form (3NF) eliminates non-key dependencies, ensuring that attributes in a table are dependent only on the primary key. The design provided follows this principle by separating employee and department data.
Q30
Multiple ChoiceWhich SQL code snippet best illustrates the normalization process to achieve higher normal forms by removing transitive dependencies?
SQL Code
CREATE TABLE students (
student_id INT PRIMARY KEY,
student_name VARCHAR(100)
);
CREATE TABLE courses (
course_id INT PRIMARY KEY,
course_name VARCHAR(100)
);
CREATE TABLE enrollments (
enrollment_id INT PRIMARY KEY,
student_id INT,
course_id INT,
FOREIGN KEY (student_id) REFERENCES students(student_id),
FOREIGN KEY (course_id) REFERENCES courses(course_id)
);
Higher normal forms, such as 3NF, are achieved by eliminating transitive dependencies and organizing data into related tables. This design shows how separate tables are used for students, courses, and enrollments, linking them through foreign keys.