Which type of database constraint ensures that every foreign key value in a child table matches a
valid, existing primary key value in the parent table (or is entirely NULL)?
• A. Entity Integrity
• B. Referential Integrity
• C. Domain Integrity
• D. Atomicity Constraint
Correct Answer: B. Referential Integrity
Rationale: Referential integrity guarantees that relationships between tables remain consistent
by ensuring foreign key references point to actual primary key records in parent tables.
Question 2: Normalization
A relational table contains customer order details where non-key attributes depend on other non-
key attributes rather than directly on the primary key (transitive dependency). To achieve Third
Normal Form (3NF), what action must be taken?
• A. Remove all repeating attribute groups.
• B. Split the table to remove the transitive dependency into a separate table.
• C. Convert the primary key into a composite key.
• D. Eliminate all foreign key constraints.
Correct Answer: B. Split the table to remove the transitive dependency into a separate
table.
Rationale: 3NF requires a table to be in 2NF with no transitive dependencies. Non-key attributes
dependent on other non-key attributes must be moved to a new relation.
Question 3: SQL Data Retrieval
Which SQL clause is used in conjunction with aggregate functions (like SUM() or COUNT()) to
filter groups of summary rows based on a specified condition?
• A. WHERE
• B. HAVING
• C. ORDER BY
• D. LIMIT
Correct Answer: B. HAVING
Rationale: The WHERE clause filters individual rows before aggregation, whereas the HAVING
clause filters summarized groups after GROUP BY execution.
,Question 4: ER Modeling Cardinality
In a university database, a single student can enroll in multiple courses, and a single course can
have multiple students enrolled. What type of binary relationship is this, and how is it typically
implemented in a relational database?
• A. One-to-One; implemented using a shared primary key.
• B. One-to-Many; implemented by placing the course ID as a foreign key in the student
table.
• C. Many-to-Many; implemented using an associative (junction) table containing foreign
keys from both entities.
• D. Recursive; implemented using self-referencing triggers.
Correct Answer: C. Many-to-Many; implemented using an associative (junction) table
containing foreign keys from both entities.
Rationale: Many-to-many relationships cannot be modeled directly with a foreign key in
relational tables; they require an associative junction table to resolve the relationship.
Question 5: DDL vs. DML
Which SQL statement belongs to the Data Definition Language (DDL) category used to modify
database structure?
• A. SELECT * FROM Employees;
• B. INSERT INTO Customers VALUES ('John', 'Doe');
• C. ALTER TABLE Products ADD DiscountPrice DECIMAL(10,2);
• D. UPDATE Orders SET Status = 'Shipped';
Correct Answer: C. ALTER TABLE Products ADD DiscountPrice DECIMAL(10,2);
Rationale: ALTER TABLE is a DDL command used to change schema structure, whereas SELECT,
INSERT, and UPDATE are DML commands used for data manipulation.
Question 6
What is the primary drawback of traditional file systems compared to modern Database
Management Systems (DBMS)?
• A. Elimination of data redundancy
• B. Data redundancy and data inconsistency
• C. Complete program-data independence
• D. Centralized hardware security
Correct Answer: B. Data redundancy and data inconsistency
, Rationale: File systems store data in independent, isolated files, leading to duplicated
data across files (redundancy) and conflicting versions of the same data
(inconsistency).
Question 7
What type of data integrity constraint ensures that every primary key column contains a
unique value and cannot be left null?
• A. Referential Integrity
• B. Entity Integrity
• C. Domain Integrity
• D. Logical Integrity
Correct Answer: B. Entity Integrity
Rationale: Entity integrity requires that every table have a primary key, and the
column(s) chosen as the primary key must be unique and non-null (NOT NULL).
Question 8
Which term describes an attribute or combination of attributes that uniquely identifies a
specific row within a relation?
• A. Foreign Key
• B. Candidate Key
• C. Secondary Index
• D. Junction Attribute
Correct Answer: B. Candidate Key
Rationale: A candidate key is any column or minimal set of columns that can uniquely
identify a tuple. A primary key is simply one candidate key chosen by the designer.
Question 9
In a relational database, what is the intersection of a row and a column called?
• A. Relation
• B. Attribute
• C. Tuple / Cell
• D. Schema
Correct Answer: C. Tuple / Cell