0% found this document useful (0 votes)
67 views4 pages

Assignment No 1

The document contains 3 questions asking to design ER diagrams for different scenarios: 1) An online shopping system with entities for customers, products, orders, order items, and payments. 2) A company database with entities for employees, departments, and projects. Employees work for departments on projects for hours. Departments manage projects and employees. 3) Relationships between entities - employees work for one department, departments can have many employees and one manager. Departments control projects but a project belongs to one department. Employees can work on many projects.

Uploaded by

Rajesh Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views4 pages

Assignment No 1

The document contains 3 questions asking to design ER diagrams for different scenarios: 1) An online shopping system with entities for customers, products, orders, order items, and payments. 2) A company database with entities for employees, departments, and projects. Employees work for departments on projects for hours. Departments manage projects and employees. 3) Relationships between entities - employees work for one department, departments can have many employees and one manager. Departments control projects but a project belongs to one department. Employees can work on many projects.

Uploaded by

Rajesh Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Assignment No.

Q1) Draw following ER diagram using smartdraw.com/ERD.com


Ans:

Q2) Design a simple ER diagram for an online shopping system (e.g.: with
Entity like customer, product, payment, shopping cart etc.).

Ans: online shopping system ER Diagram

Customer Entity: - Attributes (custid(Pk), custname, custpass, custcontact,


custaddrs).

Product Entity: - Attributes (pid(Pk), pname, pprice, psellprice,pqty, pdesc)

Order Entity: - : Attributes (ordereid(Pk), cust(fk), orderDate, orderStatus,


orderDesc)

OrderItem Entity: - Attributes (orderid, custId, pid, qty, price, sellprice,


subtotalamt,pdesc)

Payment Entity: Attributes (paid_id(pk), custid(fk),ordere_id, paiddate,


paidamt, paidmode, paiddesc, paidstatus)
Q3) Design an E-R diagram for a COMPANY database as per the
requirements given below. Make appropriate assumptions to complete the
specification. Specify the key attributes of each entity type, and mapping
cardinalities.

a. The company stores the information about the currently working


employees. The information includes employee number, name,
gender, salary, and date of birth, date of joining, address and phone
number. Each employee works for a department on a particular project
for a particular number of hours.
b. The information about departments includes department number and
department name. Each department controls some projects currently
running in the company. Also each department is managed by a
particular employee who becomes the manager for that department.
This employee also supervises all the other employees in that
department.
c. The project information includes project number, project name and its
description.
d. An employee can work for only one department; however, a
department can have any number of employees. A department is
managed by only one manager and a manager can manage only one
department. A department can control any number of projects;
however, one project can be handled by only one department. Any
number of employees can work on any number of projects.

Ans:

Emp Entity: Attributes (empid(pk), name, gender, salary, dob, doj,


address, phone)

Department Entity: Attributes (deptid(pk), deptname , Location)

Project Entity: Attributes (pid(pk), pname, pdesc)

You might also like