Вы находитесь на странице: 1из 4

University of Management and Technology

School of Systems and Technology


Department of Software Engineering
University of Management and Technology, Lahore

Assignment # 2 (Total Marks: 100)

Introduction to Database Systems (CC2421)


BS Software Engineering
Spring 2019
Date Issue: 11-04 -2019
Due Date: 08-04-2019 (Monday) Only in class
Instructions:
• You need to submit assignment in hard form and HAND MADE.
• Deadline is strict! No assignment is accepted after deadline in anyway.
• This assignment is for your practice of described content. So please DO NOT CHEAT.
You will cheat with yourself in actual, not with the teacher!
• Trust yourself! You can do it in better way! …Good Luck!

How to Draw ER Diagrams

Below points show how to go about creating an ER diagram:

1. Identify all the entities in the system. An entity should appear only once in a particular diagram.
Create rectangles for all entities and name them properly.
2. Identify relationships between entities. Connect them using a line and add a diamond in the middle
describing the relationship.
3. Add attributes for entities. Give meaningful attribute names so they can be understood easily.

ER Diagram Best Practices

1. Provide a precise and appropriate name for each entity, attribute, and relationship in the diagram.
Terms that are simple and familiar always beats vague, technical-sounding words. In naming
entities, remember to use singular nouns. However, adjectives may be used to distinguish entities
belonging to the same class (part-time employee and full-time employee, for example). Meanwhile
attribute names must be meaningful, unique, system-independent, and easily understandable.
2. Remove vague, redundant or unnecessary relationships between entities.
3. Never connect a relationship to another relationship.

Azeema Yaseen Lecturer


4. Make effective use of colours. You can use colours to classify similar entities or to highlight key
areas in your diagrams.
5. Use all notations to make ERDs e.g. notations for degrees of relationship, specification,
generalization, aggregation, composition, participation and disjointness constraints. See lecture
material for guideline.

Question.1: Draw Entity Relationship Diagram for the given case studies: consider following points to
prepare your ERDs:

• Show Entities
• Show Relationships
• Show Multiplicities and Cardinalities
• If there is any multivalued attribute. Apply 1NF form and show sample table. You can
assume occurrences of records.

Case Study 1:

Draw Entity Relationship Diagram for the following case studies: Case Study 1: Organization made up of
various departments, each having a name, identifying no., and an employee who is the manager. A
department may be located in different places. Information about employee includes name, identification
number, birth date, address, sex, and salary. Each employee is assigned to one department. The date the
manager is appointed to a department is also tracked. Employees may be directly supervised by another
employee. Each project within the organization is controlled by a department. Employees (not necessarily
from the controlling dept.) are assigned to projects. Information about projects includes project name, no.,
and location. Hours spent by employees on each project are also kept.

Case Study 2:

MUHAMMAD HAROON LECTURER A General Hospital consists of a number of specialized wards


(such as Radiology, Oncology, etc). Information about ward includes unique name, total numbers of current
patients. Each ward hosts a number of patients, who were admitted by a consultant (doctors) employed by
the Hospital. On admission, the date and time are kept. The personal details of every patient include name,
Medical Recode Number (MRN), set of phones and one address (city, street, code). A separate register is
to be held to store the information of the tests undertaken. Each test has unique episode No., category and
the final result of test. Number of tests may be conducted for each patient. Doctors are specialists in a
specific ward and may be leading consultants for a number of patients. Each patient is assigned to one
leading consultant but may be examined by other doctors, if required.

Case Study 3:

An organization makes many models of cars, where a model is characterized by a name and a suffix (such
as GL or XL which indicates the degree of luxury) and an engine size. Each model is made up from many
parts and each part may be used in the manufacture of more than one model. Each part has a description
and an id code. Each model of car is produced at just one of the firm's factories, which are produced at just
one of the firm's factories, which are located in London, Birmingham, Bristol, Wolverhampton and
Manchester -one in each city. A factory produces many models of car and many types of part although each
type of part is produced at one factory only.

Azeema Yaseen Lecturer


Case Study 4:

ABC Ltd plans to computerize its sales ordering and stock control system. A feasibility study has strongly
suggested that a relational database system be installed. The details of ABC's sales and stock control are as
follows:
•Customers send in orders for goods. Each order may contain requests for variable quantities of one or more
products from ABC's range. ABC keeps a stock file showing for each product the product details and the
preferred supplier, the quantity in stock, the reorder level and other details.
•ABC delivers those goods that it has in stock in response to the customer order and an invoice is produced
for the dispatched items. Any items that were not in stock are placed on a back-order list and these items
are usually re-ordered from the preferred supplier. Occasionally items are ordered from alternative sources.
from alternative sources.
•In response to the invoices that are sent out to ABC's customers, the customers send in payments.
Sometimes a payment will be for one invoice, sometimes for part of an invoice and sometimes for several
invoices and part-invoices.
Case Study 5:

A Bus Company owns a number of busses. Each bus is allocated to a particular route, although some routes
may have several busses. Each route passes through a number of towns. One or more drivers are allocated
to each stage of a route, which corresponds to a journey through some or all of the towns on a route. Some
of the towns have a garage where busses are kept and each of the busses are identified by the registration
number and can carry different numbers of passengers, since the vehicles vary in size and can be single or
double-decked. Each route is identified by a route number and information is available on the average
number of passengers carried per day for each route. Drivers have an employee number, name, address,
and sometimes a telephone number.
Entities are:
Bus - Company owns busses and will hold information about them.
Route - Buses travel on routes and will need described.
Town - Buses pass through towns and need to know about them
Driver - Company employs drivers, personnel will hold their data.
Stage - Routes are made up of stages
Garage - Garage houses buses, and need to know where they are.

Attributes:
Bus (reg-no, make, size, deck, no-pass)
Route (route-no, avg-pass)
Driver (emp-no, name, address, tel-no)
Town (town-no, name)
Stage (stage-no)
Azeema Yaseen Lecturer
Garage (name, address)

Note: You’ll get marks on the base of your assignment presentation too.

GOOD LUCK 😊

Azeema Yaseen Lecturer