StudyFox
कीमतेंब्लॉगएक्सटेंशनमुफ़्त टूल
  • कीमतें
  • ब्लॉग
  • एक्सटेंशन
  • मुफ़्त टूल
  • शुरू करेंसाइन इन
StudyFox

अपने नोट्स, PDF और स्लाइड्स को फ़्लैशकार्ड, क्विज़, नोट्स और माइंड मैप में बदलें।

StudyFox खोलें

स्टडी टूल्स

  • होमवर्क हेल्पर
  • नोट मेकर
  • फ़्लैशकार्ड मेकर
  • क्विज़ मेकर
  • माइंड मैप मेकर

प्रोडक्ट

  • कीमतें
  • Chrome एक्सटेंशन
  • मुफ़्त एक्सटेंशन
  • स्टडी सेट देखें
  • ब्लॉग

सहायता

  • सहायता केंद्र
  • संपर्क करें
  • गोपनीयता नीति
  • सेवा की शर्तें

तुलना करें

  • Chegg का विकल्प
  • Course Hero का विकल्प
  • Coursology का विकल्प
  • Photomath का विकल्प
  • Gauthmath का विकल्प
  • PhotoSolve का विकल्प
  • CollegeTools का विकल्प
  • Transcript का विकल्प
  • SmartSolve का विकल्प
  • Homeworkify का विकल्प
  • AnswersAi का विकल्प
  • StudyX का विकल्प
  • Quizlet का विकल्प
  • Anki का विकल्प
  • Knowt का विकल्प
  • Brainscape का विकल्प
  • सभी तुलनाएँ

© 2026 StudyFox AI. सर्वाधिकार सुरक्षित।

  • X
  • Discord
  • Instagram
ExploreEngineering & TechComputer ScienceDatabases Quiz: Transactions, Indexes and Design

Quiz · Hard

Databases Quiz: Transactions, Indexes and Design

Isolation anomalies, ACID, B-tree and index behaviour, normal forms and distributed trade-offs.

by Kill h.20 questionsCreated Nov 20, 2026, 08:27 PM
Computer Science· DatabasesTags#transactions#indexes#normalization#computer-science#databases

20 questions

  1. 1

    Which ACID property guarantees that a committed transaction survives a power failure?

    • A

      Atomicity

    • B

      Consistency

    • C

      Isolation

    • Durability

    Durability is usually implemented with a write-ahead log flushed to stable storage before commit is acknowledged.

  2. 2

    The diagram shows the four ACID properties. A transfer of 100 from account A to B leaves total money unchanged after commit. Which property is this primarily about?

    • A

      Atomicity

    • Consistency

    • C

      Isolation

    • D

      Durability

    Consistency means the transaction moves the database from one valid state (total balance preserved) to another.

  3. 3

    Transaction T1 reads a row. T2 updates it and commits. T1 reads it again and sees a new value. What is this anomaly?

    • A

      Dirty read

    • Non-repeatable read

    • C

      Phantom read

    • D

      Lost update

    The same row returned different committed values within one transaction: a non-repeatable read.

  4. 4

    T1 runs SELECT COUNT(*) WHERE dept = 5 twice. Between the runs T2 inserts a matching row and commits. T1's second count is higher. What is this?

    • A

      Dirty read

    • B

      Non-repeatable read

    • Phantom read

    • D

      Deadlock

    A new row appearing in a range query result is a phantom read.

  5. 5

    Which isolation level allows dirty reads?

    • READ UNCOMMITTED

    • B

      READ COMMITTED

    • C

      REPEATABLE READ

    • D

      SERIALIZABLE

    READ UNCOMMITTED is the only standard level that permits reading uncommitted changes.

  6. 6

    What is a deadlock?

    • A

      A transaction that runs too long

    • Two or more transactions each waiting for locks the others hold

    • C

      A disk failure during commit

    • D

      A query without an index

    Neither can proceed, so the DBMS picks a victim and rolls it back.

  7. 7

    What is the main advantage of MVCC?

    • A

      It removes the need for indexes

    • Readers do not block writers and writers do not block readers

    • C

      It guarantees serializability without cost

    • D

      It stores only one version of each row

    Readers use a snapshot of older row versions, so reads and writes rarely block each other.

  8. 8

    Why do relational databases usually use B+ trees for indexes?

    • A

      They need no disk access

    • They are balanced, shallow with high fanout and keep linked leaves for range scans

    • C

      They only support equality

    • D

      They store rows unsorted

    A fanout of hundreds keeps trees only 3 to 4 levels deep, and the linked leaves make range queries efficient.

  9. 9

    In the B-tree shown, which child is searched for the key 18?

    • A

      Left child

    • B

      Middle child

    • Right child

    • D

      The root only

    18 is greater than 16, the root's largest key, so the search follows the right pointer (keys 18 and 21).

  10. 10

    Given an index on (last_name, first_name), which query can use it most effectively?

    • A

      WHERE first_name = 'Ann'

    • WHERE last_name = 'Lee' AND first_name = 'Ann'

    • C

      WHERE first_name LIKE '%n'

    • D

      WHERE LOWER(first_name) = 'ann'

    The leftmost prefix rule: the index is ordered by last_name first, so filters must start with that column.

  11. 11

    A query needs only columns that are all stored in one index. What is that index called relative to the query?

    • A

      Clustered

    • Covering

    • C

      Hash

    • D

      Sparse

    A covering index lets the database answer from the index alone with no table lookups.

  12. 12

    Which index type cannot support range queries?

    • A

      B+ tree

    • Hash index

    • C

      Composite B-tree

    • D

      Clustered index

    Hashing destroys ordering, so only equality lookups work.

  13. 13

    A table is in 2NF but the attribute dept_name depends on dept_id, which depends on emp_id (the key). Which normal form is violated?

    • A

      1NF

    • B

      2NF

    • 3NF

    • D

      None

    A non-key attribute depending on another non-key attribute is a transitive dependency, which 3NF forbids.

  14. 14

    Which table is in violation of 1NF?

    • A table where phone_numbers holds the text '555-1,555-2'

    • B

      A table with a composite primary key

    • C

      A table with a foreign key

    • D

      A table with an index

    A cell must hold a single atomic value; a list in one column breaks 1NF.

  15. 15

    The diagram shows an Orders table split from Customers. What is the main benefit?

    • A

      Fewer tables

    • Customer data is stored once, removing update anomalies

    • C

      Faster inserts of orders without joins

    • D

      The foreign key becomes unnecessary

    With names and cities in Customers only, a change is made in one row instead of many orders.

  16. 16

    Which situation is the best reason to denormalize?

    • A

      Saving a few kilobytes

    • Read-heavy reporting where joins are the bottleneck

    • C

      Frequent updates to the duplicated column

    • D

      Teaching a database course

    Denormalization trades redundancy for read speed. It hurts when duplicated data changes often.

  17. 17

    What does the CAP theorem say a distributed system must give up during a network partition?

    • Either consistency or availability

    • B

      Partition tolerance

    • C

      Durability

    • D

      Both consistency and availability always

    When a partition occurs you must choose between returning possibly stale data (availability) and refusing requests (consistency).

  18. 18

    Which NoSQL family is Redis most commonly classified under?

    • A

      Document

    • Key-value

    • C

      Graph

    • D

      Wide-column

    Redis stores values (strings, hashes, lists, sets) under keys.

  19. 19

    Which database type is best suited for traversing relationships such as friends-of-friends?

    • A

      Key-value store

    • Graph database

    • C

      Time-series database

    • D

      Plain CSV files

    Graph databases (for example Neo4j) store relationships natively and make multi-hop traversals efficient.

  20. 20

    Which is a typical sign of the N+1 query problem?

    • A

      One slow query with a missing index

    • One query for a list, then one extra query per item

    • C

      A deadlock

    • D

      A full table backup

    Fix it by joining or batching the child lookups.