Database Engineering (EC-240) : Lab Manual # 04
Database Engineering (EC-240) : Lab Manual # 04
Database Engineering (EC-240) : Lab Manual # 04
DATABASE ENGINEERING
(EC-240)
LAB MANUAL # 04
Course Instructor: Prof Dr Farooque Azam / Assoc Prof Dr Wasi Haider Butt
Lab Engineer: Engineer Kashaf Raheem
Lab Objective:
To introduce students with types of entities, attributes, and relationships.
Lab Tasks:
• Graduate students have one major department in which they are working on
their degree.
• Each graduate student has another, more senior graduate student (known as
a student advisor) who advises him or her on what courses to take.
College of Electrical & Mechanical Engineering, NUST
2. Draw an ER diagram.
Assume that at Pine Valley Furniture each product (described by product number,
description, and cost) comprises at least three components (described by
component number, description, and unit of measure), and components are used to
make one or many products. In addition, assume that components are used to make
other components and that raw materials are also considered to be components. In
both cases of components, we need to keep track of how many components go into
making something else.
College of Electrical & Mechanical Engineering, NUST
Each publisher has a unique name; a mailing address and telephone number are also
kept on each publisher. A publisher publishes one or more books; a book is
published by exactly one publisher. A book is identified by its ISBN, and other
attributes are title, price, and number of pages. Each book is written by one or more
authors; an author writes one or more books, potentially for different publishers.
Each author is uniquely described by an author ID, and we know each author’s
name and address. Each author is paid a certain royalty rate on each book he or she
authors, which potentially varies for each book and for each author. An author
receives a separate royalty check for each book he or she writes. Each check is
identified by its check number, and we also keep track of the date and amount of
each check. As you develop the ERD for this problem, follow good data naming
guidelines.
this final situation. Explain why these different changes to the situation led to
different data models, if they did.
5. Prepare an ERD for a real estate firm that lists property for sale. Also
prepare a definition for each entity type, attribute, and relationship on
your diagram. In addition, draw a data model for this situation using the
tool you have been told to use in your course. The following describes this
organization:
• The firm has a number of sales offices in several states. Attributes of sales
office include Office Number (identifier) and Location.
• Each sales office is assigned one or more employees. Attributes of
employee include Employee ID (identifier) and Employee Name. An
employee must be assigned to only one sales office.
• For each sales office, there is always one employee assigned to manage that
office. An employee may manage only the sales office to which he or she is
assigned.
• The firm lists property for sale. Attributes of property include Property ID
(identifier) and Location. Components of Location include Address, City,
State, and Zip Code.
College of Electrical & Mechanical Engineering, NUST
• Each unit of property must be listed with one (and only one) of the sales
offices. A sales office may have any number of properties listed or may
have no properties listed.
• Each unit of property has one or more owners. Attributes of owners are
Owner ID (identifier) and Owner Name. An owner may own one or more
units of property. An attribute of the relationship between property and
owner is Percent Owned.