University/College Practice Examination — SQL Syntax, SELECT
Queries, Filtering, Joins, Aggregation, Subqueries, Transactions,
Database Design & Query Optimization — 190 Multiple-Choice
Questions with Answers & Detailed Rationales
SECTION 1: Relational Model & Database Fundamentals (Questions 1–20)
Question 1
Which term describes a column (or set of columns) that uniquely identifies each row in a
table?
A. Foreign key
B. Primary key
C. Candidate index
D. Alternate attribute
Correct Answer: B
Explanation: A primary key enforces uniqueness and non-nullability for row identification.
Foreign keys reference other tables; candidate keys are eligible but not chosen.
Question 2
A table has no declared primary key. What is the most accurate description of its state?
A. It cannot store data
B. It may contain duplicate rows
C. It automatically becomes a view
D. It loses all column constraints
,Correct Answer: B
Explanation: Without a uniqueness constraint, identical rows can exist. Tables remain fully
functional; only guaranteed row identity is absent.
Question 3
In relational theory, what does the term "degree" of a relation refer to?
A. The number of rows
B. The number of columns
C. The number of indexes
D. The number of foreign keys
Correct Answer: B
Explanation: Degree counts attributes (columns); cardinality counts tuples (rows). This
distinction is fundamental in relational algebra terminology.
Question 4
Which property is guaranteed by a foreign key constraint?
A. Every value is unique
B. Referenced values exist in the parent table
C. All columns are indexed
D. Rows are automatically sorted
Correct Answer: B
,Explanation: Referential integrity ensures child values match parent key values or are null.
Uniqueness belongs to primary/unique constraints, not foreign keys.
Question 5
A table stores orders with columns (order_id, customer_id, order_date). Which column is
most likely the foreign key?
A. order_id
B. customer_id
C. order_date
D. None of them
Correct Answer: B
Explanation: customer_id references the customers table, establishing a relationship.
order_id is typically the primary key of the orders table.
Question 6
What is the primary purpose of normalization in database design?
A. Increase storage redundancy
B. Reduce data redundancy and anomalies
C. Eliminate all joins
D. Convert tables into views
Correct Answer: B
Explanation: Normalization organizes data to minimize duplication and update anomalies. It
does not eliminate joins; well-designed schemas still require them.
, Question 7
Which normal form eliminates partial dependency on a composite primary key?
A. First normal form
B. Second normal form
C. Third normal form
D. Boyce-Codd normal form
Correct Answer: B
Explanation: 2NF removes partial dependencies on part of a composite key. 1NF addresses
atomicity; 3NF removes transitive dependencies.
Question 8
A relation is in 1NF when:
A. It has no composite keys
B. All attributes contain atomic values
C. All non-key attributes depend on the key
D. It has no foreign keys
Correct Answer: B
Explanation: First normal form requires atomic (indivisible) values in every cell. Repeating
groups and multi-valued attributes violate 1NF.
Question 9