CCP Database Management & Information Systems 3 — Questions and Answers
Question 1: Which concurrency control technique uses shared and exclusive locks to prevent conflicting database operations?
- Timestamp ordering
- Two-phase locking (2PL) (Correct answer)
- Optimistic concurrency control
- Shadow paging
Correct answer: Two-phase locking (2PL)
Two-phase locking grants shared locks for reads and exclusive locks for writes, releasing them only after the transaction commits.
Question 2: A view in a relational database is best described as:
- A physical copy of a table stored on disk
- A virtual table based on a stored SQL query (Correct answer)
- An index on multiple columns
- A backup snapshot of the database
Correct answer: A virtual table based on a stored SQL query
A view is a named, stored SELECT statement that presents data from one or more tables without storing the data itself.
Question 3: Which data model represents data as a collection of nodes and edges, making it ideal for social networks and recommendation engines?
- Relational model
- Hierarchical model
- Graph model (Correct answer)
- Document model
Correct answer: Graph model
Graph databases store data as nodes (entities) and edges (relationships), efficiently traversing highly connected datasets.
Question 4: What does the ACID property 'Isolation' guarantee?
- Data is written to disk before the transaction ends
- Concurrent transactions do not interfere with each other (Correct answer)
- The database returns to a valid state after a failure
- Once committed, data persists even after a crash
Correct answer: Concurrent transactions do not interfere with each other
Isolation ensures that the intermediate state of a transaction is invisible to other concurrently running transactions.
Question 5: In database design, what is a surrogate key?
- A key derived from the business data itself
- A system-generated, meaningless unique identifier (Correct answer)
- A composite key made of two natural attributes
- A foreign key that references another table
Correct answer: A system-generated, meaningless unique identifier
A surrogate key is an artificially generated identifier (e.g., auto-increment integer) with no business meaning.
Question 6: Which SQL command is used to remove all rows from a table quickly without logging individual row deletions?
- DELETE
- DROP
- TRUNCATE (Correct answer)
- REMOVE
Correct answer: TRUNCATE
TRUNCATE removes all rows from a table rapidly by deallocating data pages rather than logging each row deletion.
Question 7: In an information system, the 'processing' component refers to:
- Storing data in persistent media
- Converting raw input into meaningful output (Correct answer)
- Distributing reports to end users
- Collecting data from external sources
Correct answer: Converting raw input into meaningful output
Processing transforms raw data through calculations, sorting, or logic into information useful for decision-making.
Which concurrency control technique uses shared and exclusive locks to prevent conflicting database operations?