MySQL Database Quiz Questions

Course Name:MySQL
Chapter Name:Chapter 8 - RDBMS Concepts
Lesson Content Link:Second Normal Form
Current Quiz Count:30
Progress
0%
Q1
True / False

MySQL, 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.

Q2
True / False

table with a single-column primary key is always in Second Normal Form in MySQL.

Q3
True / False

achieve Second Normal Form in MySQL, you must remove all repeating groups from the table.

Q4
True / False

MySQL, if a table is in Second Normal Form, there can be transitive dependencies.

Q5
True / False

MySQL, to convert a table to Second Normal Form, you may need to decompose the table into smaller tables.

Q6
True / False

MySQL, Second Normal Form only applies to tables with composite primary keys.

Q7
True / False

MySQL, a table in Second Normal Form cannot have any multi-valued attributes.

Q8
True / False

MySQL, a table in Second Normal Form is free of update anomalies related to partial dependencies.

Q9
True / False

MySQL, Second Normal Form ensures that every non-prime attribute is non-transitively dependent on the primary key.

Q10
True / False

MySQL database, ensuring a table is in Second Normal Form is sufficient to prevent all types of data anomalies.

Q11
Single Choice

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

Q12
Single Choice

Which of the following statements about 2NF is true in MySQL?

Q13
Single Choice

Which type of dependency must be eliminated to achieve 2NF in MySQL?

Q14
Single Choice

Consider a MySQL table Orders with columns OrderID, ProductID, ProductName, and OrderDate. If OrderID and ProductID together form the primary key, which of the following would violate 2NF?

Q15
Single Choice

A 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?

Q16
Single Choice

In a MySQL database, which of the following scenarios indicates that a table is not in 2NF?

Q17
Single Choice

Consider 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?

Q18
Single Choice

A 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?

Q19
Single Choice

In a MySQL database design, why might achieving 2NF be particularly important for tables with composite primary keys?

Q20
Single Choice

A MySQL certification exam question states: Given a table Sales with columns SaleID, ProductID, ProductName, and SaleDate, with SaleID and ProductID forming the composite primary key, which normal form is violated if ProductName is dependent on ProductID?

Q21
Multiple Choice

Which 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)
);
Q22
Multiple Choice

Which 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)
);
Q23
Multiple Choice

Which 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)
);
Q24
Multiple Choice

Choose 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)
);
Q25
Multiple Choice

Which 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)
);
Q26
Multiple Choice

Which SQL statement effectively demonstrates the normalization process from 1NF to 2NF by addressing partial dependencies in a relational table?

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)
);
Q27
Multiple Choice

Which 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)
);
Q28
Multiple Choice

Which 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)
);
Q29
Multiple Choice

Which 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)
);
Q30
Multiple Choice

Which 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)
);