DBMS quiz

Relational models, keys, normalization, indexing, transactions and concurrency.

42 questionsInstant feedbackFree

Set up your quiz

Difficulty
Number of questions

Tip: press 1–4 to answer and Enter for the next question.

All 42 questions with answers
  1. What does DBMS stand for?

    • Digital Base Memory System
    • Data Building Model System
    • Data Backup Management Software
    • Database Management System (correct)
  2. Which of these is a relational database?

    • PostgreSQL (correct)
    • Cassandra
    • Redis
    • MongoDB
  3. In a relational database, data is stored in:

    • Documents only
    • Folders
    • Spreadsheets
    • Tables (correct)
  4. What is a column in a table also called?

    • A tuple
    • A record
    • A relation
    • An attribute or field (correct)
  5. What is a schema?

    • A backup file
    • A row in a table
    • A type of query
    • The structure of a database: its tables, columns and relationships (correct)
  6. What is redundancy in a database?

    • The same data stored in more than one place (correct)
    • Fast queries
    • Encrypted data
    • Deleted data
  7. What does an ER diagram show?

    • Server load
    • Network cables
    • Entities, their attributes and relationships (correct)
    • Query results
  8. Which is a NoSQL database type?

    • Flat file only
    • Document store (correct)
    • Spreadsheet
    • Relational table
  9. Which language is used to query relational databases?

    • HTML
    • XML
    • CSS
    • SQL (correct)
  10. What is a tuple in relational terminology?

    • A row (correct)
    • A table
    • A key
    • A column
  11. What is the main goal of database normalization?

    • Making all values lowercase
    • Organizing tables to reduce redundancy and update anomalies (correct)
    • Backing up a database
    • Adding indexes
  12. A table is in First Normal Form (1NF) when:

    • It has a primary key only
    • Every column holds atomic values and there are no repeating groups (correct)
    • It has no foreign keys
    • It has fewer than 10 columns
  13. A table in 2NF must also have:

    • No NULL values
    • No foreign keys
    • No partial dependency of non-key columns on part of a composite key (correct)
    • Only one column
  14. 3NF removes which kind of dependency?

    • Transitive dependency of non-key columns on other non-key columns (correct)
    • Partial dependency only
    • Foreign key dependency
    • Multi-valued dependency
  15. What is a candidate key?

    • A foreign key
    • A key that might be deleted
    • A minimal set of columns that can uniquely identify a row (correct)
    • Any column with numbers
  16. What is a super key?

    • The largest key
    • Any set of columns that uniquely identifies a row (correct)
    • A key across databases
    • A key used by the admin
  17. What is a one-to-many relationship?

    • Two tables with the same rows
    • One row in a table relates to many rows in another (correct)
    • A table with one column
    • Every row relates to every row
  18. How is a many-to-many relationship usually implemented?

    • With a view
    • With one foreign key
    • With an index
    • With a junction table holding two foreign keys (correct)
  19. What is referential integrity?

    • Backups are verified
    • All data is encrypted
    • Foreign keys always point to existing rows (correct)
    • Every table has an index
  20. What is a weak entity?

    • An entity with no relationships
    • An entity that cannot be identified without a related strong entity (correct)
    • An entity with few rows
    • A deleted entity
  21. What is data independence?

    • Changing storage or schema at one level without affecting higher levels (correct)
    • Data without a type
    • Data with no relationships
    • Data stored on separate servers
  22. What is a deadlock in a database?

    • Two transactions each waiting for a lock held by the other (correct)
    • A crashed server
    • A full disk
    • A failed backup
  23. What is the purpose of a lock in a database?

    • To control concurrent access to data (correct)
    • To speed up SELECTs
    • To encrypt data
    • To delete old data
  24. What is a B-tree index?

    • A balanced tree structure that keeps keys sorted for fast search (correct)
    • A list of backups
    • A binary tree with two keys
    • A hash table
  25. Which index type is best for exact equality lookups but not ranges?

    • Hash index (correct)
    • B-tree index
    • Bitmap only
    • Full-text index
  26. What is BCNF?

    • A query language
    • A NoSQL model
    • A backup format
    • A stricter 3NF where every determinant is a candidate key (correct)
  27. What is a functional dependency A → B?

    • B is computed by a function of A at runtime
    • Each value of A determines exactly one value of B (correct)
    • A and B are in different tables
    • A is a foreign key to B
  28. What does write-ahead logging (WAL) ensure?

    • Queries run faster
    • Logs are deleted before writes
    • Changes are logged before being applied, so the database can recover after a crash (correct)
    • Writes happen in alphabetical order
  29. What is two-phase locking?

    • Locking reads and writes separately
    • Locking a table twice
    • Using two databases
    • Transactions acquire all locks before releasing any, ensuring serializability (correct)
  30. What is a phantom read?

    • Reading a deleted row
    • A query returns new rows that another transaction inserted between two reads (correct)
    • Reading data from cache
    • Reading uncommitted data
  31. What does denormalization trade for faster reads?

    • Fewer tables to query only
    • Extra redundancy and more complex updates (correct)
    • Smaller storage
    • Data integrity is removed entirely
  32. What is a clustered index?

    • An index on several servers
    • An index that defines the physical order of rows in the table (correct)
    • An index stored in memory only
    • An index with duplicate keys
  33. What is MVCC (multi-version concurrency control)?

    • Storing multiple backups
    • Versioning the schema
    • Running several database servers
    • Keeping several versions of rows so readers do not block writers (correct)
  34. What is the main idea of the CAP theorem for distributed databases?

    • It only applies to SQL databases
    • It is about CPU, API and Performance
    • During a network partition you must choose between consistency and availability (correct)
    • You can always have all three guarantees
  35. What is horizontal partitioning (sharding)?

    • Copying a table to a backup
    • Splitting rows of a table across several databases (correct)
    • Splitting columns into separate tables
    • Indexing every column
  36. Which of these is NOT a DBMS?

    • Oracle Database
    • MySQL
    • Microsoft Word (correct)
    • SQLite
  37. What is a primary key's main job?

    • Linking to another database server
    • Sorting rows alphabetically
    • Encrypting the table
    • Uniquely identifying each row in a table (correct)
  38. What is a DDL command?

    • A command that reads data, such as SELECT
    • A command that ends a transaction
    • A command that defines structure, such as CREATE or ALTER (correct)
    • A command that controls access, such as GRANT
  39. Which of these is a DML command?

    • GRANT
    • DROP
    • INSERT (correct)
    • CREATE
  40. What does the GRANT command do?

    • Creates a new table
    • Backs up the database
    • Deletes a user
    • Gives a user permissions on database objects (correct)
  41. What is a database trigger?

    • A type of index
    • A scheduled backup
    • A user account
    • Code that runs automatically when a specified event occurs on a table (correct)
  42. What is a stored procedure?

    • A backup procedure
    • An index rebuild
    • A cached query result
    • A saved set of SQL statements that runs on the database server (correct)