ICT Database Management Concepts 2 — Questions and Answers
Question 1: Which SQL clause is used to filter records after a GROUP BY operation?
- WHERE
- HAVING (Correct answer)
- FILTER
- LIMIT
Correct answer: HAVING
HAVING filters grouped results, while WHERE filters rows before grouping occurs.
Question 2: What does ACID stand for in database transactions?
- Atomicity, Consistency, Isolation, Durability (Correct answer)
- Access, Control, Integrity, Data
- Automatic, Concurrent, Indexed, Distributed
- Atomic, Cached, Isolated, Durable
Correct answer: Atomicity, Consistency, Isolation, Durability
ACID properties ensure reliable database transactions: Atomicity, Consistency, Isolation, and Durability.
Question 3: Which type of join returns only rows where there is a match in both tables?
- LEFT JOIN
- RIGHT JOIN
- FULL OUTER JOIN
- INNER JOIN (Correct answer)
Correct answer: INNER JOIN
An INNER JOIN returns only the rows that have matching values in both joined tables.
Question 4: What is a foreign key in a relational database?
- A key that encrypts sensitive columns
- A column that uniquely identifies each row in its own table
- A column that references the primary key of another table (Correct answer)
- An index key used for faster lookups
Correct answer: A column that references the primary key of another table
A foreign key is a field in one table that refers to the primary key in another table, establishing a relationship.
Question 5: Which normal form eliminates transitive functional dependencies?
- First Normal Form (1NF)
- Second Normal Form (2NF)
- Third Normal Form (3NF) (Correct answer)
- Boyce-Codd Normal Form (BCNF)
Correct answer: Third Normal Form (3NF)
3NF removes transitive dependencies, ensuring non-key attributes depend only on the primary key.
Question 6: What is the purpose of an index in a database?
- To enforce referential integrity
- To speed up data retrieval operations (Correct answer)
- To prevent duplicate rows
- To compress stored data
Correct answer: To speed up data retrieval operations
An index creates a data structure that allows the database engine to find rows faster without scanning the entire table.
Question 7: Which SQL command removes all rows from a table but keeps its structure?
- DELETE
- DROP
- TRUNCATE (Correct answer)
- REMOVE
Correct answer: TRUNCATE
TRUNCATE removes all rows from a table quickly without logging individual row deletions, but preserves the table structure.
Which SQL clause is used to filter records after a GROUP BY operation?