SQL Database Structured Design Quiz

SQL Database
0 Passed
0% acceptance

A 40-question quiz exploring normalization forms, schema modeling, functional dependencies, redundancy reduction, and relational structuring.

40 Questions
~80 minutes
1

Question 1

A customer table stores multiple phone numbers in a single field separated by commas. When an employee tries to search for a specific number, the results become inconsistent. Which normalization guideline addresses this issue?

A
First Normal Form (1NF) removes multi-valued fields
B
Third Normal Form (3NF)
C
Boyce-Codd Normal Form only
D
Key-only normalization
2

Question 2

An employee table stores both department name and department location, even though multiple employees belong to the same department. This causes repeated location values. Which normalization concept helps avoid such duplication?

A
Separating data into related tables to reduce redundancy
B
Merging all attributes into one table
C
Removing primary keys
D
Using only numeric fields
3

Question 3

A schema stores product details and supplier details in the same table. When a supplier updates their phone number, many rows must be changed. What undesirable effect does this illustrate?

A
Update anomaly
B
Join anomaly
C
Constraint mismatch
D
Atomicity failure
4

Question 4

A table violates 1NF because rows contain varying numbers of values in a single field. What structural fix typically resolves this?

A
Move repeating values into a separate related table
B
Add more primary keys
C
Use only text fields
D
Duplicate the entire row per value
5

Question 5

A bookstore wants to prevent storing an author's biography repeatedly with each book. Which structural approach supports better schema design?

A
Separate authors into their own table
B
Store all books and authors in one table
C
Use multiple biography columns
D
Leave biographies NULL
6

Question 6

A table shows that an attribute depends not on the full key but only part of it, leading to partial dependency. Which normal form resolves this issue?

A
Second Normal Form (2NF)
B
First Normal Form (1NF)
C
Fourth Normal Form
D
Basic atomicity form
7

Question 7

A company stores city and state information in an orders table, even though these values depend on the customer's address, not the order itself. This illustrates what dependency issue?

A
Transitive dependency
B
Circular dependency
C
Key duplication
D
Atomic mismatch
8

Question 8

A design team notices that deleting the last order of a customer also removes stored address information, making it impossible to retain the customer record. Which anomaly is this?

A
Deletion anomaly
B
Join anomaly
C
Atomic violation
D
Integrity anomaly
9

Question 9

A team wants to prevent storing derived attributes like 'order_count' that could be computed from related tables. Which design principle does this follow?

A
Avoid storing calculated values to reduce inconsistencies
B
Store all computed data for faster reads
C
Duplicate all numeric summaries
D
Use text-only storage
10

Question 10

A store places customer loyalty level inside the orders table, even though it depends solely on the customer. Which normalization rule suggests removing it?

A
Third Normal Form (3NF) removes non-key dependencies
B
1NF only
C
Sixth Normal Form
D
Cross normalization
11

Question 11

A course enrollment table includes instructor name, though instructors belong to a separate instructors entity. Why is this problematic?

A
Instructor name may change, causing repeated updates
B
Instructor name must be unique
C
Instructor names must be stored as lists
D
Instructors cannot appear twice
12

Question 12

A team designing a schema wants each table to represent a single subject or entity. Which principle are they following?

A
Single entity per table principle
B
Flat-file schema design
C
Derivation-first modeling
D
Key merging principle
13

Question 13

A design team identifies attributes that depend entirely on the primary key and not on other attributes. What does this indicate?

A
Compliance with 2NF
B
Only 1NF compliance
C
Violation of 3NF
D
Circular schema
14

Question 14

A student table includes advisor office number, which belongs to the advisors entity. What design improvement applies here?

A
Move advisor office data to an advisor table and reference it
B
Duplicate office number everywhere
C
Merge all fields into one
D
Store office numbers in CSV format
15

Question 15

A system includes supplier email in a product table. Each time a supplier changes contact details, product rows must be updated. This is a sign the database lacks what?

A
Proper normalization
B
Correct data format
C
Enough indexes
D
Auto-generated keys
16

Question 16

A table contains both customer details and order details. The design team wants to split it into two tables to avoid mixed responsibilities. This aligns with what rule?

A
Each table should represent one logical entity
B
Always minimize the number of tables
C
Store all details in JSON text
D
Use only composite keys
17

Question 17

A designer finds that a column's value can be derived entirely from another table. Storing it may produce inconsistencies. What should they do?

A
Remove the derived attribute to prevent duplication
B
Keep derived values everywhere
C
Turn all columns into derived values
D
Ignore inconsistencies
18

Question 18

A large warehouse table mixes product details with zone locations. These two concepts change at different rates and introduce redundancy. Which design issue appears?

A
Poor entity separation
B
Over-normalization
C
Surplus foreign keys
D
Single table dependency
19

Question 19

A designer wants to ensure that every attribute describes the entity represented by the table, not external entities. Which guideline applies?

A
Attribute relevance rule
B
Composite-first design
C
Join elimination rule
D
No-redundancy join
20

Question 20

A schema includes multiple repeating address columns such as address1, address2, address3. Which normalization principle suggests using a child table instead?

A
Handle repeating groups by decomposing into related tables
B
Merge all three into one giant text field
C
Make address fields NULL
D
Use only composite keys
21

Question 21

A team designing an academic system wants to avoid storing student major names repeatedly in every course enrollment row. What structural improvement helps?

A
Move major name to a majors table and reference it
B
Store major names in a long text list
C
Add many redundant major columns
D
Merge students and majors
22

Question 22

A company realizes that employees often move between departments. Instead of storing department name directly in the employee table, they want a more flexible approach. Which structure is ideal?

A
Use a foreign key referencing a department table
B
Store department names redundantly
C
Flatten all data into one table
D
Remove departments entirely
23

Question 23

A composite key relation includes an attribute that depends only on one part of the composite key. Which rule suggests refactoring the design?

A
2NF resolves partial dependencies
B
1NF atomicity rule
C
4NF multivalued rule
D
Domain-only rule
24

Question 24

A design team wants to avoid mixing transactional data (like orders) with descriptive master data (like product details). Which principle does this support?

A
Separation of concerns in schema design
B
Store all data in one fact table
C
Duplicate product details everywhere
D
Remove master tables
25

Question 25

This structure places repeating phone numbers in the same row. What normalization rule is being broken?

sql
CREATE TABLE contacts (
  id SERIAL PRIMARY KEY,
  phone_numbers TEXT
);
A
1NF atomicity rule
B
3NF transitive rule
C
4NF multivalued rule only
D
None, this is correct design
26

Question 26

This table mixes supplier details into the product table. What design issue emerges?

sql
CREATE TABLE products (
  id SERIAL PRIMARY KEY,
  name TEXT,
  supplier_name TEXT,
  supplier_phone TEXT
);
A
Redundancy and update anomalies
B
Atomicity violation only
C
No issues—it is optimal
D
Composite key violation
27

Question 27

This structure tries to store multiple roles as CSV text. Which normal form is being violated?

sql
CREATE TABLE users (
  id SERIAL PRIMARY KEY,
  roles TEXT
);
A
1NF: fields must hold atomic values
B
2NF: eliminating partial dependencies
C
3NF: removing transitive dependencies
D
5NF: link dependency
28

Question 28

Here a single table mixes products and categories. What structure should replace it?

sql
CREATE TABLE items (
  id SERIAL PRIMARY KEY,
  product_name TEXT,
  category_name TEXT
);
A
Separate product and category tables with FK link
B
Keep everything together
C
Flatten all data into text
D
Make category_name unique
29

Question 29

What normalization problem does this design represent?

sql
CREATE TABLE orders (
  id SERIAL PRIMARY KEY,
  customer_name TEXT,
  customer_city TEXT
);
A
Transitive dependency via customer attributes
B
Atomicity violation
C
2NF partial dependency
D
No normalization issues
30

Question 30

This definition uses a composite key. One column depends only on part of it. Which normal form is violated?

sql
CREATE TABLE enrollment (
  student_id INT,
  course_id INT,
  student_major TEXT,
  PRIMARY KEY (student_id, course_id)
);
A
2NF violation (partial dependency)
B
1NF violation
C
4NF violation
D
BCNF violation only
31

Question 31

This structure duplicates project details for every task. What issue appears?

sql
CREATE TABLE tasks (
  id SERIAL PRIMARY KEY,
  project_name TEXT,
  project_client TEXT
);
A
Redundant repeating project attributes
B
1NF atomicity issue
C
Over-normalization
D
Incorrect key type
32

Question 32

This refactor extracts project data. What benefit does it provide?

sql
CREATE TABLE projects (
  id SERIAL PRIMARY KEY,
  name TEXT,
  client TEXT
);

CREATE TABLE tasks (
  id SERIAL PRIMARY KEY,
  project_id INT REFERENCES projects(id)
);
A
Removes redundant project information from tasks
B
Makes tasks atomic only
C
Prevents inserting tasks
D
Duplicates projects
33

Question 33

This table stores derived values like total_price. What design issue might occur?

sql
CREATE TABLE orders (
  id SERIAL PRIMARY KEY,
  quantity INT,
  unit_price DECIMAL,
  total_price DECIMAL
);
A
Derived values increase risk of inconsistencies
B
Atomicity violation
C
Foreign key mismatch
D
Check constraint failure
34

Question 34

This design uses a link table to structure many-to-many relations. What normalization benefit does this provide?

sql
CREATE TABLE student_courses (
  student_id INT,
  course_id INT,
  PRIMARY KEY (student_id, course_id)
);
A
Avoids redundant repeating matches
B
Creates atomic fields
C
Removes all keys
D
Adds unnecessary columns
35

Question 35

This example decomposes a single table into two. What purpose does decomposition serve?

sql
CREATE TABLE books (
  id SERIAL PRIMARY KEY,
  title TEXT
);

CREATE TABLE book_details (
  book_id INT REFERENCES books(id),
  isbn TEXT,
  publisher TEXT
);
A
Separates distinct attributes into meaningful entities
B
Creates redundant structures
C
Breaks atomicity
D
Forces duplication
36

Question 36

This design uses foreign keys to connect orders with customers. Which normalization rule does this support?

sql
CREATE TABLE customers (
  id SERIAL PRIMARY KEY,
  name TEXT
);

CREATE TABLE orders (
  id SERIAL PRIMARY KEY,
  customer_id INT REFERENCES customers(id)
);
A
Prevents repeating customer details per order
B
Ensures atomic names
C
Creates redundant foreign keys
D
Forces multi-valued fields
37

Question 37

This structure stores address details in a separate table. What benefit does normalization provide here?

sql
CREATE TABLE addresses (
  id SERIAL PRIMARY KEY,
  street TEXT,
  city TEXT,
  country TEXT
);

CREATE TABLE users (
  id SERIAL PRIMARY KEY,
  address_id INT REFERENCES addresses(id)
);
A
Prevents repeating city and country across users
B
Forces extra duplication
C
Requires atomicity only
D
Creates transitive dependency
38

Question 38

This incorrect design stores both product and supplier information redundantly. What is the recommended alternative?

sql
CREATE TABLE inventory (
  id SERIAL PRIMARY KEY,
  product_name TEXT,
  supplier_phone TEXT
);
A
Create supplier and product tables and reference them
B
Store all details in one wide table
C
Add more supplier columns
D
Stop storing supplier details
39

Question 39

This design checks whether normalization is applied correctly. What does this table violate?

sql
CREATE TABLE staff (
  id SERIAL PRIMARY KEY,
  role TEXT,
  role_description TEXT
);
A
3NF since description depends on role, not id
B
1NF only
C
BCNF fully
D
None—this is 3NF compliant
40

Question 40

This restructuring removes derived fields from orders. What normalization improvement does this represent?

sql
CREATE TABLE orders (
  id SERIAL PRIMARY KEY,
  quantity INT,
  price DECIMAL
);
-- total_price removed
A
Avoiding derived attributes reduces inconsistency
B
Atomicity violation
C
Key mismatch
D
Transitive dependency

QUIZZES IN SQL Database