1. Which of the following is used to establish a relationship between two tables?
A. Foreign key
B. Primary key
C. Index
D. Trigger
Answer: A) Foreign key
Rationale: A foreign key is used to establish and enforce a link between the data in two tables.
2. Which of the following is a characteristic of a transaction?
A. It is a sequence of one or more operations that must be executed as a unit
B. It can be performed on multiple databases
C. It can be only a SELECT operation
D. It is automatically rolled back after execution
Answer: A) It is a sequence of one or more operations that must be executed as a unit
Rationale: A transaction ensures that a series of database operations are executed as a single unit,
either fully completed or fully rolled back.
3. What is the difference between INNER JOIN and LEFT JOIN?
A. INNER JOIN returns only matching rows, LEFT JOIN returns all rows from the left table
,B. INNER JOIN returns all rows from both tables, LEFT JOIN returns only matching rows
C. INNER JOIN returns only unmatched rows
D. There is no difference
Answer: A) INNER JOIN returns only matching rows, LEFT JOIN returns all rows from the left
table
Rationale: An INNER JOIN returns rows with matching values in both tables, while a LEFT
JOIN returns all rows from the left table and matching rows from the right table.
4. Which of the following ensures that no two rows in a table have the same value in a specified
column?
A. Foreign key
B. Unique key
C. Primary key
D. Composite key
Answer: B) Unique key
Rationale: A unique key ensures that no two rows have the same value in the specified column.
5. 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.
6. 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.
7. What does ACID stand for in database systems?
A. Atomicity, Consistency, Isolation, Durability
B. Accuracy, Consistency, Integrity, Durability
C. Analysis, Consistency, Isolation, Durability
D. Atomicity, Consistency, Integrity, Durability
Answer: A) Atomicity, Consistency, Isolation, Durability
Rationale: ACID is a set of properties that guarantee database transactions are processed reliably.
A. Foreign key
B. Primary key
C. Index
D. Trigger
Answer: A) Foreign key
Rationale: A foreign key is used to establish and enforce a link between the data in two tables.
2. Which of the following is a characteristic of a transaction?
A. It is a sequence of one or more operations that must be executed as a unit
B. It can be performed on multiple databases
C. It can be only a SELECT operation
D. It is automatically rolled back after execution
Answer: A) It is a sequence of one or more operations that must be executed as a unit
Rationale: A transaction ensures that a series of database operations are executed as a single unit,
either fully completed or fully rolled back.
3. What is the difference between INNER JOIN and LEFT JOIN?
A. INNER JOIN returns only matching rows, LEFT JOIN returns all rows from the left table
,B. INNER JOIN returns all rows from both tables, LEFT JOIN returns only matching rows
C. INNER JOIN returns only unmatched rows
D. There is no difference
Answer: A) INNER JOIN returns only matching rows, LEFT JOIN returns all rows from the left
table
Rationale: An INNER JOIN returns rows with matching values in both tables, while a LEFT
JOIN returns all rows from the left table and matching rows from the right table.
4. Which of the following ensures that no two rows in a table have the same value in a specified
column?
A. Foreign key
B. Unique key
C. Primary key
D. Composite key
Answer: B) Unique key
Rationale: A unique key ensures that no two rows have the same value in the specified column.
5. 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.
6. 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.
7. What does ACID stand for in database systems?
A. Atomicity, Consistency, Isolation, Durability
B. Accuracy, Consistency, Integrity, Durability
C. Analysis, Consistency, Isolation, Durability
D. Atomicity, Consistency, Integrity, Durability
Answer: A) Atomicity, Consistency, Isolation, Durability
Rationale: ACID is a set of properties that guarantee database transactions are processed reliably.