WGU C227 Database Management Week 8 Formatted: Font: Arial Narrow, 26 pt, Font color: Red
Formatted: Centered
Final Exam Case Studies & Rationales Formatted: Top: (Custom, Auto, 30 pt Line width),
Bottom: (Custom, Auto, 30 pt Line width), Left:
(Custom, Auto, 30 pt Line width), Right: (Custom, Auto,
Practice Exam – Version 1 (Questions 1–75)
30 pt Line width)
Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
1. A database designer is creating a table to store customer orders. Which key should be used to
uniquely identify each order?
A. Foreign key
B. Primary key
C. Composite key
D. Candidate key
Correct Answer: B
Rationale: A primary key uniquely identifies each record in a table. A foreign key links to Formatted: Font: Arial Narrow, 14 pt
another table. A composite key consists of two or more columns. A candidate key is any
column that could serve as a primary key. Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
2. In a relational database, what is the primary purpose of a foreign key?
A. To uniquely identify each record
B. To enforce referential integrity between tables
C. To sort records
D. To encrypt data
Correct Answer: B
Rationale: A foreign key enforces referential integrity by ensuring that a value in one table Formatted: Font: Arial Narrow, 14 pt
matches a primary key value in another table. It does not uniquely identify records, sort, or
encrypt. Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
3. Which normal form eliminates partial dependencies?
A. First Normal Form (1NF)
B. Second Normal Form (2NF)
C. Third Normal Form (3NF)
D. Boyce-Codd Normal Form (BCNF)
Correct Answer: B
,Rationale: 2NF eliminates partial dependencies (a non-key attribute dependent on part of a Formatted: Font: Arial Narrow, 14 pt
composite primary key). 1NF eliminates repeating groups. 3NF eliminates transitive
dependencies. BCNF is a stronger version of 3NF. Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
4. A table is in 1NF but has a transitive dependency. Which normal form should it be converted to?
A. 2NF
B. 3NF
C. BCNF
D. 4NF
Correct Answer: B
Rationale: 3NF eliminates transitive dependencies (non-key attributes dependent on other Formatted: Font: Arial Narrow, 14 pt
non-key attributes). 2NF eliminates partial dependencies. BCNF is a stronger version of
3NF. 4NF deals with multivalued dependencies. Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
5. Which SQL command is used to retrieve data from a database?
A. INSERT
B. UPDATE
C. SELECT
D. DELETE
Correct Answer: C
Rationale: SELECT retrieves data. INSERT adds data. UPDATE modifies data. DELETE Formatted: Font: Arial Narrow, 14 pt
removes data. Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
6. Which SQL clause is used to filter rows? Formatted: Font: Arial Narrow, 12 pt
A. GROUP BY
B. ORDER BY
C. WHERE
D. HAVING
Correct Answer: C
Rationale: WHERE filters rows before grouping. GROUP BY groups rows. ORDER BY sorts Formatted: Font: Arial Narrow, 14 pt
rows. HAVING filters groups after grouping. Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
, 7. Which SQL clause is used to filter groups?
A. WHERE
B. HAVING
C. GROUP BY
D. ORDER BY
Correct Answer: B
Rationale: HAVING filters groups after GROUP BY. WHERE filters rows before grouping. Formatted: Font: Arial Narrow, 14 pt
GROUP BY groups rows. ORDER BY sorts rows. Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
8. What is the result of an INNER JOIN?
A. All rows from both tables
B. Only rows with matching values in both tables
C. All rows from the left table
D. All rows from the right table
Correct Answer: B
Rationale: INNER JOIN returns only rows with matching values in both tables. LEFT JOIN Formatted: Font: Arial Narrow, 14 pt
returns all rows from the left table. RIGHT JOIN returns all rows from the right table. FULL
JOIN returns all rows from both tables. Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
9. What is the result of a LEFT JOIN?
A. Only rows with matching values
B. All rows from the left table, with matching rows from the right
C. All rows from the right table
D. All rows from both tables
Correct Answer: B
Rationale: LEFT JOIN returns all rows from the left table and matching rows from the right Formatted: Font: Arial Narrow, 14 pt
table. Non-matching rows from the right table return NULL. Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
10. Which SQL function returns the number of rows in a table?
A. SUM()
B. AVG()
C. COUNT()
D. MAX()
Formatted: Centered
Final Exam Case Studies & Rationales Formatted: Top: (Custom, Auto, 30 pt Line width),
Bottom: (Custom, Auto, 30 pt Line width), Left:
(Custom, Auto, 30 pt Line width), Right: (Custom, Auto,
Practice Exam – Version 1 (Questions 1–75)
30 pt Line width)
Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
1. A database designer is creating a table to store customer orders. Which key should be used to
uniquely identify each order?
A. Foreign key
B. Primary key
C. Composite key
D. Candidate key
Correct Answer: B
Rationale: A primary key uniquely identifies each record in a table. A foreign key links to Formatted: Font: Arial Narrow, 14 pt
another table. A composite key consists of two or more columns. A candidate key is any
column that could serve as a primary key. Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
2. In a relational database, what is the primary purpose of a foreign key?
A. To uniquely identify each record
B. To enforce referential integrity between tables
C. To sort records
D. To encrypt data
Correct Answer: B
Rationale: A foreign key enforces referential integrity by ensuring that a value in one table Formatted: Font: Arial Narrow, 14 pt
matches a primary key value in another table. It does not uniquely identify records, sort, or
encrypt. Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
3. Which normal form eliminates partial dependencies?
A. First Normal Form (1NF)
B. Second Normal Form (2NF)
C. Third Normal Form (3NF)
D. Boyce-Codd Normal Form (BCNF)
Correct Answer: B
,Rationale: 2NF eliminates partial dependencies (a non-key attribute dependent on part of a Formatted: Font: Arial Narrow, 14 pt
composite primary key). 1NF eliminates repeating groups. 3NF eliminates transitive
dependencies. BCNF is a stronger version of 3NF. Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
4. A table is in 1NF but has a transitive dependency. Which normal form should it be converted to?
A. 2NF
B. 3NF
C. BCNF
D. 4NF
Correct Answer: B
Rationale: 3NF eliminates transitive dependencies (non-key attributes dependent on other Formatted: Font: Arial Narrow, 14 pt
non-key attributes). 2NF eliminates partial dependencies. BCNF is a stronger version of
3NF. 4NF deals with multivalued dependencies. Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
5. Which SQL command is used to retrieve data from a database?
A. INSERT
B. UPDATE
C. SELECT
D. DELETE
Correct Answer: C
Rationale: SELECT retrieves data. INSERT adds data. UPDATE modifies data. DELETE Formatted: Font: Arial Narrow, 14 pt
removes data. Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
6. Which SQL clause is used to filter rows? Formatted: Font: Arial Narrow, 12 pt
A. GROUP BY
B. ORDER BY
C. WHERE
D. HAVING
Correct Answer: C
Rationale: WHERE filters rows before grouping. GROUP BY groups rows. ORDER BY sorts Formatted: Font: Arial Narrow, 14 pt
rows. HAVING filters groups after grouping. Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
, 7. Which SQL clause is used to filter groups?
A. WHERE
B. HAVING
C. GROUP BY
D. ORDER BY
Correct Answer: B
Rationale: HAVING filters groups after GROUP BY. WHERE filters rows before grouping. Formatted: Font: Arial Narrow, 14 pt
GROUP BY groups rows. ORDER BY sorts rows. Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
8. What is the result of an INNER JOIN?
A. All rows from both tables
B. Only rows with matching values in both tables
C. All rows from the left table
D. All rows from the right table
Correct Answer: B
Rationale: INNER JOIN returns only rows with matching values in both tables. LEFT JOIN Formatted: Font: Arial Narrow, 14 pt
returns all rows from the left table. RIGHT JOIN returns all rows from the right table. FULL
JOIN returns all rows from both tables. Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
9. What is the result of a LEFT JOIN?
A. Only rows with matching values
B. All rows from the left table, with matching rows from the right
C. All rows from the right table
D. All rows from both tables
Correct Answer: B
Rationale: LEFT JOIN returns all rows from the left table and matching rows from the right Formatted: Font: Arial Narrow, 14 pt
table. Non-matching rows from the right table return NULL. Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
Formatted: Font: Arial Narrow, 12 pt
10. Which SQL function returns the number of rows in a table?
A. SUM()
B. AVG()
C. COUNT()
D. MAX()