ERD Assignment Solution
ERD Assignment Solution
Question: 03
The craft trading website Itsy! Bitsy! is setting up a database to record sellers and their products. This
requires recording the following information:
• For each seller, their name, contact email, and postal address.
Draw an entity-relationship (ER) diagram that represents this information. Make sure to capture the
constraints on the relationships involved, and designate appropriate primary keys for the entities.
Solution:
P_Id Name
Postal address Email
M M
Seller Sells
Product
Relational Schema:
Draw an ER diagram for the following application from the manufacturing industry:
Solution:
Quantity
M M
Supplier Supply
Part
Relational Schema:
D_ID Name
1 M
Doctor Treat Patient
Relational Schema:
Draw an ER diagram for the following application from the ABC Company:
-Employees work for many projects and each project has many employees
-Each employee has an unique Emp_No
-Each employee has a name and name consists of first name, middle name and last name
-Each project has an unique number and name
Solution:
P_ID Name
Emp_no Name
M Works M
Employee Project
for
Relational Schema:
A salesperson may manage many other salespeople. A salesperson is managed by only one salespeople.
A salesperson can be an agent for many customers. A customer is managed by one salespeople. A
customer can place many orders. An order can be placed by one customer. An order lists many inventory
items. An inventory item may be listed on many orders. An inventory item is assembled from many
parts. A part may be assembled into many inventory items. Many employees assemble an inventory
item from many parts. A supplier supplies many parts. A part may be supplied by many suppliers.
Solution:
Question: 06
A company database needs to store information about employees (identified by ssn, with salary and
phone as attributes), departments (identified by dno, with dname and budget as attributes), and
children of employees (with name and age as attributes). Employees work in departments; each
department is managed by an employee; a child must be identified uniquely by name when the parent
(who is an employee; assume that only one parent works for the company) is known. We are not
interested in information about a child once the parent leaves the company. Draw an ER diagram that
captures this information.
Solution:
1 1
M
M
Relational Schema: