Database Systems
Introduction
Learn to design, query and manage structured data using database models, relational principles and SQL.
Topic-Wise Overview
Database Foundations
DBMS architecture, schemas, data independence and relational models
Relational Operations
Keys, constraints, relational algebra and joins
Database Design
Entity-relationship modelling, functional dependencies and normalisation
SQL
Data definition, queries, subqueries, joins and aggregation
Management
Transactions, concurrency, indexes, backup, recovery and NoSQL overview
Study Guidance
Explore the complete collection of 200 Database Systems MCQs below, each with four options, its correct answer and an explanation. The six sets cover relational databases, SQL, normalization, transactions, recovery, distributed databases, NoSQL, database security and analytics. Additional short questions and worked examples are planned.
Explore Other Subjects
Browse Computer Science subjects
Database Systems MCQs — Set 1 (Questions 1–30)
Study each question and reveal the correct answer with an explanation.
Question 1. What does DBMS stand for?
- Database Management System
- Data Binary Mapping Service
- Database Memory Scheduler
- Digital Backup Management System
Show correct answer and explanation
Correct answer: A. Database Management System
A DBMS manages databases, queries and controlled access to stored data.
Question 2. A database schema describes
- Only the current number of records
- The structure and constraints of stored data
- A backup schedule
- An individual user password
Show correct answer and explanation
Correct answer: B. The structure and constraints of stored data
The schema defines objects such as tables, columns and constraints.
Question 3. A database instance represents
- Only the database design
- The SQL language standard
- The actual data at a particular time
- A database product name
Show correct answer and explanation
Correct answer: C. The actual data at a particular time
An instance is the current contents of the database.
Question 4. Physical data independence means
- Removing every index
- Deleting the application layer
- Eliminating data types
- Changing physical storage without requiring changes to the logical schema
Show correct answer and explanation
Correct answer: D. Changing physical storage without requiring changes to the logical schema
Applications can retain logical access despite changes in internal storage organization.
Question 5. The relational model represents data primarily as
- Relations or tables
- Only nested files
- Only objects with methods
- Only binary trees
Show correct answer and explanation
Correct answer: A. Relations or tables
A relation is a set of tuples defined over named attributes.
Question 6. A row in a relational table is called a
- Domain
- Tuple
- Schema
- Constraint
Show correct answer and explanation
Correct answer: B. Tuple
Tuples are the records of a relation.
Question 7. A column in a relation is commonly called an
- Tuple
- Transaction
- Attribute
- Index page
Show correct answer and explanation
Correct answer: C. Attribute
Attributes specify the properties represented in each tuple.
Question 8. The domain of an attribute defines
- Its table’s total row count
- The transaction log size
- The index height
- Its permitted values
Show correct answer and explanation
Correct answer: D. Its permitted values
Domains constrain what values an attribute can take.
Question 9. A primary key must be
- Unique and not NULL
- Always a text string
- Repeated in several rows
- An optional duplicate value
Show correct answer and explanation
Correct answer: A. Unique and not NULL
A primary key uniquely identifies each row and disallows NULL.
Question 10. A candidate key is
- Any column containing numbers
- A minimal set of attributes uniquely identifying rows
- Every foreign key
- A nonunique sorting field
Show correct answer and explanation
Correct answer: B. A minimal set of attributes uniquely identifying rows
Candidate keys are minimal superkeys.
Question 11. A superkey is
- Only a single primary key column
- A key from another database
- A set of attributes that uniquely identifies each row
- A column with duplicate values
Show correct answer and explanation
Correct answer: C. A set of attributes that uniquely identifies each row
A superkey may contain additional attributes beyond a candidate key.
Question 12. A foreign key is used to
- Sort the database physically
- Encrypt every column
- Count duplicate records
- Enforce referential relationships between tables
Show correct answer and explanation
Correct answer: D. Enforce referential relationships between tables
Foreign key values refer to suitable unique or primary key values in another or the same table.
Question 13. Referential integrity requires
- Foreign key values to refer to permitted referenced rows or be NULL when allowed
- Every table to have exactly one row
- All strings to be uppercase
- Transactions to run sequentially
Show correct answer and explanation
Correct answer: A. Foreign key values to refer to permitted referenced rows or be NULL when allowed
Foreign key constraints prevent invalid references.
Question 14. Entity integrity in the relational model primarily requires
- All columns to be indexed
- Primary-key attributes not to be NULL
- Every table to have a foreign key
- All data to be encrypted
Show correct answer and explanation
Correct answer: B. Primary-key attributes not to be NULL
A primary key must identify a row with known values.
Question 15. An entity in ER modeling is
- A SQL sorting option
- A buffer frame
- A distinguishable real-world object or concept
- A query plan only
Show correct answer and explanation
Correct answer: C. A distinguishable real-world object or concept
ER models describe entities and relationships.
Question 16. A one-to-many relationship means
- Every entity relates to exactly one other
- No entity can be repeated
- Every row must have two primary keys
- One entity occurrence can relate to multiple occurrences of another entity type
Show correct answer and explanation
Correct answer: D. One entity occurrence can relate to multiple occurrences of another entity type
A department can have many employees, for example.
Question 17. A weak entity is typically identified using
- A partial key together with an identifying owner’s key
- Only a global independent primary key
- A row number without constraints
- An unrelated unique index
Show correct answer and explanation
Correct answer: A. A partial key together with an identifying owner’s key
Weak entities depend on an owner for identification.
Question 18. Which SQL statement retrieves rows?
- INSERT
- SELECT
- DROP
- GRANT
Show correct answer and explanation
Correct answer: B. SELECT
SELECT queries data from tables and views.
Question 19. Which SQL clause filters rows before grouping?
- HAVING
- ORDER BY
- WHERE
- LIMIT
Show correct answer and explanation
Correct answer: C. WHERE
WHERE applies predicates to individual rows before grouping.
Question 20. Which clause filters grouped results?
- WHERE
- FROM
- DISTINCT
- HAVING
Show correct answer and explanation
Correct answer: D. HAVING
HAVING filters groups, commonly using aggregate conditions.
Question 21. Which SQL clause sorts query results?
- ORDER BY
- GROUP BY
- WHERE
- JOIN
Show correct answer and explanation
Correct answer: A. ORDER BY
ORDER BY controls result order.
Question 22. Which SQL clause groups rows for aggregation?
- DISTINCT
- GROUP BY
- LIMIT
- UNION
Show correct answer and explanation
Correct answer: B. GROUP BY
GROUP BY forms groups that aggregates can summarize.
Question 23. Which aggregate function counts rows with COUNT(*)?
- SUM(*)
- AVG(*)
- COUNT(*)
- MIN(*)
Show correct answer and explanation
Correct answer: C. COUNT(*)
COUNT(*) counts rows, including those with NULL column values.
Question 24. What does COUNT(column_name) exclude?
- Duplicate non-NULL values always
- Zero values
- Negative values
- NULL values in that column
Show correct answer and explanation
Correct answer: D. NULL values in that column
COUNT(expression) counts its non-NULL evaluated values.
Question 25. What does DISTINCT do in SELECT?
- Removes duplicate result rows
- Deletes duplicate source records
- Sorts rows automatically
- Creates a primary key
Show correct answer and explanation
Correct answer: A. Removes duplicate result rows
DISTINCT removes duplicate rows from the query result.
Question 26. Which SQL operator is used to test a NULL value?
- = NULL
- IS NULL
- LIKE NULL
- IN NULL
Show correct answer and explanation
Correct answer: B. IS NULL
IS NULL is the standard predicate for testing missing values.
Question 27. Which SQL join returns only matching combinations from both inputs?
- FULL OUTER JOIN
- CROSS JOIN
- INNER JOIN
- LEFT OUTER JOIN
Show correct answer and explanation
Correct answer: C. INNER JOIN
An inner join returns row combinations satisfying the join condition.
Question 28. A LEFT OUTER JOIN preserves
- Only matched right input rows
- Only unmatched right rows
- No NULL values
- All rows from the left input
Show correct answer and explanation
Correct answer: D. All rows from the left input
Unmatched left rows appear with NULL-extended right-side columns.
Question 29. A CROSS JOIN returns
- A Cartesian product of input rows
- Only rows having identical keys
- The union of both tables
- Only distinct shared attributes
Show correct answer and explanation
Correct answer: A. A Cartesian product of input rows
Every left row is paired with every right row.
Question 30. If table A has 3 rows and B has 4 rows, their CROSS JOIN has
- 7 rows
- 12 rows
- 1 row
- 4 rows
Show correct answer and explanation
Correct answer: B. 12 rows
A Cartesian product contains 3 × 4 = 12 row pairs.
Database Systems MCQs — Set 2 (Questions 31–60)
Study each question and reveal the correct answer with an explanation.
Question 31. Which SQL command adds a new row?
- UPDATE
- ALTER
- INSERT
- TRUNCATE
Show correct answer and explanation
Correct answer: C. INSERT
INSERT adds rows to a table.
Question 32. Which command modifies existing row values?
- CREATE
- SELECT
- GRANT
- UPDATE
Show correct answer and explanation
Correct answer: D. UPDATE
UPDATE changes existing rows satisfying its optional WHERE condition.
Question 33. Which command removes selected rows?
- DELETE
- DROP TABLE
- CREATE VIEW
- COMMIT
Show correct answer and explanation
Correct answer: A. DELETE
DELETE removes rows; without a WHERE clause it can remove all rows.
Question 34. Which statement creates a table?
- INSERT TABLE
- CREATE TABLE
- SELECT TABLE
- GRANT TABLE
Show correct answer and explanation
Correct answer: B. CREATE TABLE
CREATE TABLE defines a new table and its columns.
Question 35. Which statement changes a table definition?
- UPDATE TABLE
- ORDER TABLE
- ALTER TABLE
- SELECT TABLE
Show correct answer and explanation
Correct answer: C. ALTER TABLE
ALTER TABLE changes schema definitions.
Question 36. Which statement removes a table definition and its data?
- DELETE WHERE
- ROLLBACK
- GROUP BY
- DROP TABLE
Show correct answer and explanation
Correct answer: D. DROP TABLE
DROP TABLE removes the table object, subject to database rules and dependencies.
Question 37. A database view is generally
- A stored query definition presented as a virtual table
- Always a duplicated physical table
- Only a transaction log
- A temporary CPU cache
Show correct answer and explanation
Correct answer: A. A stored query definition presented as a virtual table
A conventional view derives its contents from underlying relations.
Question 38. An index is used mainly to
- Guarantee every query is instant
- Speed up selected data retrieval operations
- Remove every need for constraints
- Prevent all concurrent access
Show correct answer and explanation
Correct answer: B. Speed up selected data retrieval operations
Indexes provide access paths at storage and maintenance cost.
Question 39. A B-tree family index is particularly useful for
- Only image storage
- Only full-text translation
- Ordered searches and range queries
- Eliminating all transaction logs
Show correct answer and explanation
Correct answer: C. Ordered searches and range queries
Balanced tree structures support ordered lookups and ranges.
Question 40. A hash index is especially suitable for
- Ordered range scans
- Sorting all rows
- Detecting foreign keys
- Equality lookups
Show correct answer and explanation
Correct answer: D. Equality lookups
Hash access is well suited to finding records matching a key exactly.
Question 41. A functional dependency X → Y means
- Rows agreeing on X must agree on Y
- X and Y must be identical columns
- Y is a foreign key
- X can never be NULL
Show correct answer and explanation
Correct answer: A. Rows agreeing on X must agree on Y
A functional dependency captures a constraint among attribute values.
Question 42. First normal form requires
- Every table to have exactly one attribute
- Atomic values under the chosen relational domain interpretation
- Every relation to be in BCNF
- All attributes to be numeric
Show correct answer and explanation
Correct answer: B. Atomic values under the chosen relational domain interpretation
1NF rejects repeating groups and non-atomic field structures in the usual introductory model.
Question 43. Second normal form eliminates
- Every foreign key
- Every functional dependency
- Partial dependencies of non-prime attributes on candidate keys
- Every duplicate value
Show correct answer and explanation
Correct answer: C. Partial dependencies of non-prime attributes on candidate keys
2NF requires 1NF and no non-prime attribute partly dependent on a candidate key.
Question 44. Third normal form aims to reduce
- All joins from queries
- All indexes
- All primary keys
- Problematic transitive dependencies involving non-key attributes
Show correct answer and explanation
Correct answer: D. Problematic transitive dependencies involving non-key attributes
3NF restricts functional dependencies to limit redundancy and update anomalies.
Question 45. BCNF requires that for every nontrivial dependency X → Y
- X is a superkey
- Y is always a primary key
- X is a single attribute
- X equals Y
Show correct answer and explanation
Correct answer: A. X is a superkey
Boyce–Codd normal form requires each determinant of a nontrivial FD to be a superkey.
Question 46. An update anomaly arises when
- A query uses ORDER BY
- Redundant data require multiple coordinated changes
- A table has a unique key
- A transaction commits
Show correct answer and explanation
Correct answer: B. Redundant data require multiple coordinated changes
Denormalized repetition can produce inconsistent copies after incomplete updates.
Question 47. A lossless decomposition ensures
- Every table has one row
- No joins are ever needed
- The original relation can be reconstructed without spurious tuples
- All data are compressed
Show correct answer and explanation
Correct answer: C. The original relation can be reconstructed without spurious tuples
A lossless join preserves the original information through decomposition.
Question 48. A transaction is
- A column definition only
- A physical memory sector
- A single SQL keyword necessarily
- A logical unit of database work
Show correct answer and explanation
Correct answer: D. A logical unit of database work
Transactions group operations with defined commit and rollback semantics.
Question 49. Atomicity in ACID means
- All-or-nothing transaction effects
- Every read is instantaneous
- Every transaction uses one CPU
- No indexes are permitted
Show correct answer and explanation
Correct answer: A. All-or-nothing transaction effects
Atomicity prevents a partially applied committed transaction outcome.
Question 50. Consistency in ACID refers to
- Every query returning identical rows
- Preservation of declared integrity constraints across valid transactions
- All tables having equal size
- Automatic password recovery
Show correct answer and explanation
Correct answer: B. Preservation of declared integrity constraints across valid transactions
Transactions should take the database from one valid state to another.
Question 51. Isolation in ACID addresses
- Disk encryption only
- Physical table locations
- Interference between concurrently executing transactions
- Only backup frequency
Show correct answer and explanation
Correct answer: C. Interference between concurrently executing transactions
Isolation controls what effects concurrent transactions can observe.
Question 52. Durability in ACID means
- No transaction may be rolled back
- Every query runs without a lock
- Data never need backups
- Committed changes survive relevant failures under the system’s guarantees
Show correct answer and explanation
Correct answer: D. Committed changes survive relevant failures under the system’s guarantees
Durability requires persistent recovery of committed work.
Question 53. COMMIT usually
- Makes a transaction’s changes permanent under its durability guarantees
- Cancels every query
- Deletes the transaction log
- Reverses all inserted rows
Show correct answer and explanation
Correct answer: A. Makes a transaction’s changes permanent under its durability guarantees
COMMIT ends a transaction successfully.
Question 54. ROLLBACK usually
- Creates a new index
- Undoes uncommitted changes of a transaction
- Grants SELECT privileges
- Sorts all relations
Show correct answer and explanation
Correct answer: B. Undoes uncommitted changes of a transaction
ROLLBACK restores transactional state subject to the DBMS’s semantics.
Question 55. A dirty read occurs when
- Two rows have the same non-key value
- An index returns a match
- One transaction reads another’s uncommitted changes
- A transaction reads its own committed data
Show correct answer and explanation
Correct answer: C. One transaction reads another’s uncommitted changes
Uncommitted changes might later be rolled back.
Question 56. A nonrepeatable read occurs when
- A database has repeated rows
- A query contains DISTINCT
- An index is rebuilt
- Repeating a row read in a transaction yields a changed value due to another committed transaction
Show correct answer and explanation
Correct answer: D. Repeating a row read in a transaction yields a changed value due to another committed transaction
Concurrent modifications can change the value seen by repeated reads.
Question 57. A phantom read refers to
- Re-executing a predicate query and observing new or missing qualifying rows
- Reading an unreadable disk sector
- Counting NULL values
- Reading one file twice
Show correct answer and explanation
Correct answer: A. Re-executing a predicate query and observing new or missing qualifying rows
Concurrent inserts or deletes can alter the set of rows matching a predicate.
Question 58. Two-phase locking requires
- Exactly two database transactions
- A growing lock-acquisition phase followed by a shrinking release phase
- Only two tables
- All locks to be released before any are acquired
Show correct answer and explanation
Correct answer: B. A growing lock-acquisition phase followed by a shrinking release phase
Basic 2PL prohibits acquiring new locks after releasing the first lock.
Question 59. A deadlock in transaction locking can involve
- Only one transaction without resources
- Queries using arithmetic
- Transactions cyclically waiting for each other’s held locks
- Indexes without writes
Show correct answer and explanation
Correct answer: C. Transactions cyclically waiting for each other’s held locks
Circular lock waits can prevent progress.
Question 60. Write-ahead logging requires
- Data pages always to be written before logs
- No logging of committed changes
- All transactions to be read-only
- Relevant log records to be persisted before corresponding data-page changes are flushed
Show correct answer and explanation
Correct answer: D. Relevant log records to be persisted before corresponding data-page changes are flushed
WAL preserves recovery information ahead of propagating changes to data pages.
Database Systems MCQs — Set 3 (Questions 61–90)
Choose an option, then reveal the answer and explanation.
Question 61. What does SQL UNION do?
- Combine compatible results and eliminate duplicates
- Preserve all duplicate rows
- Join on a key
- Create an index
Show correct answer and explanation
Correct answer: A. Combine compatible results and eliminate duplicates
UNION returns distinct rows from compatible query results.
Question 62. What does UNION ALL do?
- Always sort descending
- Combine compatible results without removing duplicates
- Group by primary key
- Remove every NULL
Show correct answer and explanation
Correct answer: B. Combine compatible results without removing duplicates
UNION ALL preserves duplicate result rows.
Question 63. What does INTERSECT return?
- All left rows
- All right rows
- Rows common to both compatible results
- Every combination
Show correct answer and explanation
Correct answer: C. Rows common to both compatible results
INTERSECT finds the set intersection.
Question 64. What does SQL EXCEPT return?
- Only common rows
- All rows from both
- Only NULLs
- Rows in the first result not in the second
Show correct answer and explanation
Correct answer: D. Rows in the first result not in the second
EXCEPT implements set difference.
Question 65. What is SQL IN used for?
- Testing membership in a list or result
- Sorting rows
- Renaming attributes
- Committing writes
Show correct answer and explanation
Correct answer: A. Testing membership in a list or result
IN tests whether a value equals one of specified values.
Question 66. Which operator supports simple string patterns?
- COUNT
- LIKE
- DISTINCT
- BETWEEN
Show correct answer and explanation
Correct answer: B. LIKE
LIKE supports wildcard matching.
Question 67. What does % mean in a LIKE pattern?
- Exactly one character
- Exactly one digit
- Zero or more characters
- A literal space
Show correct answer and explanation
Correct answer: C. Zero or more characters
Percent matches arbitrary-length character sequences.
Question 68. What does _ mean in a LIKE pattern?
- Zero or more characters
- A word boundary
- Any numeric value only
- Exactly one character
Show correct answer and explanation
Correct answer: D. Exactly one character
Underscore is a one-character wildcard.
Question 69. Is BETWEEN inclusive in ordinary SQL?
- Yes, both endpoints are included
- No endpoints are included
- Only lower is included
- Only upper is included
Show correct answer and explanation
Correct answer: A. Yes, both endpoints are included
BETWEEN is generally equivalent to greater-than-or-equal and less-than-or-equal.
Question 70. What does EXISTS test?
- Whether every value is non-NULL
- Whether a subquery returns any rows
- Whether all tables have indexes
- Whether rows are sorted
Show correct answer and explanation
Correct answer: B. Whether a subquery returns any rows
EXISTS is true if its subquery produces at least one row.
Question 71. What makes a subquery correlated?
- It contains COUNT
- It uses SELECT
- It refers to an enclosing query’s attributes
- It has an alias
Show correct answer and explanation
Correct answer: C. It refers to an enclosing query’s attributes
Correlated subqueries depend on values from outer query blocks.
Question 72. Which PostgreSQL clause limits returned rows?
- GROUP BY
- HAVING
- UNION
- LIMIT
Show correct answer and explanation
Correct answer: D. LIMIT
LIMIT caps the number of result rows.
Question 73. Which expression obtains the highest salary?
- MAX(salary)
- MIN(salary)
- AVG(salary)
- COUNT(salary)
Show correct answer and explanation
Correct answer: A. MAX(salary)
MAX returns the largest non-NULL input.
Question 74. What does AVG ignore?
- Zero values
- NULL inputs
- Negative values
- Duplicates
Show correct answer and explanation
Correct answer: B. NULL inputs
AVG averages non-NULL values.
Question 75. Why use AS in a SELECT expression?
- To impose uniqueness
- To commit
- To assign an output alias
- To grant permissions
Show correct answer and explanation
Correct answer: C. To assign an output alias
AS introduces a name for a result expression or table reference.
Question 76. Which is the standard SQL equality operator?
- ==
- :=
- ===
- =
Show correct answer and explanation
Correct answer: D. =
SQL uses = for equality comparisons.
Question 77. What is a self-join?
- A table joined to another reference of itself
- A query with no FROM
- A union of databases
- A table without keys
Show correct answer and explanation
Correct answer: A. A table joined to another reference of itself
Aliases distinguish multiple roles of the same relation.
Question 78. What is the purpose of UNIQUE?
- Force all fields non-NULL
- Disallow duplicate key values under the DBMS’s NULL rules
- Sort table rows
- Create a backup
Show correct answer and explanation
Correct answer: B. Disallow duplicate key values under the DBMS’s NULL rules
UNIQUE constrains permitted repeated values.
Question 79. What is the purpose of CHECK?
- Define a join algorithm
- Sort query results
- Restrict rows using a declared predicate
- Log transactions
Show correct answer and explanation
Correct answer: C. Restrict rows using a declared predicate
CHECK disallows rows where its condition is false.
Question 80. What does DEFAULT supply?
- A guaranteed primary key
- A stored backup
- A query plan
- A value when one is omitted for a column
Show correct answer and explanation
Correct answer: D. A value when one is omitted for a column
Column defaults provide an expression when no explicit value is given.
Question 81. What does ON DELETE CASCADE do?
- Remove referencing rows when a referenced row is deleted
- Never delete referencing rows
- Drop the database
- Disable a foreign key
Show correct answer and explanation
Correct answer: A. Remove referencing rows when a referenced row is deleted
Referential action CASCADE propagates deletions.
Question 82. What does ON DELETE RESTRICT do?
- Delete all child rows
- Prevent deletion while referencing rows remain
- Replace child values with zero
- Commit a transaction
Show correct answer and explanation
Correct answer: B. Prevent deletion while referencing rows remain
RESTRICT blocks prohibited referenced-row deletion.
Question 83. Which type is intended for exact decimal quantities?
- FLOAT
- BLOB
- DECIMAL
- TEXT
Show correct answer and explanation
Correct answer: C. DECIMAL
DECIMAL(p,s) supports exact fixed-scale arithmetic.
Question 84. Why avoid binary FLOAT for exact money values?
- FLOAT cannot add numbers
- FLOAT is text
- FLOAT cannot be negative
- Some decimals cannot be represented exactly
Show correct answer and explanation
Correct answer: D. Some decimals cannot be represented exactly
Binary floating-point approximations can cause rounding discrepancies.
Question 85. What is a composite key?
- A key made from multiple attributes
- A key from another table only
- A nonunique attribute
- An index without values
Show correct answer and explanation
Correct answer: A. A key made from multiple attributes
Composite keys use attribute combinations for identification.
Question 86. What is a surrogate key?
- An external disk block
- An artificial identifier without direct business meaning
- A natural name
- A duplicate index
Show correct answer and explanation
Correct answer: B. An artificial identifier without direct business meaning
Generated record identifiers are common surrogate keys.
Question 87. What is a natural key?
- A random sequence number only
- A file offset
- A meaningful attribute or set that uniquely identifies an entity
- A NULL foreign key
Show correct answer and explanation
Correct answer: C. A meaningful attribute or set that uniquely identifies an entity
Natural keys originate in the modeled business domain.
Question 88. What causes an insertion anomaly?
- A simple SELECT
- A valid index
- An automatic commit
- A design forces unrelated information to be supplied to insert a fact
Show correct answer and explanation
Correct answer: D. A design forces unrelated information to be supplied to insert a fact
Badly combined facts can block clean insertion.
Question 89. What causes a deletion anomaly?
- Deleting one fact inadvertently removes another needed fact
- Deleting expired logs
- A dropped temporary table
- A database backup
Show correct answer and explanation
Correct answer: A. Deleting one fact inadvertently removes another needed fact
Redundancy can make unrelated information depend on a single row.
Question 90. Why calculate attribute closure?
- To calculate CPU speed
- To find attributes functionally implied by a set
- To count rows
- To sort columns
Show correct answer and explanation
Correct answer: B. To find attributes functionally implied by a set
Closure supports key discovery and FD implication tests.
Database Systems MCQs — Set 4 (Questions 91–120)
Choose an option, then reveal the answer and explanation.
Question 91. If A determines B and B determines C, then
- C determines A
- B determines A
- A determines C
- C determines B
Show correct answer and explanation
Correct answer: C. A determines C
Functional dependencies satisfy transitivity.
Question 92. Which dependency is trivial?
- A determines unrelated C
- B determines unrelated D
- C determines unrelated A
- AB determines A
Show correct answer and explanation
Correct answer: D. AB determines A
A dependency is trivial when the dependent attributes are included in the determinant.
Question 93. Why preserve dependencies during decomposition?
- To enforce constraints without recombining relations unnecessarily
- To ban joins
- To avoid keys
- To remove all indexes
Show correct answer and explanation
Correct answer: A. To enforce constraints without recombining relations unnecessarily
Dependency preservation allows local constraint enforcement.
Question 94. What is the key BCNF requirement?
- Every table has one column
- Every nontrivial FD’s determinant is a superkey
- Every column is numeric
- All tuples are ordered
Show correct answer and explanation
Correct answer: B. Every nontrivial FD’s determinant is a superkey
BCNF requires determinants of nontrivial dependencies to be superkeys.
Question 95. Does BCNF imply 3NF in the standard relational model?
- No
- Only for empty tables
- Yes
- Only for tables without keys
Show correct answer and explanation
Correct answer: C. Yes
BCNF is stronger than third normal form.
Question 96. How are many-to-many relationships typically implemented?
- With one delimited text column
- With an OS thread
- With a trigger only
- With an association table
Show correct answer and explanation
Correct answer: D. With an association table
A junction table stores participating key pairs.
Question 97. How does a materialized view differ from a normal view?
- It persists derived query results
- It cannot have a SELECT
- It always contains exactly one row
- It never needs refresh
Show correct answer and explanation
Correct answer: A. It persists derived query results
Materialized views store the computed result.
Question 98. Why can many indexes slow writes?
- Indexes disable transactions
- Indexes must be updated when relevant rows change
- Indexes prevent SELECT
- Indexes are always locked forever
Show correct answer and explanation
Correct answer: B. Indexes must be updated when relevant rows change
Maintaining index entries adds write overhead.
Question 99. What is an important benefit of a B-tree index?
- Always removing NULLs
- Avoiding all disk reads
- Supporting ordered range access
- Automatically normalizing tables
Show correct answer and explanation
Correct answer: C. Supporting ordered range access
B-trees efficiently support lookup and range retrieval.
Question 100. For which predicate is a hash index commonly useful?
- An arbitrary ordered range
- LIKE with any leading wildcard
- ORDER BY all columns
- Equality on an indexed key
Show correct answer and explanation
Correct answer: D. Equality on an indexed key
Hashing commonly accelerates exact-key matches.
Question 101. What is query selectivity?
- The fraction of records qualifying under a predicate
- The number of CPUs
- The length of the column name
- The query timestamp
Show correct answer and explanation
Correct answer: A. The fraction of records qualifying under a predicate
Selectivity indicates how strongly a predicate filters data.
Question 102. What is the job of a query optimizer?
- Choose a database owner
- Choose an execution plan
- Generate user passwords
- Change the application’s goals
Show correct answer and explanation
Correct answer: B. Choose an execution plan
The optimizer evaluates candidate plans using statistics and costs.
Question 103. What is a table scan?
- Deleting a relation
- Changing SQL types
- Examining table rows through a scan access path
- Adding a foreign key
Show correct answer and explanation
Correct answer: C. Examining table rows through a scan access path
A scan reads table data to evaluate conditions.
Question 104. What does a nested-loop join do?
- Encrypt every join key
- Merge only sorted data
- Build a B-tree always
- Match inner candidates for each outer row
Show correct answer and explanation
Correct answer: D. Match inner candidates for each outer row
Nested loops repeatedly search or examine one input for outer rows.
Question 105. How does a hash join commonly operate?
- Build a hash structure and probe it using the other input
- Use only sorted inputs
- Require every table to have one row
- Perform no comparison
Show correct answer and explanation
Correct answer: A. Build a hash structure and probe it using the other input
Hash joins are well suited to equijoin matching.
Question 106. What does sort-merge join exploit?
- Only random row order
- Sorted join-key order
- Automatic compression
- Filesystem inode numbers
Show correct answer and explanation
Correct answer: B. Sorted join-key order
Ordered inputs can be merged to find matching values.
Question 107. What is a query execution plan?
- A table backup
- A role assignment
- A sequence or tree of database operators chosen for a query
- A primary key definition only
Show correct answer and explanation
Correct answer: C. A sequence or tree of database operators chosen for a query
Plans specify scans, filters, joins, sorting and aggregation.
Question 108. What is optimistic concurrency control?
- Lock the entire database indefinitely
- Prohibit all reads
- Disable rollback
- Execute and later validate for conflicts
Show correct answer and explanation
Correct answer: D. Execute and later validate for conflicts
Optimistic schemes check conflicts before finalizing updates.
Question 109. What does MVCC stand for?
- Multiversion concurrency control
- Multiple virtual cache clusters
- Memory validation control code
- Metadata version checksum
Show correct answer and explanation
Correct answer: A. Multiversion concurrency control
MVCC retains data versions to support transaction visibility.
Question 110. What does serializable isolation guarantee?
- All transactions finish instantly
- Behavior equivalent to some serial transaction order
- Every query is read-only
- No transaction can abort
Show correct answer and explanation
Correct answer: B. Behavior equivalent to some serial transaction order
Serializable outcomes conform to an equivalent sequential execution.
Question 111. What is a lost update anomaly?
- A row contains NULL
- A backup fails
- A concurrent write overwrites another update improperly
- A SELECT returns no rows
Show correct answer and explanation
Correct answer: C. A concurrent write overwrites another update improperly
Uncoordinated concurrent writes can erase previous changes.
Question 112. What is a transaction schedule?
- A table schema
- A database username
- A physical disk layout
- An ordering or interleaving of transaction operations
Show correct answer and explanation
Correct answer: D. An ordering or interleaving of transaction operations
Schedules describe transaction operation sequences.
Question 113. What defines conflict serializability?
- Conflict equivalence to a serial schedule
- All queries run at once
- Only one row exists
- There are no SELECT statements
Show correct answer and explanation
Correct answer: A. Conflict equivalence to a serial schedule
Conflicting operations can be reordered to match some serial sequence.
Question 114. A cycle in a precedence graph proves a schedule is
- Always serial
- Not conflict serializable
- Guaranteed deadlock-free
- Read-only
Show correct answer and explanation
Correct answer: B. Not conflict serializable
A directed cycle prevents a topological serial transaction ordering.
Question 115. What does strict two-phase locking retain until commit or abort?
- Every shared lock necessarily in all definitions
- Only table names
- Exclusive locks
- Indexes but not locks
Show correct answer and explanation
Correct answer: C. Exclusive locks
Strict 2PL keeps write locks until transaction end.
Question 116. Which isolation level can permit dirty reads?
- SERIALIZABLE
- REPEATABLE READ
- SNAPSHOT
- READ UNCOMMITTED
Show correct answer and explanation
Correct answer: D. READ UNCOMMITTED
Read uncommitted may allow reading another transaction’s uncommitted data.
Question 117. What does a recovery checkpoint help reduce?
- The amount of log work needed during restart
- The number of SQL keywords
- The need for transaction logs entirely
- The size of every primary key
Show correct answer and explanation
Correct answer: A. The amount of log work needed during restart
Checkpoints record positions and state useful to restart recovery.
Question 118. What does REDO mean in database recovery?
- Reverse all committed work
- Reapply changes needed for durability
- Drop schemas
- Remove locks only
Show correct answer and explanation
Correct answer: B. Reapply changes needed for durability
Redo restores effects that should remain after failure.
Question 119. What does UNDO mean in recovery?
- Recreate all queries
- Replay only committed changes
- Reverse incomplete transaction effects
- Sort backup files
Show correct answer and explanation
Correct answer: C. Reverse incomplete transaction effects
Undo rolls back effects of transactions that did not commit.
Question 120. What does a differential backup usually capture?
- Changes only since the latest incremental backup
- Only database definitions
- Only transaction locks
- Changes since the latest full backup
Show correct answer and explanation
Correct answer: D. Changes since the latest full backup
Differential backup commonly uses the most recent full backup as its baseline.
Database Systems MCQs — Set 5 (Questions 121–160)
Read each question and reveal its answer and explanation.
Question 121. Which property of a transaction ensures all its operations succeed or none take effect?
- Atomicity
- Durability
- Availability
- Normalization
Show correct answer and explanation
Correct answer: A. Atomicity
Atomicity provides all-or-nothing transaction behavior.
Question 122. In two-phase commit, the coordinator initially asks participants to
- Discard every log
- Prepare to commit
- Delete schemas
- Release all data
Show correct answer and explanation
Correct answer: B. Prepare to commit
The prepare phase gathers votes from participants before deciding.
Question 123. The second phase of two-phase commit communicates the
- Table row count
- Index order
- Global commit or abort decision
- Query syntax
Show correct answer and explanation
Correct answer: C. Global commit or abort decision
Participants follow the coordinator’s final decision.
Question 124. A risk of two-phase commit is
- Guaranteed zero latency
- No transaction logging
- Permanent prevention of all deadlocks
- Blocking when the coordinator fails at a critical point
Show correct answer and explanation
Correct answer: D. Blocking when the coordinator fails at a critical point
Prepared participants can be forced to wait for the coordinator or recovery.
Question 125. A distributed transaction involves
- Operations across multiple participating resources or systems
- Exactly one SELECT statement
- Only a single index lookup
- One row in a local table
Show correct answer and explanation
Correct answer: A. Operations across multiple participating resources or systems
Distributed transactions coordinate updates across distinct participants.
Question 126. Sharding divides data primarily by
- Replicating every table everywhere
- Partitioning records across separate nodes or partitions
- Dropping the primary key
- Converting SQL into XML
Show correct answer and explanation
Correct answer: B. Partitioning records across separate nodes or partitions
Sharding distributes subsets of data.
Question 127. Horizontal partitioning divides a table by
- Columns
- SQL users
- Rows
- Index types
Show correct answer and explanation
Correct answer: C. Rows
Horizontal partitioning places different rows in different partitions.
Question 128. Vertical partitioning divides a table by
- Only row ranges
- Transactions
- CPU threads
- Columns or attribute groups
Show correct answer and explanation
Correct answer: D. Columns or attribute groups
Vertical partitioning groups different attributes, often retaining keys to reconstruct rows.
Question 129. Database replication means
- Maintaining copies of data on multiple nodes
- Splitting one row into attributes
- Deleting historical versions
- Disabling consistency checks
Show correct answer and explanation
Correct answer: A. Maintaining copies of data on multiple nodes
Replicas provide multiple copies for availability or read distribution.
Question 130. Synchronous replication generally requires
- No network communication
- Waiting for specified replica acknowledgments before completion
- Never persisting logs
- All replicas to be offline
Show correct answer and explanation
Correct answer: B. Waiting for specified replica acknowledgments before completion
A write may need acknowledgments from replica participants.
Question 131. Asynchronous replication may cause
- Guaranteed identical instantaneous replicas
- No possibility of failover
- Replication lag
- Automatic removal of conflicts
Show correct answer and explanation
Correct answer: C. Replication lag
Replica changes may arrive after a primary acknowledges a write.
Question 132. A database failover is
- Dropping all indexes
- Rewriting SQL as Java
- Deleting transaction logs
- Switching service to an alternate node after a failure
Show correct answer and explanation
Correct answer: D. Switching service to an alternate node after a failure
Failover aims to restore service using another available node.
Question 133. A quorum-based replication protocol generally requires
- A threshold number of participant acknowledgments or votes
- One local row only
- Every user to be an administrator
- No message exchange
Show correct answer and explanation
Correct answer: A. A threshold number of participant acknowledgments or votes
Quorums coordinate distributed decisions or reads and writes.
Question 134. Eventual consistency means
- Every read immediately sees all writes
- Replicas may converge after updates stop and communication proceeds
- No replica ever diverges
- All operations are serializable
Show correct answer and explanation
Correct answer: B. Replicas may converge after updates stop and communication proceeds
Convergence is expected after propagation under the relevant assumptions.
Question 135. Strong consistency is often discussed in terms of
- The length of table names
- File compression level
- How operations appear ordered and visible to clients
- Average row width
Show correct answer and explanation
Correct answer: C. How operations appear ordered and visible to clients
Consistency models govern visibility and ordering guarantees.
Question 136. Linearizability requires each operation to appear
- Delayed until midnight
- Before its invocation
- Independent of real-time order
- Atomic at a point between invocation and response
Show correct answer and explanation
Correct answer: D. Atomic at a point between invocation and response
Linearizable operations respect real-time precedence.
Question 137. CAP theorem concerns tradeoffs among
- Consistency, availability and partition tolerance
- Caching, authorization and performance
- Compression, audit and privacy
- Concurrency, access and parsing
Show correct answer and explanation
Correct answer: A. Consistency, availability and partition tolerance
With network partitions, a distributed system cannot guarantee both full availability and linearizable consistency.
Question 138. A network partition means
- A table loses its primary key
- Some nodes cannot communicate reliably with others
- A database uses a composite key
- A transaction contains two SQL statements
Show correct answer and explanation
Correct answer: B. Some nodes cannot communicate reliably with others
Connectivity failures split communicating groups.
Question 139. A document database commonly stores
- Only fixed-width tuples with no nesting
- Only files named document
- Flexible records such as JSON-like documents
- Only CPU registers
Show correct answer and explanation
Correct answer: C. Flexible records such as JSON-like documents
Document stores organize data around document-shaped records.
Question 140. A key-value store primarily retrieves data using
- Only relational joins
- Graph path queries
- A mandatory SQL schema
- A key mapped to an associated value
Show correct answer and explanation
Correct answer: D. A key mapped to an associated value
Key-value stores offer simple lookup and update by key.
Question 141. A graph database is particularly suitable for
- Traversing relationships between connected entities
- Only computing numeric averages
- Replacing every backup
- Sorting a single file
Show correct answer and explanation
Correct answer: A. Traversing relationships between connected entities
Graph databases model entities and edges for relationship queries.
Question 142. A wide-column database often organizes data as
- Only a single binary value
- Rows with flexible sets of columns grouped by families or similar structures
- A fixed two-column matrix always
- No keys
Show correct answer and explanation
Correct answer: B. Rows with flexible sets of columns grouped by families or similar structures
Wide-column systems can support sparse and distributed records.
Question 143. Denormalization is sometimes used to
- Guarantee BCNF
- Remove every data inconsistency risk
- Reduce read-time joins at the cost of redundancy
- Make all queries read-only
Show correct answer and explanation
Correct answer: C. Reduce read-time joins at the cost of redundancy
Duplicated data may improve some reads but complicate updates.
Question 144. When choosing between SQL and NoSQL stores, a key consideration is
- Only the name of the product
- Only disk color
- Avoiding all testing
- Application requirements for data model, transactions and scaling
Show correct answer and explanation
Correct answer: D. Application requirements for data model, transactions and scaling
No single database architecture is ideal for every workload.
Question 145. A schema migration is
- A controlled change to database structure
- A forced power outage
- A routine SELECT only
- A disk health report
Show correct answer and explanation
Correct answer: A. A controlled change to database structure
Migrations evolve tables and constraints while managing existing data.
Question 146. A backward-compatible schema change aims to
- Disable old queries immediately
- Keep existing consumers functioning during rollout
- Remove all old records
- Prevent software updates
Show correct answer and explanation
Correct answer: B. Keep existing consumers functioning during rollout
Compatibility facilitates gradual application deployments.
Question 147. An online schema change seeks to
- Guarantee no resource use
- Never touch metadata
- Modify schema with limited service interruption
- Require a full database rebuild every time
Show correct answer and explanation
Correct answer: C. Modify schema with limited service interruption
Online changes seek to minimize downtime.
Question 148. A data dictionary contains
- Only users’ passwords
- Only the newest rows
- The operating system’s bootloader
- Descriptions of tables, columns and other database metadata
Show correct answer and explanation
Correct answer: D. Descriptions of tables, columns and other database metadata
Catalogs describe database objects and definitions.
Question 149. Statistics maintained by a query optimizer help estimate
- Cardinalities and selectivities
- User identity
- Physical monitor resolution
- Password entropy only
Show correct answer and explanation
Correct answer: A. Cardinalities and selectivities
Statistics guide cost-based plan choices.
Question 150. Cardinality of a relation means
- Its number of databases
- Its number of tuples or rows
- The size of a password
- Its disk controller count
Show correct answer and explanation
Correct answer: B. Its number of tuples or rows
In relational algebra, cardinality is the relation’s row count.
Question 151. A covering index is one that
- Always covers every table
- Stores the transaction log
- Contains data needed to satisfy a query without fetching certain base rows
- Never needs maintenance
Show correct answer and explanation
Correct answer: C. Contains data needed to satisfy a query without fetching certain base rows
Included key and payload columns can make index-only access possible under DBMS rules.
Question 152. A composite index on (a,b) commonly helps queries filtering by
- Only b under every plan
- Neither a nor b
- A column absent from the index
- The leading key a and sometimes both a and b
Show correct answer and explanation
Correct answer: D. The leading key a and sometimes both a and b
Leading-key order often influences index access.
Question 153. The leftmost-prefix principle refers to
- How ordered composite indexes are efficiently searchable by initial key columns
- The leftmost SQL keyword
- The first table in memory
- The oldest transaction only
Show correct answer and explanation
Correct answer: A. How ordered composite indexes are efficiently searchable by initial key columns
An index ordered by (a,b) generally supports predicates using a as its prefix.
Question 154. An execution plan’s estimated row count may differ from actual because
- SQL prohibits counting rows
- Statistics and assumptions may be imperfect
- All indexes are corrupt
- The optimizer never samples data
Show correct answer and explanation
Correct answer: B. Statistics and assumptions may be imperfect
Cardinality estimation is predictive rather than exact.
Question 155. What is an index seek?
- Reading every row without an index
- Deleting an index
- Navigating an index toward matching key entries
- Rebuilding a log
Show correct answer and explanation
Correct answer: C. Navigating an index toward matching key entries
A seek uses searchable key conditions to access index regions.
Question 156. Which operation is an aggregation?
- Deleting a column
- Changing a password
- Creating an operating-system process
- Computing SUM of sales grouped by region
Show correct answer and explanation
Correct answer: D. Computing SUM of sales grouped by region
Aggregation summarizes groups or entire result sets.
Question 157. A window function differs from ordinary GROUP BY aggregation because it can
- Calculate over related rows while retaining individual output rows
- Only insert new rows
- Delete duplicate source data
- Prevent all sorting
Show correct answer and explanation
Correct answer: A. Calculate over related rows while retaining individual output rows
Window functions compute analytical values without necessarily collapsing rows.
Question 158. ROW_NUMBER() with an OVER clause typically
- Counts physical database files
- Assigns sequential row numbers within a defined window order
- Guarantees a permanent primary key
- Drops duplicate rows automatically
Show correct answer and explanation
Correct answer: B. Assigns sequential row numbers within a defined window order
ROW_NUMBER numbers rows according to the specified partition and ordering.
Question 159. PARTITION BY in a window specification
- Physically partitions every table
- Creates disk volumes
- Separates rows into groups for window calculation
- Commits a transaction
Show correct answer and explanation
Correct answer: C. Separates rows into groups for window calculation
Window partitions define independent calculation groups.
Question 160. A common table expression is introduced by
- HAVING
- VACUUM
- REVOKE
- WITH
Show correct answer and explanation
Correct answer: D. WITH
A WITH clause defines query-scoped named subqueries.
Database Systems MCQs — Set 6 (Questions 161–200)
Read each question and reveal its correct answer and explanation.
Question 161. A recursive common table expression is useful for
- Traversing hierarchies or repeatedly expanding results
- Encrypting every transaction
- Creating only physical partitions
- Setting CPU affinity
Show correct answer and explanation
Correct answer: A. Traversing hierarchies or repeatedly expanding results
Recursive CTEs repeatedly evaluate a recursive term until no additional results arise.
Question 162. What does COALESCE(a,b) return?
- Always b
- The first non-NULL argument among a and b
- Always a even when NULL
- The sum of a and b
Show correct answer and explanation
Correct answer: B. The first non-NULL argument among a and b
COALESCE selects the first non-NULL expression.
Question 163. NULLIF(a,b) returns NULL when
- a differs from b
- a is always positive
- a equals b under SQL comparison semantics
- b is a primary key
Show correct answer and explanation
Correct answer: C. a equals b under SQL comparison semantics
NULLIF yields NULL if the two arguments compare equal.
Question 164. Which SQL expression handles conditional values?
- DROP
- VACUUM
- REINDEX
- CASE
Show correct answer and explanation
Correct answer: D. CASE
CASE evaluates conditions and chooses corresponding result expressions.
Question 165. What is a stored procedure?
- A database-resident program or routine invoked to perform operations
- A physical disk sector
- A query result row
- A mandatory primary key
Show correct answer and explanation
Correct answer: A. A database-resident program or routine invoked to perform operations
Stored procedures encapsulate data-related program logic.
Question 166. A database trigger is typically
- A client-only display format
- A routine automatically invoked by specified database events
- A filesystem mount point
- A column data type
Show correct answer and explanation
Correct answer: B. A routine automatically invoked by specified database events
Triggers respond to events such as insertion or updates.
Question 167. An AFTER INSERT trigger usually runs
- Before the table exists
- Only at server boot
- After the initiating INSERT event under the DBMS trigger semantics
- Only when a SELECT executes
Show correct answer and explanation
Correct answer: C. After the initiating INSERT event under the DBMS trigger semantics
Trigger timing specifies when the routine executes relative to the data operation.
Question 168. Why should triggers be used carefully?
- They eliminate all transaction errors
- They are always faster than queries
- They make constraints unnecessary
- Their implicit side effects can complicate reasoning and performance
Show correct answer and explanation
Correct answer: D. Their implicit side effects can complicate reasoning and performance
Hidden execution and cascading actions can be difficult to trace.
Question 169. A cursor in database programming supports
- Iterating through a query result
- Storing only images
- Erasing all rows
- Creating OS threads
Show correct answer and explanation
Correct answer: A. Iterating through a query result
Cursors provide controlled traversal of results.
Question 170. Prepared statements help prevent SQL injection when
- User input is inserted into query strings
- Untrusted values are passed as bound parameters rather than concatenated into SQL text
- All input validation is skipped
- Database permissions are removed
Show correct answer and explanation
Correct answer: B. Untrusted values are passed as bound parameters rather than concatenated into SQL text
Parameter binding separates data values from SQL syntax.
Question 171. SQL injection exploits
- An excessive CPU temperature
- A slow B-tree
- Untrusted input interpreted as part of an SQL command
- A failed hard disk
Show correct answer and explanation
Correct answer: C. Untrusted input interpreted as part of an SQL command
String construction can allow attacker input to alter intended query structure.
Question 172. Which database privilege grants permission to read table rows?
- INSERT
- UPDATE
- DELETE
- SELECT
Show correct answer and explanation
Correct answer: D. SELECT
SELECT privilege authorizes reading according to access rules.
Question 173. The GRANT statement is used to
- Assign database privileges
- Remove every table
- Start a transaction
- Compute an average
Show correct answer and explanation
Correct answer: A. Assign database privileges
GRANT gives specified permissions to users or roles.
Question 174. The REVOKE statement is used to
- Add a primary key automatically
- Withdraw specified privileges
- Read transaction logs
- Create backups
Show correct answer and explanation
Correct answer: B. Withdraw specified privileges
REVOKE removes privilege grants subject to DBMS semantics.
Question 175. A role in database access control is
- A database page size
- A join type
- A named collection or principal for permissions
- A SQL value type
Show correct answer and explanation
Correct answer: C. A named collection or principal for permissions
Roles simplify permission administration.
Question 176. Row-level security is used to
- Change all data types
- Eliminate all indexes
- Automatically compress text
- Restrict which rows a user or role can see or modify
Show correct answer and explanation
Correct answer: D. Restrict which rows a user or role can see or modify
Policies can filter accessible records according to identity.
Question 177. Encryption at rest protects
- Stored data against certain unauthorized storage access
- Every query from logical errors
- All application accounts automatically
- Availability after power failure
Show correct answer and explanation
Correct answer: A. Stored data against certain unauthorized storage access
At-rest encryption helps protect persisted bytes.
Question 178. Encryption in transit typically protects
- Only database backups
- Data sent between clients and servers over networks
- CPU caches
- Row order
Show correct answer and explanation
Correct answer: B. Data sent between clients and servers over networks
Transport encryption secures communication against eavesdropping and tampering.
Question 179. What is database auditing?
- Sorting every result
- Erasing transaction logs
- Recording and reviewing selected database activities
- Changing query syntax
Show correct answer and explanation
Correct answer: C. Recording and reviewing selected database activities
Audit trails support accountability and incident investigations.
Question 180. A SQL transaction’s savepoint allows
- Permanent commit of only one row outside a transaction
- Automatic replication to all servers
- Removal of every constraint
- Partial rollback to a named point within the current transaction
Show correct answer and explanation
Correct answer: D. Partial rollback to a named point within the current transaction
SAVEPOINT marks a recoverable position for transaction rollback.
Question 181. ROLLBACK TO SAVEPOINT generally
- Undoes changes after the named savepoint while keeping the transaction active
- Drops all tables
- Commits the entire transaction
- Disables logging
Show correct answer and explanation
Correct answer: A. Undoes changes after the named savepoint while keeping the transaction active
It reverts later transactional work without necessarily ending the transaction.
Question 182. A read replica is commonly used to
- Replace primary-key constraints
- Serve selected reads using replicated data
- Run only schema migrations
- Prevent all stale reads
Show correct answer and explanation
Correct answer: B. Serve selected reads using replicated data
Read replicas can spread read workloads, subject to replication lag.
Question 183. Point-in-time recovery aims to
- Always restore only the oldest backup
- Delete logs permanently
- Restore a database to a chosen recoverable instant
- Remove every user account
Show correct answer and explanation
Correct answer: C. Restore a database to a chosen recoverable instant
Backups and logs can reconstruct state at a selected time.
Question 184. RPO stands for
- Read Performance Option
- Relational Partition Order
- Replica Processing Output
- Recovery Point Objective
Show correct answer and explanation
Correct answer: D. Recovery Point Objective
RPO specifies acceptable potential data loss measured in time.
Question 185. RTO stands for
- Recovery Time Objective
- Row Transaction Order
- Relational Table Offset
- Recovery Transfer Option
Show correct answer and explanation
Correct answer: A. Recovery Time Objective
RTO specifies the target duration to restore service.
Question 186. A lower RPO target generally requires
- Less attention to backups
- More frequent or continuous protection of data changes
- No transaction logs
- Fewer restore tests
Show correct answer and explanation
Correct answer: B. More frequent or continuous protection of data changes
Less acceptable data loss requires more up-to-date recoverable data.
Question 187. Backups stored offsite can help protect against
- Only SQL syntax errors
- Only slow index scans
- A site-wide loss affecting local systems
- Only missing aliases
Show correct answer and explanation
Correct answer: C. A site-wide loss affecting local systems
Geographically separate copies reduce correlated-loss risk.
Question 188. A database connection pool helps
- Eliminate authentication entirely
- Guarantee no deadlocks
- Store query results permanently
- Reuse established database connections for multiple application requests
Show correct answer and explanation
Correct answer: D. Reuse established database connections for multiple application requests
Pooling reduces repeated connection setup costs.
Question 189. Connection leaks can cause
- Exhaustion of available database connections
- Automatic data normalization
- Guaranteed index efficiency
- A reduction in server load always
Show correct answer and explanation
Correct answer: A. Exhaustion of available database connections
Connections not returned to pools can exhaust capacity.
Question 190. A hot spot in a sharded database occurs when
- All shards have equal workload
- A small subset of partitions receives disproportionately heavy traffic
- No node has data
- Only a backup is running
Show correct answer and explanation
Correct answer: B. A small subset of partitions receives disproportionately heavy traffic
Skewed partition keys can overload particular shards.
Question 191. A poor shard key can cause
- Automatic BCNF
- Perfect replica consistency
- Uneven data distribution and query load
- Removal of network traffic
Show correct answer and explanation
Correct answer: C. Uneven data distribution and query load
Shard selection strongly affects balance and access patterns.
Question 192. Consistent hashing is useful for
- Guaranteeing transaction serializability
- Replacing SQL joins
- Encrypting all values
- Distributing keys while limiting reassignment when nodes change
Show correct answer and explanation
Correct answer: D. Distributing keys while limiting reassignment when nodes change
Consistent hashing reduces the proportion of remapped keys under changes.
Question 193. Which workload is characterized by many short transactional operations?
- OLTP
- OLAP
- Offline archiving only
- Batch file compression only
Show correct answer and explanation
Correct answer: A. OLTP
Online transaction processing emphasizes frequent small reads and writes.
Question 194. Which workload typically emphasizes analytical scans and aggregations?
- OLTP only
- OLAP
- Device-driver scheduling
- Socket polling
Show correct answer and explanation
Correct answer: B. OLAP
Online analytical processing studies large datasets across dimensions.
Question 195. A data warehouse is primarily designed for
- Running only kernel interrupts
- Storing no historical information
- Integrating data for analytical queries and reporting
- Replacing all source applications
Show correct answer and explanation
Correct answer: C. Integrating data for analytical queries and reporting
Warehouses commonly support decision-making analytics.
Question 196. A star schema in data warehousing usually has
- Only one table with no keys
- A cyclic inheritance hierarchy
- Only graph edges
- A central fact table linked to dimension tables
Show correct answer and explanation
Correct answer: D. A central fact table linked to dimension tables
Star schemas organize measures and descriptive dimensions.
Question 197. A fact table in a star schema usually stores
- Measurements and keys to relevant dimensions
- Only user passwords
- Only procedure source code
- Only indexes
Show correct answer and explanation
Correct answer: A. Measurements and keys to relevant dimensions
Facts capture events and quantitative measures for analysis.
Question 198. A dimension table generally stores
- Only transaction log records
- Descriptive context such as product or date attributes
- Physical disk tracks
- Uncommitted row versions only
Show correct answer and explanation
Correct answer: B. Descriptive context such as product or date attributes
Dimensions describe entities used to slice and filter facts.
Question 199. ETL stands for
- Encrypt, Transfer, Lock
- Evaluate, Test, Log
- Extract, Transform, Load
- Export, Trigger, Link
Show correct answer and explanation
Correct answer: C. Extract, Transform, Load
ETL processes source data before loading it into a target system.
Question 200. ELT differs from ETL because transformation typically occurs
- Before extraction starts
- Only on a client keyboard
- Without any storage
- After loading source data into a target platform
Show correct answer and explanation
Correct answer: D. After loading source data into a target platform
ELT loads first and uses target compute for transformations.
