Database Design Project · Lesson 112 of 112

Database What to Learn Next

What you will learn

  • What you can now do after this course
  • How to check yourself
  • What to learn next, and in what order
  • How to keep improving

1. What you covered

Chapter You can now
1 Basics explain what a database is, and the kinds that exist
2 Tables and keys design tables with types, keys and rules
3 Relationships link tables and draw an ER diagram
4 First look at SQL read and change data with basic queries
5 Normalization remove repeated data step by step
6 Transactions keep data correct when things go wrong or overlap
7 Indexes speed up queries and read a query plan
8 Backups and security protect data from loss and attack
9 Choosing match a database kind to a problem
10 Design patterns handle history, deletion, auditing and multiple customers in one design
11 Programming features use triggers, stored routines, JSON and full-text search sensibly
12 Operations run a database: connections, maintenance, monitoring, recovery
13 Warehousing design for analysis rather than for running the shop
14 Distributed systems reason about replicas, partitions, consistency and failure
15 Project design and build a small database from a description

2. Check yourself

Try these without looking back:

  • Take a description of a library (books, members, loans) and write the requirements, the questions and the tables.
  • Say which column is each table's primary key, and where the foreign keys go.
  • Explain what a transaction is, with a transfer of money as the example.
  • Explain why you would add an index, and what it costs.
  • Say which database kind you would pick for login sessions, and why.

If one of these is hard, go back to that chapter; the lessons are short.

3. What would change at a larger scale

The tailor shop database is right for one shop. Here is what you would think about if the same idea grew into, say, a chain of hundreds of shops with a web shop. Each point names the chapter that explains it:

Growth New question Where
Prices and customer details change, and old facts must stay findable keep history and audit trails instead of overwriting chapter 10
Customers ask to delete their data, or staff delete by mistake soft delete, archiving and rules about what really goes chapter 10
Many shops share one system but must not see each other's data multi-tenant design chapter 10
Rules must hold no matter which program writes triggers, constraints and database-side logic chapter 11
Dozens of application servers connect at once connection pooling, monitoring, maintenance chapter 12
The business cannot stop if one machine fails high availability, recovery targets, restore drills chapter 12
Managers want yearly trends across all shops a separate analytical design (facts and dimensions) chapter 13
One server is no longer enough replication, partitioning, consistency trade-offs chapter 14

None of this is needed on day one. The skill is to know the question exists, so that you notice early when your project reaches it and do not meet it for the first time during an outage.

4. Next steps

  1. SQL in depth. This course gave a first look. The next course, SQL Basics, covers the language properly: filtering, grouping, joins, subqueries, common table expressions and window functions.
  2. One real database. Pick a database system and learn how to install it, connect, create users and back it up. The Databases subject plans courses on PostgreSQL, MySQL and MongoDB; choose by what you will use.
  3. A programming language. Learn to use a database from code. If you know Python, you have already used sqlite3; next try a different database from Python.
  4. Your own project. Pick something you really need, such as a budget, a class list or a small shop, and build it. Nothing teaches design like living with your own mistakes.

Practise on the sample databases. The Shop, Bank and School databases from chapter 4 are good places to practise what the project taught. Open a lesson of chapter 4 (for example lesson 4.1), choose a database with the Example data picker and press Tables: you see every table with its primary key, its foreign keys and its NOT NULL columns. Then redo the project's steps on a database you did not design:

  • write down five questions the database could answer, as in lesson 15.1;
  • name each table's primary key and say where the foreign keys go, as in lesson 15.2;
  • answer each question with a query, as in lesson 15.3;
  • try a change that the rules should refuse and read the error (lesson 4.6 shows how).

Reset data at the top of those lessons puts every row back, so you cannot damage anything.

5. How to keep improving

  • Design on paper first, the way lesson 15.1 did.
  • Write the questions down and test every one.
  • Try to break your rules before someone else does.
  • Practise backups and restores on a copy.
  • Read other people's designs and ask why each table exists.

Worked example: a plan for the next month

Week Do
1 Redo the tailor project from scratch without looking
2 Design a library database on paper, then build it in SQLite
3 Start the SQL course
4 Install one database system and move the library project into it

This plan is only a suggestion; adjust it to the time you have.

Common mistakes

  • Collecting courses instead of building something.
  • Jumping to a big system before you can design three clean tables.
  • Skipping the boring parts (backups, rules, testing).

Key takeaways

  • You can now design, build, query and protect a small relational database.
  • Learn SQL in depth next, then one real database system.
  • Build projects of your own; design on paper, test every rule, practise restores.

Practice

1. List the three steps of design shown in the project, and say what each produces.

Show answer

Requirements and entities (15.1) produce the requirements, questions and entity list; tables and rules (15.2) produce the CREATE TABLE statements and proof that bad rows are refused; queries, indexes and checks (15.3) produce answers to every question and a requirement-by-requirement check.

2. What is the first thing to do in any design project?

Show answer

Write the requirements and the questions the database must answer.

3. What do you learn in the SQL course that this course only previewed?

Show answer

The SQL language in depth: filtering, grouping, joins, subqueries, common table expressions and window functions.

4. Why practise restoring a backup?

Show answer

A backup you have never restored may not work; practising proves it does.

5. Design on paper the three main tables of a small library.

Show answer

For example books, members and loans (with member_id, book_id, borrowed_on, returned_on), where loans links the other two.

6. The shop grows and the owner asks for "a history of every price change". Which chapter's ideas apply, and what would you add to the design?

Show answer

Chapter 10 (history and audit tables): add a table that records each price with the date it started and ended, or one row per change, instead of overwriting garments.price. order_items.unit_price still keeps the price at ordering.