Database Administrator question bank
100 questions. Filter by level and skill, track what you've solved, and see how many people get each one right.
- Purpose of a primary key
- Third normal form
- When a B-tree index helps
- Durability in ACID
- INNER JOIN vs LEFT JOIN
- Full vs incremental backup
- Least privilege for an app user
- DELETE vs TRUNCATE
- Filtering rows where a value is NULL
- COUNT(*) vs COUNT(column)
- What a foreign key enforces
- WHERE vs HAVING
- Data type for money
- Stopping SQL injection
- Logical vs physical backup
- Proving backups work
- RPO and RTO
- Why a write-ahead log exists
- Read-only access for analysts
- What pg_hba.conf controls
- View vs materialized view
- What ROLLBACK undoes
- UNION vs UNION ALL
- Row order without ORDER BY
- Why add a read replica
- Seeing what is running now
- Cancel or terminate a session
- Why InnoDB over MyISAM
- Gaps in auto-increment IDs
- Storing event times
- Rejecting bad values
- FATAL: too many clients
- Finding slow MySQL queries
- Encrypting client connections
- Composite index column order
- Reading an EXPLAIN ANALYZE plan
- Non-repeatable read
- Why PostgreSQL needs VACUUM
- What PITR needs
- Risk of asynchronous replication
- Why use a connection pooler
- Covering index
- Slow deep pagination
- Which query to tune first
- NOT IN returns nothing
- UNIQUE column with NULLs
- Adding an index on a live table
- Sort Method: external merge
- Bad plan right after a bulk load
- Sizing shared_buffers
- Session state behind pgBouncer
- Workers fighting over jobs
- MySQL default isolation level
- Measuring replica lag
- Reports cancelled on the replica
- Is pg_dump consistent?
- Restoring a Percona XtraBackup
- Deleting a customer takes seconds
- Disk not freed after a big delete
- Bloat from an idle session
- A migration froze the whole app
- Indexing only pending rows
- Searching inside text
- Fast JSONB filters
- Row vs statement binlog format
- Multi-AZ vs read replica on RDS
- Terraform plan wants to replace the DB
- Counting a huge table quickly
- Fixing a recurring deadlock
- Transaction ID wraparound
- Partition pruning
- Choosing a shard key
- Index ignored because of a function
- InnoDB gap locks
- Avoiding split-brain
- Disk filling with WAL
- Two doctors go off call
- Commits hang with sync replication
- Prepared statement slows down later
- Estimates wrong for city and zip code
- Index-only scan still reads the table
- Logical replication stopped after a migration
- pg_upgrade --link and rollback
- pg_wal growing without limit
- Errant GTIDs block failover
- Online schema change tools for MySQL
- Unique email on a partitioned table
- Deleting old data every month
- Primary demoted when etcd is unreachable
- WAL volume spikes after checkpoints
- What encryption at rest protects
- Row-level security not applied
- Risky SECURITY DEFINER function
- Indexes bloat on a counter table
- Random UUID keys slow down inserts
- Rejoining the old primary
- OOM killer after raising work_mem
- Restore takes longer than the RTO
- Locks held by nobody
- Faster commits with a durability cost