1. In SQL, which of the following is used to retrieve unique values from a column?
A. SELECT ALL
B. DISTINCT
C. UNIQUE
D. LIMIT
Answer: B) DISTINCT
Rationale: The DISTINCT keyword is used to retrieve unique values from a column.
2. What does a JOIN operation in SQL do?
A. Combines rows from two or more tables based on a related column
B. Deletes records from multiple tables
C. Updates data in multiple tables
D. Sorts data in tables
Answer: A) Combines rows from two or more tables based on a related column
Rationale: The JOIN operation is used to combine rows from two or more tables based on a
related column.
3. Which normalization form involves removing transitive dependencies?
A. 1NF
,B. 2NF
C. 3NF
D. BCNF
Answer: C) 3NF
Rationale: The third normal form (3NF) removes transitive dependencies, where non-key
attributes depend on other non-key attributes.
4. What is the primary purpose of a Database Management System (DBMS)?
A. To store data in a file system
B. To retrieve data from the database
C. To provide an interface between the user and the data
D. To ensure data security
Answer: C) To provide an interface between the user and the data
Rationale: A DBMS provides an interface between users and the database to manage, store, and
retrieve data efficiently.
5. Which of the following is a data integrity constraint in a database?
A. Foreign key
B. Composite key
C. Index
D. SQL query
, Answer: A) Foreign key
Rationale: A foreign key ensures referential integrity between tables.
6. What is referential integrity?
A. Ensuring data consistency between tables
B. Enforcing primary key uniqueness
C. Preventing duplication of records
D. Normalizing data to reduce redundancy
Answer: A) Ensuring data consistency between tables
Rationale: Referential integrity ensures that foreign keys correctly reference primary keys in
related tables.
7. In SQL, which command is used to remove a table from a database?
A. DELETE
B. DROP
C. REMOVE
D. TRUNCATE
Answer: B) DROP
Rationale: The DROP command is used to delete a table and its structure from a database.
8. What is the purpose of a database schema?
A. SELECT ALL
B. DISTINCT
C. UNIQUE
D. LIMIT
Answer: B) DISTINCT
Rationale: The DISTINCT keyword is used to retrieve unique values from a column.
2. What does a JOIN operation in SQL do?
A. Combines rows from two or more tables based on a related column
B. Deletes records from multiple tables
C. Updates data in multiple tables
D. Sorts data in tables
Answer: A) Combines rows from two or more tables based on a related column
Rationale: The JOIN operation is used to combine rows from two or more tables based on a
related column.
3. Which normalization form involves removing transitive dependencies?
A. 1NF
,B. 2NF
C. 3NF
D. BCNF
Answer: C) 3NF
Rationale: The third normal form (3NF) removes transitive dependencies, where non-key
attributes depend on other non-key attributes.
4. What is the primary purpose of a Database Management System (DBMS)?
A. To store data in a file system
B. To retrieve data from the database
C. To provide an interface between the user and the data
D. To ensure data security
Answer: C) To provide an interface between the user and the data
Rationale: A DBMS provides an interface between users and the database to manage, store, and
retrieve data efficiently.
5. Which of the following is a data integrity constraint in a database?
A. Foreign key
B. Composite key
C. Index
D. SQL query
, Answer: A) Foreign key
Rationale: A foreign key ensures referential integrity between tables.
6. What is referential integrity?
A. Ensuring data consistency between tables
B. Enforcing primary key uniqueness
C. Preventing duplication of records
D. Normalizing data to reduce redundancy
Answer: A) Ensuring data consistency between tables
Rationale: Referential integrity ensures that foreign keys correctly reference primary keys in
related tables.
7. In SQL, which command is used to remove a table from a database?
A. DELETE
B. DROP
C. REMOVE
D. TRUNCATE
Answer: B) DROP
Rationale: The DROP command is used to delete a table and its structure from a database.
8. What is the purpose of a database schema?