Q1
True / FalseMySQL, a table is in Second Normal Form if it is in First Normal Form and all non-key attributes are fully functionally dependent on the primary key.
Second Normal Form (2NF) requires the table to be in First Normal Form (1NF) and that all non-key attributes must be fully functionally dependent on the primary key.
Q2
True / Falsetable with a single-column primary key is always in Second Normal Form in MySQL.
With a single-column primary key, there cannot be any partial dependencies, so the table is automatically in 2NF if it meets the criteria of 1NF.
Q3
True / Falseachieve Second Normal Form in MySQL, you must remove all repeating groups from the table.
Removing repeating groups is a requirement for First Normal Form (1NF), not Second Normal Form (2NF).
Q4
True / FalseMySQL, if a table is in Second Normal Form, there can be transitive dependencies.
Second Normal Form addresses partial dependencies, but transitive dependencies are addressed in Third Normal Form (3NF).
Q5
True / FalseMySQL, to convert a table to Second Normal Form, you may need to decompose the table into smaller tables.
Decomposition is often necessary to eliminate partial dependencies and ensure that non-key attributes are fully functionally dependent on the entire primary key.
Q6
True / FalseMySQL, Second Normal Form only applies to tables with composite primary keys.
While 2NF mainly addresses issues that arise with composite primary keys, it is still applicable to tables with single-column primary keys to confirm they meet the criteria.
Q7
True / FalseMySQL, a table in Second Normal Form cannot have any multi-valued attributes.
Multi-valued attributes violate First Normal Form (1NF), which is a prerequisite for Second Normal Form (2NF).
Q8
True / FalseMySQL, a table in Second Normal Form is free of update anomalies related to partial dependencies.
Since 2NF eliminates partial dependencies, update anomalies related to such dependencies are resolved.
Q9
True / FalseMySQL, Second Normal Form ensures that every non-prime attribute is non-transitively dependent on the primary key.
This is the requirement for Third Normal Form (3NF), not Second Normal Form (2NF).
Q10
True / FalseMySQL database, ensuring a table is in Second Normal Form is sufficient to prevent all types of data anomalies.
Second Normal Form (2NF) only eliminates partial dependencies. To fully prevent all types of data anomalies, a table must be in Third Normal Form (3NF) or even higher normal forms, addressing transitive dependencies and other issues.
Q15
Single ChoiceA MySQL table Students has columns StudentID, CourseID, CourseName, and Instructor. StudentID and CourseID together form the primary key. Which of the following redesigns would achieve 2NF?
Splitting into Students(StudentID, CourseID) and Courses(CourseID, CourseName, Instructor) removes partial dependencies by separating data into related tables.
Q17
Single ChoiceConsider a MySQL table Projects with columns ProjectID, TaskID, TaskDescription, and TaskDueDate. ProjectID and TaskID form the composite primary key. To convert this table into 2NF, which of the following would be the correct approach?
Creating separate tables ProjectTasks and Tasks eliminates partial dependencies and achieves 2NF.
Q18
Single ChoiceA MySQL table EmployeeAssignments has columns EmployeeID, ProjectID, EmployeeName, and ProjectName. The primary key is a composite key consisting of EmployeeID and ProjectID. How would you redesign this table to be in 2NF?
Splitting into Employees and Projects removes partial dependencies, as EmployeeName and ProjectName are dependent on their respective primary keys.
Q21
Multiple ChoiceWhich SQL statement illustrates moving a database design from first normal form (1NF) to second normal form (2NF) by removing partial dependencies?
SQL Code
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)
);
CREATE TABLE departments (
department_id INT PRIMARY KEY,
department_name VARCHAR(100)
);
Second Normal Form (2NF) removes partial dependencies by ensuring that non-key attributes are fully dependent on the primary key. The code provided shows how to separate department data into its own table.
Q22
Multiple ChoiceWhich SQL code demonstrates a table design that adheres to the principles of second normal form (2NF) by eliminating partial dependencies?
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)
);
In second normal form (2NF), partial dependencies are removed by ensuring that all non-key attributes are fully functionally dependent on the primary key. This is accomplished by separating related data into distinct tables.
Q23
Multiple ChoiceWhich SQL snippet correctly illustrates a design that moves a database from 1NF to 2NF by organizing data into separate tables?
SQL Code
CREATE TABLE projects (
project_id INT PRIMARY KEY,
project_name VARCHAR(100)
);
CREATE TABLE employees (
employee_id INT PRIMARY KEY,
employee_name VARCHAR(100),
project_id INT,
FOREIGN KEY (project_id) REFERENCES projects(project_id)
);
Second Normal Form (2NF) is achieved by organizing data into separate tables to ensure that each non-key attribute is fully dependent on the primary key and not just part of it. This design adheres to 2NF.
Q24
Multiple ChoiceChoose the SQL code that best demonstrates the transition from 1NF to 2NF by creating separate tables for related data.
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 (
student_id INT,
course_id INT,
FOREIGN KEY (student_id) REFERENCES students(student_id),
FOREIGN KEY (course_id) REFERENCES courses(course_id)
);
Second Normal Form (2NF) is about eliminating partial dependencies by organizing data into separate tables for each related entity. The provided design effectively demonstrates this principle.
Q25
Multiple ChoiceWhich SQL code snippet properly moves a database design to 2NF by removing partial dependencies?
SQL Code
CREATE TABLE departments (
department_id INT PRIMARY KEY,
department_name VARCHAR(100)
);
CREATE TABLE employees (
employee_id INT PRIMARY KEY,
employee_name VARCHAR(100),
department_id INT,
FOREIGN KEY (department_id) REFERENCES departments(department_id)
);
Second Normal Form (2NF) is achieved by ensuring that all non-key attributes in a table are fully dependent on the entire primary key. This design separates department data into its own table to comply with 2NF.
Q27
Multiple ChoiceWhich SQL snippet best illustrates achieving 2NF by eliminating partial dependencies from a table design?
SQL Code
CREATE TABLE products (
product_id INT PRIMARY KEY,
product_name VARCHAR(100)
);
CREATE TABLE orders (
order_id INT PRIMARY KEY,
product_id INT,
order_date DATE,
FOREIGN KEY (product_id) REFERENCES products(product_id)
);
Second Normal Form (2NF) eliminates partial dependencies by ensuring that all non-key attributes are fully dependent on the primary key. This design separates product and order data into distinct tables.
Q28
Multiple ChoiceWhich SQL code effectively moves a database table design to 2NF by addressing partial dependencies and creating separate tables?
SQL Code
CREATE TABLE authors (
author_id INT PRIMARY KEY,
author_name VARCHAR(100)
);
CREATE TABLE books (
book_id INT PRIMARY KEY,
author_id INT,
book_title VARCHAR(100),
FOREIGN KEY (author_id) REFERENCES authors(author_id)
);
Second Normal Form (2NF) is achieved by separating data into related tables, ensuring that all non-key attributes are fully dependent on the primary key and not on just part of it.
Q29
Multiple ChoiceWhich SQL code snippet is an example of achieving second normal form (2NF) by eliminating partial dependencies?
SQL Code
CREATE TABLE categories (
category_id INT PRIMARY KEY,
category_name VARCHAR(100)
);
CREATE TABLE products (
product_id INT PRIMARY KEY,
category_id INT,
product_name VARCHAR(100),
FOREIGN KEY (category_id) REFERENCES categories(category_id)
);
In second normal form (2NF), partial dependencies are eliminated by ensuring that all non-key attributes are fully dependent on the entire primary key. This is achieved by separating category and product data into distinct tables.
Q30
Multiple ChoiceWhich SQL code properly achieves 2NF by eliminating partial dependencies and organizing data into related tables?
SQL Code
CREATE TABLE publishers (
publisher_id INT PRIMARY KEY,
publisher_name VARCHAR(100)
);
CREATE TABLE books (
book_id INT PRIMARY KEY,
publisher_id INT,
book_title VARCHAR(100),
FOREIGN KEY (publisher_id) REFERENCES publishers(publisher_id)
);
Second Normal Form (2NF) is achieved by organizing data into related tables and ensuring that all non-key attributes are fully dependent on the primary key. This design separates publisher and book data.