All questions
Showing of 39What is a database and what are the advantages of using a database management system (DBMS)?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
A database is an organized collection of structured data stored electronically. A database management system (DBMS) is the software that stores, retrieves and manages that data.
Its advantages:
- Data independence, so applications don't depend on how the data is stored.
- Integrity, because constraints keep the data accurate and consistent.
- Security through access control and authentication.
- Concurrent access by many users at the same time.
- Built-in backup and recovery.
- Less redundancy, with duplicate data kept to a minimum.
- Central control of every data operation.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is the difference between DDL, DML, DCL, and TCL?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
These four categories group SQL commands by what they act on. Data Definition Language (DDL) defines the structure of the database, such as its tables. Data Manipulation Language (DML) reads and changes the rows in those tables. Data Control Language (DCL) grants and revokes access, and Transaction Control Language (TCL) manages transactions.
| Group | What it does | Commands | Example |
|---|---|---|---|
| DDL | Defines the database structure | CREATE, ALTER, DROP, TRUNCATE |
CREATE TABLE users (id INT PRIMARY KEY, name VARCHAR(50)); |
| DML | Manipulates data within tables | SELECT, INSERT, UPDATE, DELETE |
INSERT INTO users (id, name) VALUES (1, 'John'); |
| DCL | Controls access to data | GRANT, REVOKE |
GRANT SELECT ON users TO user_role; |
| TCL | Manages transactions | COMMIT, ROLLBACK, SAVEPOINT |
COMMIT; or ROLLBACK; |
COMMIT makes a transaction's changes permanent and ROLLBACK undoes them. SAVEPOINT marks a point inside the transaction that you can roll back to.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is an Entity-Relationship (ER) model and what are its components?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
An Entity-Relationship (ER) model is a conceptual data model that describes the structure of a database as entities, attributes and relationships. Its components are:
- An entity is a real-world object or concept, drawn as a rectangle, such as a Customer, Product or Order.
- An attribute is a property of an entity, drawn as an oval, like a Customer's
CustomerID,NameandEmail. - A relationship is an association between entities, drawn as a diamond, such as a Customer that "places" an Order.
- Cardinality is how many instances of one entity can link to another. A user and their profile are one-to-one, or 1:1. A customer and their orders are one-to-many, or 1:M. Students and courses are many-to-many, or M:N.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is normalization and why is it important?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Normalization is the process of organizing a database to reduce redundancy and improve data integrity. You decompose large tables into smaller, well-structured ones and define the relationships between them, so each fact is stored once.
It matters because:
- Removing duplicate data saves storage and removes copies that could disagree.
- It prevents update anomalies, because a change is made in only one place.
- Data integrity improves, with fewer chances of inconsistent data.
- The structure is easier to maintain and modify.
The cost is more tables to manage and more JOINs in queries, which can slow reads.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
Explain different types of keys in a database.
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Most types of key identify the rows of a table, and a foreign key links one table to another. Each is a column or a set of columns.
- A primary key uniquely identifies each row, so it is unique and never
NULL, likeCustomerIDinCustomer. - A candidate key is any minimal column or combination that could be the primary key. It is unique and not
NULL, and a table can have several. The ones not chosen are alternate keys. - A super key is any set of columns that uniquely identifies a row, such as the primary key plus extra columns.
- A composite key is a primary key of several columns, like
(OrderID, ProductID)inOrderDetails. - A foreign key references another table's primary key to create a relationship, like
CustomerIDinOrder. It can beNULLunless constrained. - A unique key enforces uniqueness but allows
NULL. PostgreSQL allows manyNULLvalues by default, while SQL Server allows one.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What are the different types of relationships in databases?
What are database indexes and how do they improve performance?
What are database constraints and how do they ensure data integrity?
Explain the concept of database views and their advantages.
Explain the ACID properties of a transaction and why they matter.
Explain the difference between OLTP and OLAP systems.
How do you convert an ER diagram to a relational model?
What is a database schema, and what is the three-level architecture?
Explain the different normal forms (1NF, 2NF, 3NF, BCNF).
When would you consider denormalization?
What is referential integrity and how is it maintained?
When should you create an index and when should you avoid it?
Explain query optimization techniques.
What are database transactions and isolation levels?
Explain deadlocks and how to prevent them.
What is the difference between optimistic and pessimistic locking?
When would you choose NoSQL over relational databases?
What are materialized views and when would you use them?
Explain database connection pooling and its benefits.
What are database triggers and when should you use them?
Explain database backup and recovery strategies.
What is data modeling and what are the different approaches?
Explain database security best practices.
What are Common Table Expressions (CTEs) and when are they useful?
What is the difference between a natural key and a surrogate key?
What is the difference between a star schema and a snowflake schema?
Does column order matter in a composite index?
How would you design a database schema for an e-commerce application?
What is database partitioning and when is it useful?
How does database partitioning differ from sharding?
Explain CAP theorem and its implications for database design.
What is database sharding and what are its challenges?
Explain database replication strategies.
Explain MVCC (Multi-Version Concurrency Control) and its benefits.
This answer is part of Pro.
The full written answer, with the trade-offs and follow-ups an interviewer will probe.
No matches
Try a different filter or search term.
Database Design cheatsheet
- DBMS, SQL & schema01
- Model the data02
- Keys & constraints03
- Normalize & denormalize04
- Indexes & query speed05
- Transactions & locking06
- Views, CTEs & triggers07
- OLTP, OLAP & warehouses08
- Scaling, CAP & NoSQL09
- Pools, backups & security10
- The model11
- + 5 more inside
34 of 39 Database Design answers are in Pro.
Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.
- Full answers + code
- AI explanations, simpler or deeper
- 1,000 AI credits / month
- Cancel anytime
Change topic
Pick a different technology or stack. Your current topic stays put until you choose a new one.
MEAN
MongoDB, Express, Angular, Node.jsMERN
MongoDB, Express, React, Node.jsDjango
Python Full-Stack DevelopmentRuby on Rails
Convention over ConfigurationServerless on AWS
Serverless Architecture on AWSInterviewers also test these - they're common to every stack, whichever one you picked above.
Flutter Mobile
Flutter Cross-Platform Mobile DevelopmentInterviewers also test these - they're common to every stack, whichever one you picked above.
Spring Boot
Enterprise Java Development.NET
Microsoft EcosystemVue
Vue.js, Vite, TypeScript, Tailwind, Node.jsGo Backend
Golang, gRPC, PostgreSQL, Redis, RabbitMQInterviewers also test these - they're common to every stack, whichever one you picked above.
FastAPI
Python, FastAPI, SQLAlchemy, PostgreSQLReact Native
React, TypeScript, Redux, FirebaseiOS Native
Swift, SwiftUI, UIKit, FirebaseAndroid Native
Java, Jetpack Compose, FirebaseDevOps / Platform
Docker, Kubernetes, Terraform, CI/CDInterviewers also test these - they're common to every stack, whichever one you picked above.
AI Engineer
LLMs, RAG, Agents, EvalsAI-Powered Developer
Claude Code, Copilot, Agentic WorkflowsCore SWE Interview Prep
Data structures, algorithms, OS, concurrency, networking, gitInterviewers also test these - they're common to every stack, whichever one you picked above.
Interviewers also test these - they're common to every stack, whichever one you picked above.