1. Which SQL clause is used to filter records based on specific conditions?
A. ORDER BY
B. SELECT
C. WHERE
D. JOIN
Answer: C) WHERE
Rationale: The WHERE clause is used to filter records that meet a certain
condition.
2. Which SQL statement is used to remove data from a table?
A. DELETE
B. REMOVE
C. DROP
D. TRUNCATE
Answer: A) DELETE
,Rationale: The DELETE statement is used to remove records from a table based on
a condition. TRUNCATE removes all rows from a table, while DROP removes the
entire table.
3. What does "referential integrity" ensure in a relational database?
A. Data redundancy is minimized
B. Relationships between tables are consistent
C. Data is always up-to-date
D. Data is stored in a single location
Answer: B) Relationships between tables are consistent
Rationale: Referential integrity ensures that foreign keys correctly link to primary
keys, maintaining the consistency of relationships between tables.
4. Which of the following is an example of a data manipulation language (DML)
command?
A. SELECT
B. CREATE
C. DROP
, D. ALTER
Answer: A) SELECT
Rationale: DML commands are used to manipulate the data in the database.
SELECT is a DML command used to query and retrieve data.
5. Which of the following describes a "many-to-many" relationship in a database?
A. A record in one table is linked to one record in another table
B. A record in one table can be linked to multiple records in another table
C. Multiple records in one table can be linked to multiple records in another table
D. Records in two tables cannot be linked
Answer: C) Multiple records in one table can be linked to multiple records in
another table
Rationale: A "many-to-many" relationship occurs when multiple records in one
table are related to multiple records in another table.
6. Which of the following is true about a primary key in a relational database?
A. A primary key can contain duplicate values
B. A primary key uniquely identifies each record in a table
A. ORDER BY
B. SELECT
C. WHERE
D. JOIN
Answer: C) WHERE
Rationale: The WHERE clause is used to filter records that meet a certain
condition.
2. Which SQL statement is used to remove data from a table?
A. DELETE
B. REMOVE
C. DROP
D. TRUNCATE
Answer: A) DELETE
,Rationale: The DELETE statement is used to remove records from a table based on
a condition. TRUNCATE removes all rows from a table, while DROP removes the
entire table.
3. What does "referential integrity" ensure in a relational database?
A. Data redundancy is minimized
B. Relationships between tables are consistent
C. Data is always up-to-date
D. Data is stored in a single location
Answer: B) Relationships between tables are consistent
Rationale: Referential integrity ensures that foreign keys correctly link to primary
keys, maintaining the consistency of relationships between tables.
4. Which of the following is an example of a data manipulation language (DML)
command?
A. SELECT
B. CREATE
C. DROP
, D. ALTER
Answer: A) SELECT
Rationale: DML commands are used to manipulate the data in the database.
SELECT is a DML command used to query and retrieve data.
5. Which of the following describes a "many-to-many" relationship in a database?
A. A record in one table is linked to one record in another table
B. A record in one table can be linked to multiple records in another table
C. Multiple records in one table can be linked to multiple records in another table
D. Records in two tables cannot be linked
Answer: C) Multiple records in one table can be linked to multiple records in
another table
Rationale: A "many-to-many" relationship occurs when multiple records in one
table are related to multiple records in another table.
6. Which of the following is true about a primary key in a relational database?
A. A primary key can contain duplicate values
B. A primary key uniquely identifies each record in a table