ER Examples
ER Examples
Example 1:
A University contains many Faculties. The Faculties in turn are divided into several Schools. Each School
offers numerous programs and each program contains many courses. Lecturers can teach many
different courses and even the same course numerous times. Courses can also be taught by many
lecturers. A student is enrolled in only one program but a program can contain many students. Students
can be enrolled in many courses at the same time and the courses have many students enrolled.
Example 2:
UPS prides itself on having up-to-date information on the processing and current location of each
shipped item. To do this, UPS relies on a company-wide information system. Shipped items are the heart
of the UPS product tracking information system. Shipped items can be characterized by item number
(unique), weight, dimensions, insurance amount, destination, and final delivery date. Shipped items are
received into the UPS system at a single retail center. Retail centers are characterized by their type,
uniqueID, and address. Shipped items make their way to their destination via one or more standard UPS
transportation events (i.e., flights, truck deliveries). These transportation events are characterized by a
unique scheduleNumber, a type (e.g, flight, truck), and a deliveryRoute.
Please create an Entity Relationship diagram that captures this information about the UPS system. Be
certain to indicate identifiers and cardinality constraints.
Example 3:
The company is organized into departments. Each department has a unique name, a unique
number, and a particular employee who manages the department. We keep track of the start
date when that employee began managing the department. A department may have several
locations.
A department controls a number of projects, each of which has a unique name, a
unique number, and a single location.
We store each employee's name, social security number, address, salary, gender, and birth
date. An employee is assigned to one department but may work on several projects, which
are not necessarily controlled by the same department. We keep track of the number of
hours per week that an employee works on each project. We also keep track of the direct
supervisor of each employee. We want to keep track of the dependents of each employee for
insurance purposes. We keep each dependent's first name, gender, birth date, and
relationship to the employee.
Example 4:
Create an ERD for a car dealership. The dealership sells both new and used cars, and it operates a
service facility. Base your design on the following business rules:
A salesperson may sell many cars, but each car is sold by only one salesperson.
A customer may buy many cars, but each car is bought by only one customer.
A salesperson writes a single invoice for each car he or she sells.
A customer gets an invoice for each car he or she buys.
A customer may come in just to have his or her car serviced; that is, a customer need not buy a
car to be classified as a customer.
When a customer takes one or more cars in for repair or service, one service ticket is written for
each car.
The car dealership maintains a service history for each of the cars serviced. The service records
are referenced by the car’s serial number.
A car brought in for service can be worked on by many mechanics, and each mechanic may work
on many cars.
A car that is serviced may or may not need parts (e.g., adjusting a carburetor or cleaning a fuel
injector nozzle does not require providing new parts).
Example 5:
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).
Although you always wanted to be an artist, you ended up being an expert on databases because you
love to cook data. Your old love is still there, however, so you set up a database company, ArtBase, that
builds a product for art galleries. The core of this product is a database with a schema that captures all
the information that galleries need to maintain.
Galleries keep information about artists, their names (which are unique), birthplaces, age,and style of
art. For each piece of artwork, the artist, the year it was made, its unique title, its type of art (e.g.,
painting, lithograph, sculpture, photograph), and its price must be stored. Pieces of artwork are also
classified into groups of various kinds, for example, portraits, still lifes, works by Picasso, or works of the
19th century; a given piece may belong to more than one group.
Each group is identified by a name (like those just given) that describes the group. Finally, galleries keep
information about customers. For each customer, galleries keep that person’s unique name, address,
total amount of dollars spent in the gallery (very important!), and the artists and groups of art that the
customer tends to like.