Designing an ER Diagram - The Process
Step 1 - Identify the main entities or tables. Customers, items, cars, sales etc.
Step 2 - Identify the relationship between each table. Is it one to many or many to many relationship?
Step 3 - If you have any many to many relationships create a transaction table.
Example: The school wishes to hold an online silent auction to raise money. Design a relational database to store bids from customers for specific auction items.
1. What are the source tables?
Customers and Auction Items
2. What are the relationships?
A customer can make many bids for many items and an item can have many bids. This is a many to many relationship.
3. What new transaction table do we need?
Create a new table called bids which will store the customer id, item_id and bid amount.
One customer can make many bids but each bid is for one item (one to many)
One item can have many bids (one to many)
1. Create a database to store information about items in your fridge and pantry at home
2. Create a database that allows you to keep track of customer conversations over the phone. Record the dates you talked to them along with the topic of your discussion for each.
3. Design a database for a local hardware business .It should contains customer details and will keep track of items sold to each customer.
4. Design a database that keeps track of student and teacher information along with classes they enroll in and teach.