programming beginner 10 sample questions

Database Normalization MCQ Practice Test

Reducing redundancy by organizing data into tables. Understanding 1:1, 1:N, and N:M relationships.

Q1. You have a database schema designed to track scientific publications, including authors, journals, and keywords. The `Publication` table has attributes: `publicationID`, `title`, `journalID`, `publicationDate`, and a multi-valued attribute `authors` represented as a JSON array of author IDs. The `Journal` table has `journalID`, `journalName`, and `ISSN`. The `Author` table contains `authorID`, `authorName`, and `affiliation`. To achieve Boyce-Codd Normal Form (BCNF), which of the following refactoring strategies is MOST appropriate and efficient, considering potential performance impacts of frequent lookups and joins?

Explanation: Option A provides the most efficient path to BCNF. While Option B achieves 4NF, it's significantly more complex and likely less performant for frequent queries involving authors and publications. Option C ignores the normalization issue. Option D addresses a separate normalization concern (keywords) but doesn't fully address the multi-valued author attribute problem. The approach in Option A balances normalization requirements with practical performance considerations; the JSON array can provide performance benefits for certain queries while the linked table guarantees referential integrity and avoids redundancy.

Q2. A database designer has a table named “orders” with the following columns: “order_id”, “customer_id”, “product_id”, and “order_date”. The designer wants to normalize this table by moving the “customer_id” column to a separate table. However, there is a dependency between the “order_id” column and the “customer_id” column. Which of the following normalization techniques can be used to resolve this dependency?

Explanation: In this scenario, the designer wants to move the customer_id column to a separate table, but there is a dependency between the order_id column and the customer_id column. This is an example of a functional dependency, where the order_id column determines the customer_id column. The BCNF normalization technique is used to resolve functional dependencies, ensuring that each non-key attribute depends on the entire primary key, not just one part of it.

Q3. A university stores course grades in a table with columns StudentID, CourseID, and Grade, where each student receives exactly one grade per course. What is the most appropriate primary key for this table?

Explanation: Neither StudentID (a student takes many courses) nor CourseID (a course has many students) is unique on its own, and Grade carries no identity — but the pair (StudentID, CourseID) identifies exactly one row each, making it the natural composite primary key. The original sample data (duplicate Column A with different C, and B dependent on A) actually demanded 2NF decomposition, which made 'the' 3NF key ill-defined.

Q4. A database designer has a table with the following structure: | Customer ID (PK) | Name | Order ID (FK) | Order Date | | --- | --- | --- | --- | | 1 | John | 101 | 2022-01-01 | | 2 | Jane | 102 | 2022-01-15 | | 1 | John | 103 | 2022-02-01 | Which of the following is a correct normalization step to eliminate the redundancy in the Order Date field?

Explanation: In this scenario, the Order Date field is not dependent on the Customer ID, but rather on the Order ID. Therefore, it should be stored in a separate table for orders, which is a correct normalization step to eliminate redundancy.

Q5. A database designer has a table called “Employees” with columns “EmployeeID”, “EmployeeName”, and “EmployeeDependents”, where EmployeeDependents stores a comma-separated list of each employee’s dependents. Which change best normalizes this design?

Explanation: A comma-separated list in one column is a multi-valued attribute, violating first normal form. The correct fix is a separate Dependents table keyed by EmployeeID (a one-to-many relationship). Splitting into Dependent1/2/3 columns still repeats a attribute group and caps the count; indexing or duplicating rows do not remove the violation.

Q6. A database designer has a table called 'Orders' with columns 'OrderID', 'CustomerID', 'OrderDate', and 'ProductID'. The designer wants to normalize the table to avoid data redundancy. Which of the following is the correct step to take?

Explanation: To normalize the table, the designer should split the 'Orders' table into two tables: 'OrderInfo' and 'OrderDetails'. The 'OrderInfo' table would contain columns like 'OrderID', 'CustomerID', and 'OrderDate', while the 'OrderDetails' table would contain columns like 'OrderID' and 'ProductID'. This helps to avoid data redundancy and improves data integrity.

Q7. A company has a database with an "orders" table containing customer information, order details, and a foreign key referencing the "customers" table. However, the "orders" table also stores customer addresses. Which of the following is the best course of action to normalize the database?

Explanation: This option is the best course of action because it properly normalizes the data by removing repeating groups and eliminating data redundancy. It also allows for efficient querying and maintenance of customer addresses.

Q8. A database designer has a table named "Orders" with the following attributes: OrderID, CustomerID, OrderDate, ProductID, and Quantity. To normalize the table, which of the following options is a correct step?

Explanation: Normalizing removes redundancy and transitive dependencies: customer details should live once in a Customer table linked to Orders through CustomerID in a one-to-many relationship, so they don't repeat for every order (this serves 2NF/3NF, not 1NF - 1NF concerns atomic values). Splitting OrderDate into Date and Time is not required normalization, dropping ProductID loses essential data, and Orders-to-Product is one-to-many from the product side, not many-to-many.

Q9. In a database with a many-to-many relationship between customers and orders, which of the following normal forms addresses the issue of data redundancy in the customer table when storing order information?

Explanation: In a many-to-many relationship between customers and orders, Fourth Normal Form (4NF) is necessary to eliminate data redundancy in the customer table when storing order information. This is because each customer can have multiple orders, and each order can be associated with multiple customers, resulting in multi-level dependencies. By applying 4NF, the order information is stored in a separate table, eliminating the need for repeating groups in the customer table and addressing the issue of data redundancy.

Q10. In database normalization, a 'partial dependency' exists when:

Explanation: A partial dependency occurs when a non-key attribute is determined by only a portion of a composite key — for example, in a table keyed by (order_id, product_id), a product_name that depends only on product_id. Removing partial dependencies is exactly what second normal form (2NF) requires; transitive dependencies (non-key depending on non-key) are removed for 3NF.

That was just a sample. Sign up to unlock the full question bank with timed tests and certificates.

Sign Up Free
Database Normalization MCQ Practice Test | Mind Hustle