A database stores structured information with rules for consistency and access. Begin with entities, keys, relationships and the operations your application requires.
Before you begin
Use a disposable practice database with fictional tables. Record the database dialect and schema; syntax and features can differ between systems.
Work through the idea
Write down what one row represents and which keys should be unique. Predict a small result by hand before running a query. Compare row counts and totals after filtering or joining. Keep null handling, duplicate keys and date boundaries explicit so that a plausible output does not hide an incorrect query.
- Identify entities and primary keys
- Model relationships explicitly
- Use transactions for related changes
Practice task
Model books, members and loans for a fictional library.
Check your result
Prevent a loan from pointing to a nonexistent member and explain transaction boundaries.
A mistake to avoid
Do not store several unrelated values in one field merely to avoid another table.
Keep a review note
Save the inputs or scenario, your reasoning and the result you checked. Explain one assumption and one case that needs more work. Revise the exercise after feedback and distinguish what you demonstrated from what remains untested.
Official reference for further study
Explore the related learning path · Choose another worksheet
