ICT Database Management Concepts 3 — Questions and Answers
Question 1: What is a deadlock in database management?
- A query that returns no results
- A situation where two transactions wait indefinitely for each other's locked resources (Correct answer)
- A database backup failure
- A corrupted index structure
Correct answer: A situation where two transactions wait indefinitely for each other's locked resources
A deadlock occurs when two or more transactions each hold locks the others need, causing all to wait forever.
Question 2: Which database model stores data as collections of key-value pairs, documents, or graphs?
- Relational database
- Hierarchical database
- NoSQL database (Correct answer)
- Network database
Correct answer: NoSQL database
NoSQL databases use non-tabular storage models such as key-value, document, column-family, or graph formats.
Question 3: What does the SQL keyword DISTINCT do in a SELECT statement?
- Sorts results in descending order
- Returns only unique values, eliminating duplicates (Correct answer)
- Limits the number of returned rows
- Filters rows based on a condition
Correct answer: Returns only unique values, eliminating duplicates
DISTINCT ensures only unique rows are returned by removing duplicate values from query results.
Question 4: In a database context, what is a view?
- A physical copy of a table stored on disk
- A virtual table based on the result of a SQL query (Correct answer)
- A backup snapshot of a database
- A type of index for faster lookups
Correct answer: A virtual table based on the result of a SQL query
A view is a stored SQL query that presents data from one or more tables as if it were a single virtual table.
Question 5: Which concurrency control technique uses timestamps to order transactions?
- Two-phase locking
- Optimistic concurrency control
- Timestamp-based protocol (Correct answer)
- Deadlock prevention
Correct answer: Timestamp-based protocol
The timestamp-based protocol assigns timestamps to transactions and uses them to determine the serialization order.
Question 6: What is data redundancy in a database?
- Backing up data to multiple locations
- Storing the same data in multiple places unnecessarily (Correct answer)
- Encrypting data for security
- Compressing data to save space
Correct answer: Storing the same data in multiple places unnecessarily
Data redundancy occurs when the same data is stored in more than one place, wasting storage and risking inconsistencies.
Question 7: Which SQL aggregate function returns the total number of rows in a result set?
- SUM()
- AVG()
- COUNT() (Correct answer)
- MAX()
Correct answer: COUNT()
COUNT() returns the number of rows that match a specified condition or all rows in a table.
What is a deadlock in database management?