1. Which of the following is a constraint in a database?
A. Primary key
B. Data type
C. Foreign key
D. All of the above
Answer: D
Rationale: Primary keys, foreign keys, and data types are all types of constraints
that enforce data integrity rules within a database.
2. Which of the following is an example of a composite key?
A. A single column that uniquely identifies a record.
B. A combination of two or more columns that uniquely identify a record.
C. A key that contains duplicate values.
D. A key that relates to another table.
Answer: B
,Rationale: A composite key is made up of two or more columns in a table that
together uniquely identify a record.
3. The many-to-many relationship is typically resolved using:
A. A junction (or associative) table.
B. A foreign key constraint.
C. A unique constraint.
D. A subquery.
Answer: A
Rationale: A many-to-many relationship is resolved by introducing a junction table
that holds foreign keys referencing the two entities involved in the relationship.
4. Which of the following is not a characteristic of NoSQL databases?
A. Schema-less design
B. Horizontal scalability
C. Strong consistency
D. Non-relational data model
Answer: C
, Rationale: NoSQL databases are often designed for horizontal scalability and
flexibility with a schema-less structure. They may favor eventual consistency over
strict consistency.
5. Which of the following ensures that data integrity is maintained when modifying
data?
A. Referential integrity
B. Data independence
C. Data redundancy
D. Normalization
Answer: A
Rationale: Referential integrity ensures that relationships between tables are
maintained consistently, preventing orphaned records and ensuring that foreign key
constraints are respected.
6. Which of the following is not a typical use case for NoSQL databases?
A. High-volume, high-velocity data storage.
B. Storing unstructured or semi-structured data.
C. Complex transactions with ACID properties.
A. Primary key
B. Data type
C. Foreign key
D. All of the above
Answer: D
Rationale: Primary keys, foreign keys, and data types are all types of constraints
that enforce data integrity rules within a database.
2. Which of the following is an example of a composite key?
A. A single column that uniquely identifies a record.
B. A combination of two or more columns that uniquely identify a record.
C. A key that contains duplicate values.
D. A key that relates to another table.
Answer: B
,Rationale: A composite key is made up of two or more columns in a table that
together uniquely identify a record.
3. The many-to-many relationship is typically resolved using:
A. A junction (or associative) table.
B. A foreign key constraint.
C. A unique constraint.
D. A subquery.
Answer: A
Rationale: A many-to-many relationship is resolved by introducing a junction table
that holds foreign keys referencing the two entities involved in the relationship.
4. Which of the following is not a characteristic of NoSQL databases?
A. Schema-less design
B. Horizontal scalability
C. Strong consistency
D. Non-relational data model
Answer: C
, Rationale: NoSQL databases are often designed for horizontal scalability and
flexibility with a schema-less structure. They may favor eventual consistency over
strict consistency.
5. Which of the following ensures that data integrity is maintained when modifying
data?
A. Referential integrity
B. Data independence
C. Data redundancy
D. Normalization
Answer: A
Rationale: Referential integrity ensures that relationships between tables are
maintained consistently, preventing orphaned records and ensuring that foreign key
constraints are respected.
6. Which of the following is not a typical use case for NoSQL databases?
A. High-volume, high-velocity data storage.
B. Storing unstructured or semi-structured data.
C. Complex transactions with ACID properties.