Difficulty: Easy & Basic
Which ER-model concept represents a person, place, or thing?
A Constraint
B Entity
C Transaction
D Index
Answer: B. Entity. An entity represents a distinguishable object about which data is stored.
In an ER model, what describes an entity property?
A Cursor
B Partition
C Attribute
D Gateway
Answer: C. Attribute. An attribute records a property such as a customer’s name.
Several columns could uniquely identify a row. What is each called?
A Surrogate attribute
B Foreign key
C Sort index
D Candidate key
Answer: D. Candidate key. Candidate keys are possible unique identifiers from which a primary key is chosen.
How can two columns jointly identify one record?
A Composite key
B Partial index
C Lookup view
D Data mask
Answer: A. Composite key. A composite key combines multiple columns to uniquely identify rows.
What prevents a child record referencing a nonexistent parent?
A Data compression
B Referential integrity
C File rotation
D Query caching
Answer: B. Referential integrity. Referential integrity ensures references point to valid related records.
How can a query combine matching rows from two tables?
A COMMIT clause
B INSERT clause
C JOIN clause
D DROP clause
Answer: C. JOIN clause. A JOIN combines rows according to a relationship between tables.
Repeated searches on a column are slow. Which structure may help?
A Trigger
B View
C Cursor
D Index
Answer: D. Index. An index can speed up searches by locating rows efficiently.
What is a common cost of adding many indexes?
A More storage and writes
B No backup requirement
C Automatic schema migration
D Fewer data constraints
Answer: A. More storage and writes. Indexes use storage and add maintenance work during inserts and updates.
Which properties are summarized by ACID?
A Audit, control, integrity, delivery
B Atomicity, consistency, isolation, durability
C Access, caching, indexing, deletion
D Accuracy, capacity, input, design
Answer: B. Atomicity, consistency, isolation, durability. ACID names four properties used to describe reliable transactions.
Which command makes transaction changes permanent?
A ROLLBACK
B SELECT
C COMMIT
D EXPLAIN
Answer: C. COMMIT. COMMIT confirms the transaction’s changes.
If a transaction fails midway, which command can undo its changes?
A GRANT
B CREATE
C COMMIT
D ROLLBACK
Answer: D. ROLLBACK. ROLLBACK cancels uncommitted changes in a transaction.
Two users overwrite each other’s changes. Which anomaly occurred?
A Lost update
B Deadlock
C Dirty read
D Phantom row
Answer: A. Lost update. A lost update occurs when one write overwrites another user’s update.
How do databases commonly coordinate conflicting writes?
A Aliases
B Locks
C Views
D Schemas
Answer: B. Locks. Locks control access to data during concurrent operations.
Reading another transaction’s uncommitted value is called what?
A Phantom read
B Write skew
C Dirty read
D Lost update
Answer: C. Dirty read. A dirty read exposes data that may later be rolled back.
Two transactions wait on each other’s locks. What occurred?
A Schema drift
B Replication lag
C Index scan
D Deadlock
Answer: D. Deadlock. A deadlock occurs when transactions wait in a cycle for resources.
Which SQL command changes existing column values?
A UPDATE
B INSERT
C SELECT
D CREATE
Answer: A. UPDATE. UPDATE modifies values in existing rows.
Which command removes selected table rows?
A ALTER
B DELETE
C GRANT
D INSERT
Answer: B. DELETE. DELETE removes rows that match its condition.
Which aggregate function counts matching rows?
A CAST
B ROUND
C COUNT
D UPPER
Answer: C. COUNT. COUNT returns the number of rows or non-NULL values, depending on usage.
Which clause groups rows for aggregation?
A ORDER BY
B WHERE
C LIMIT
D GROUP BY
Answer: D. GROUP BY. GROUP BY forms groups for aggregate calculations.
Where can a query filter aggregate groups?
A HAVING clause
B INSERT clause
C VALUES clause
D FROM clause
Answer: A. HAVING clause. HAVING filters grouped results after aggregation.
Which system workload handles routine business transactions?
A DLP
B OLTP
C OLAP
D ETL
Answer: B. OLTP. OLTP systems support frequent operational transactions such as sales and payments.
Managers compare trends across historical data. Which workload fits?
A OLTP
B DNS
C OLAP
D FTP
Answer: C. OLAP. OLAP supports analytical queries over summarized or historical data.
Which process extracts, transforms, and loads data?
A ACID
B BPMN
C CRUD
D ETL
Answer: D. ETL. ETL moves data from sources, transforms it, and loads a target.
Where is integrated historical data commonly analyzed?
A Data warehouse
B Web cache
C Transaction queue
D Password vault
Answer: A. Data warehouse. A data warehouse organizes integrated historical data for analysis.
Which ACID property keeps committed changes after failure?
A Isolation
B Durability
C Atomicity
D Consistency
Answer: B. Durability. Durability means committed changes persist despite a later failure.