10 ER Diagram Examples for College Projects
Most final-year and DBMS lab projects need an ER diagram, and most of them are variations of the same ten systems. Here they are, with the entities, keys and relationships examiners look for — each one opens as an editable diagram you can adapt to your own project.
ER diagrams · 2026-10-23 · 9 min read
How to read these examples
Each table is an entity. The column marked PK is its primary key (unique for every row), and a column marked FK is a foreign key that points to another table — that is how relationships are stored. A line between two tables shows the relationship, and the labels on the ends (1, N) show its cardinality: one-to-many, many-to-many and so on.
Tip: Many-to-many relationships (a student takes many courses, a course has many students) always need a third table in between — here, enrollments. Examiners check for this.
1. College management system
Departments have students and faculty; faculty teach courses; students enroll in courses and get marks. The enrollments table resolves the many-to-many relationship between students and courses.
Example: College management: departments, students, faculty, courses and enrollments.
2. Library management system
Members borrow books through loans; each loan can create a fine if it is returned late. Authors write books (one-to-many here; make it many-to-many with a book_authors table if your books have several authors).
Example: Library management: members, books, authors, loans and fines.
3. Hospital management system
Patients book appointments with doctors, doctors belong to departments, appointments produce prescriptions, and patients receive bills.
Example: Hospital management: departments, doctors, patients, appointments, prescriptions and bills.
4. E-commerce store
Customers place orders with several order items, each pointing to a product; products belong to categories; orders are shipped to one of the customer's addresses.
Example: E-commerce: customers, addresses, categories, products, orders and order items.
5. Hotel booking system
Hotels have rooms; guests make bookings for a room and a date range; each booking has one or more payments.
Example: Hotel booking: hotels, rooms, guests, bookings and payments.
6. Banking system
Customers open accounts at a branch; every deposit and withdrawal is a row in transactions; customers may also take loans.
Example: Banking: branches, customers, accounts, transactions and loans.
7–10. More systems you can open
| System | Main entities | Key relationship |
|---|---|---|
| Online exam | students, exams, questions, attempts, answers | An attempt has many answers |
| Payroll | employees, departments, salaries, attendance, payslips | An employee has a payslip per month |
| Food delivery | customers, restaurants, menu items, orders, delivery partners | An order is delivered by one partner |
| Blog | users, posts, comments, tags, post_tags | Posts and tags are many-to-many |
All four are in the ER templates: open a new ER Diagram board and pick the template, or ask the AI to adapt one to your project.
Checklist before you submit
- Every table has a primary key.
- Every relationship is stored with a foreign key on the "many" side.
- Many-to-many relationships have a junction table.
- Names are consistent: singular or plural, snake_case or camelCase — pick one.
- Cardinality is shown on every line (1, N, 0..1).
- No repeating groups (phone1, phone2, phone3) — move them to their own table.
Generate an ER diagram for your project →
Frequently asked questions
What is an ER diagram used for?
It shows the tables (entities) of a database, their columns (attributes), keys and how the tables relate, so you can design the database before writing any SQL.
How do you show a many-to-many relationship in an ER diagram?
With a junction (bridge) table that holds the primary keys of both tables as foreign keys — for example enrollments(student_id, course_id) between students and courses.
Can I turn these ER diagrams into SQL?
Yes. In AI Flowchart, open the ER diagram and use Code to export CREATE TABLE statements for MySQL, PostgreSQL, SQL Server or SQLite.