Q1
True / FalseIn MySQL, a table is in Third Normal Form (3NF) if it is in Second Normal Form (2NF) and has no transitive dependencies.
Third Normal Form requires that a table be in Second Normal Form and that all its attributes are only dependent on the primary key.
Q2
True / FalseA table in MySQL with non-prime attributes that are transitively dependent on the primary key is considered to be in Third Normal Form (3NF).
Third Normal Form eliminates transitive dependencies, meaning non-prime attributes must not be dependent on other non-prime attributes.
Q3
True / FalseIf a MySQL table is in Third Normal Form (3NF), it automatically means it is also in Second Normal Form (2NF).
Third Normal Form builds upon the requirements of Second Normal Form, so a table in 3NF is also in 2NF.
Q4
True / FalseIn MySQL, achieving Third Normal Form (3NF) involves ensuring that no column is transitively dependent on the primary key.
Third Normal Form requires that all attributes are directly dependent on the primary key and not on any other non-prime attribute.
Q5
True / FalseA table in MySQL can be in Third Normal Form (3NF) even if it has partial dependencies.
Partial dependencies are addressed in the Second Normal Form, which is a prerequisite for the Third Normal Form.
Q6
True / FalseIn MySQL, if a table is in Third Normal Form (3NF), it can still have redundancy issues.
While Third Normal Form reduces certain types of redundancy, it does not eliminate all possible redundancies.
Q7
True / FalseIn MySQL, converting a table from Second Normal Form (2NF) to Third Normal Form (3NF) may require splitting the table into multiple tables.
To eliminate transitive dependencies, it is often necessary to decompose a table into smaller tables.
Q8
True / FalseIn MySQL, a table in Third Normal Form (3NF) should not have any non-key attributes that depend on other non-key attributes.
This is a requirement of Third Normal Form to ensure no transitive dependencies exist.
Q9
True / FalseA MySQL table in Third Normal Form (3NF) might need additional foreign keys to maintain data integrity after decomposition.
Decomposing tables to achieve 3NF can result in the creation of new tables with foreign keys to maintain relationships and data integrity.
Q10
True / FalseIn MySQL, normalization to Third Normal Form (3NF) always improves query performance.
While 3NF reduces redundancy and improves data integrity, it can sometimes lead to more complex queries, which may negatively impact performance in certain scenarios.
Q21
Multiple ChoiceWhich SQL statement demonstrates the concept of Third Normal Form (3NF) by eliminating transitive 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) is achieved by ensuring that all attributes in a table are dependent only on the primary key. This is done by removing transitive dependencies, which occur when non-key attributes depend on other non-key attributes.
Q22
Multiple ChoiceWhich SQL code demonstrates moving from Second Normal Form (2NF) to Third Normal Form (3NF) by organizing data into related tables?
SQL Code
CREATE TABLE orders (
order_id INT PRIMARY KEY,
customer_id INT,
order_date DATE
);
CREATE TABLE customers (
customer_id INT PRIMARY KEY,
customer_name VARCHAR(100),
customer_address VARCHAR(255)
);
CREATE TABLE order_items (
order_id INT,
product_id INT,
quantity INT,
PRIMARY KEY (order_id, product_id),
FOREIGN KEY (order_id) REFERENCES orders(order_id),
FOREIGN KEY (product_id) REFERENCES products(product_id)
);
Third Normal Form (3NF) removes transitive dependencies by ensuring that non-key attributes are only dependent on the primary key, and not on other non-key attributes. The provided SQL code separates customer, order, and product data into related tables.
Q23
Multiple ChoiceWhich SQL snippet correctly represents a database design that adheres to Third Normal Form (3NF) by eliminating transitive dependencies?
SQL Code
CREATE TABLE books (
book_id INT PRIMARY KEY,
title VARCHAR(100),
author_id INT,
FOREIGN KEY (author_id) REFERENCES authors(author_id)
);
CREATE TABLE authors (
author_id INT PRIMARY KEY,
author_name VARCHAR(100)
);
CREATE TABLE publishers (
publisher_id INT PRIMARY KEY,
publisher_name VARCHAR(100)
);
Third Normal Form (3NF) eliminates transitive dependencies by ensuring that all non-key attributes are dependent only on the primary key, not on other non-key attributes. This is achieved by separating related data into distinct tables.
Q24
Multiple ChoiceChoose the SQL code that demonstrates achieving Third Normal Form (3NF) by eliminating all non-key dependencies 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) ensures that all non-key attributes are directly dependent only on the primary key. The provided SQL design separates product information from category information, adhering to 3NF principles.
Q25
Multiple ChoiceWhich SQL code best exemplifies the application of Third Normal Form (3NF) by organizing data into related tables and eliminating 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)
);
Third Normal Form (3NF) is achieved by organizing data into related tables and ensuring that all attributes are dependent only on the primary key. This design effectively demonstrates 3NF by separating students, courses, and enrollments.
Q26
Multiple ChoiceWhich SQL code snippet effectively eliminates transitive dependencies to achieve Third Normal Form (3NF) in a relational table?
SQL Code
CREATE TABLE orders (
order_id INT PRIMARY KEY,
customer_id INT,
order_date DATE,
FOREIGN KEY (customer_id) REFERENCES customers(customer_id)
);
CREATE TABLE customers (
customer_id INT PRIMARY KEY,
customer_name VARCHAR(100),
customer_address VARCHAR(255)
);
Third Normal Form (3NF) eliminates transitive dependencies by ensuring that all attributes are dependent only on the primary key. The design provided separates order and customer data into distinct tables, adhering to 3NF.
Q27
Multiple ChoiceWhich SQL statement best demonstrates moving a table design to Third Normal Form (3NF) by addressing 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) removes transitive dependencies, which occur when non-key attributes depend on other non-key attributes. This design organizes data to ensure that all attributes are directly dependent on the primary key.
Q28
Multiple ChoiceChoose the SQL code that correctly illustrates the transition from 2NF to 3NF by removing transitive dependencies in a table.
SQL Code
CREATE TABLE books (
book_id INT PRIMARY KEY,
title VARCHAR(100),
author_id INT,
publisher_id INT,
FOREIGN KEY (author_id) REFERENCES authors(author_id),
FOREIGN KEY (publisher_id) REFERENCES publishers(publisher_id)
);
CREATE TABLE authors (
author_id INT PRIMARY KEY,
author_name VARCHAR(100)
);
CREATE TABLE publishers (
publisher_id INT PRIMARY KEY,
publisher_name VARCHAR(100)
);
Third Normal Form (3NF) is achieved by eliminating transitive dependencies, which are dependencies between non-key attributes. The SQL code provided demonstrates how to separate book, author, and publisher data into related tables.
Q29
Multiple ChoiceWhich SQL code effectively organizes a database design into Third Normal Form (3NF) by eliminating all non-key dependencies?
SQL Code
CREATE TABLE students (
student_id INT PRIMARY KEY,
student_name VARCHAR(100)
);
CREATE TABLE addresses (
address_id INT PRIMARY KEY,
student_id INT,
address VARCHAR(255),
FOREIGN KEY (student_id) REFERENCES students(student_id)
);
Third Normal Form (3NF) eliminates non-key dependencies by ensuring that all attributes are dependent only on the primary key. The SQL code provided demonstrates how to separate student and address data into distinct tables, adhering to 3NF.
Q30
Multiple ChoiceWhich SQL snippet best illustrates achieving Third Normal Form (3NF) by organizing data into related tables and removing transitive dependencies?
SQL Code
CREATE TABLE projects (
project_id INT PRIMARY KEY,
project_name VARCHAR(100)
);
CREATE TABLE teams (
team_id INT PRIMARY KEY,
team_name VARCHAR(100)
);
CREATE TABLE project_teams (
project_id INT,
team_id INT,
PRIMARY KEY (project_id, team_id),
FOREIGN KEY (project_id) REFERENCES projects(project_id),
FOREIGN KEY (team_id) REFERENCES teams(team_id)
);
Third Normal Form (3NF) is achieved by removing transitive dependencies and organizing data into related tables. This SQL snippet effectively separates project and team data, ensuring all attributes are directly dependent on the primary key.