ErdDocs

ER diagram examples

11 database schemas, each rendered as an interactive ER diagram with the SQL to copy. They are not the same shop over and over: every domain teaches a different modeling pattern — find the one your assignment or your project is secretly about.

New to the notation? ER diagram explains what the boxes and line ends mean before you copy anything.

Questions before you copy one

What are the main types of database schema?

Four names come up: flat (one table, no relations), hierarchical (a strict parent-child tree), network (a record may have several parents) and relational (tables joined by keys). Every example below is relational, because that is what PostgreSQL, MySQL, SQL Server and SQLite are — the other three are mostly history, or a way of describing document and graph databases that are not built from tables at all.

Can I use these schemas in my own project or assignment?

Yes. Each page gives the SQL in full, and it runs as written on PostgreSQL. They are teaching schemas rather than production ones: small enough to read in a sitting, and each built around one modeling decision worth copying — or worth arguing with, which is just as useful in an assignment.

How do I turn one of these into a diagram of my own database?

Replace the SQL. Export your schema with pg_dump --schema-only or mysqldump --no-data and paste it over the example — or paste a Prisma schema, DBML, Mermaid, PlantUML, or Django, SQLAlchemy, Sequelize or TypeORM models. The format is detected from what you paste, and nothing is uploaded: the parsing happens in your browser.

Which example should I start with?

The blog schema if you want every relationship type in seven tables, the e-commerce one if you need a junction table that carries its own data, and the hotel or library schema if your problem is really about time — bookings, loans and availability are where beginners most often model a query as a column.

Have your own schema instead? Paste it on the home page — same tool, your tables. Need the printable reference document, not the picture? That is the data dictionary generator.