Sie sind auf Seite 1von 7

Fontys ICT

Practical reader EDB2


(under construction)
Corrie Wolf , Antoinette Littel

November 2014

EDB2

Practical Reader

Week 1
Exercise 1
A horse riding stable Boszicht has a reservation system. Riders can make a
reservation for a certain horse. The database has the following structure
(Primairy keys are underlined and Foreign keys are between <>):
RIDER ridernr, name, adress, telephonenr.
HORSE horsename, breed, age, difficultylevel
RESERVERATION date, <ridernr>, <horsename>, time
a) Scetch the ER Diagram in Crowfoot notation on paper.
b) Is it possible that rider Femke makes multiple reservations for her
favorite horse Fury? Explain the conditions for yes or no.
c) Is it possible for Femke and Suzanne to reserve the same horse on the
same day? Explain.
d) Is it possible that Boszicht has multiple horse with the name Fury?
e) Design SQL statements to get this information out of the database:
1. Which horses are suitable for difficultylevel Easy?
2. How many breeds are there?
3. Which riders (names please) have made reservations for 1-apr2014?
4. What is the average age of the Easy horses?

Exercise 2
A horse breeding stable Hoefslag has a reservation system. Riders can make a
reservation for a certain horse or pony. This is the database structure:
RIDER ridernr, name, adress, telephonenr.
HORSE horsename, breed, age, difficultylevel
resnr, <ridernr>, <horsename>, <ponyname>, date,
RESERVERATION
time
PONY ponyname, breed, age, hight, mother, father
Gevraagd:
1) Scetch the ER Diagram in Crowfoot notation on paper.
2) Is it possible that rider Femke makes multiple reservations for both a pony
and a horse? Explain the conditions for yes or no.
3) Is it possible for Femke and Suzanne to reserve horse Fury on the same
day? Explain.

12 November 2014

EDB2

Practical Reader

Exercise 3
Write down the information stored in the ER diagram below. Write down full English sentences.

Exercise 4
Describe the difference(s) between the following two ERDs.

Exercise 5
Describe the meaning and the consequences of the following ERD.
Sketch alternatives and explain them.

12 November 2014

EDB2

Practical Reader

Exercise 6
Describe the meaning and the consequences of the following ERD.

Team

Member

Exercise 7
a) Create an ER Diagram of the following case.
In a university information is stored from students, courses and teachers. From
students student number, name and address is kept, from teachers the employee
number, name, room number and telephone is kept. Students can follow courses which
are registered with the course code, name and number of credits. Each course is taught
by at most 2 teachers. If a student follows a course the university registers the start
date and finally the grade of the exam that the student received.
b) Add attributes to the ER Diagram.

Exercise 8
a) Create an ER Diagram of the following case.
A web store (like amazon.com) registers customer information, like customer number,
name and address and article information, like article number, type, price. The
customers can order articles in the web store, of which the order date and the delivery
date are kept. Create an ER diagram with the entities Customer, Order and Article.
b) Add attributes to the ER Diagram.

12 November 2014

EDB2

Practical Reader

Week 2
Excercise 1
A book has multiple copies in the library. Here is the unfinished ER diagram.

BOOK

COPY

Booknr
Title
Pages
Author

Booknr
Copynr
Condition
ExpireDate

Answer the following questions:


a) Wat is the identifier of COPY?
b) How do we call such an identifier?
c) COPY is a .. entity and COPY is an ..entity.
d) Is BOOK the parent or the child?
e) Why is the entity COPY drawn with round corners?
f) What kind of line should there be at the question mark: a dashed or a solid
line? Why?
g) How do we call this kind of relationship: this is an .relationship.
h) How do you make it a nonidentifying relationship?
i) What happens to the line?

Excercise 2
Can entity B be a weak entity in this ER diagram? Explain. So the line is.

Excercise 3
Can entity B be a weak entity in this ER diagram? Explain. So the line is .

12 November 2014

EDB2

Practical Reader

Exercise 4
Mechanics at Garage Voskuil service different brands of cars.
Every year a car gets a maintenance-service.
A customer can be the owner of more than one car.
Within one maintenance-service, multiple repair- and service-acitivities will be
performed like changing oil, checking brakediscs, changing tires etc.
The whole maintenance service will be performed by one mechanic.
During this maintenance-service different materials will be used.
a) Make ER diagrams from this story. One for every sentence.
b) Make the ERD of the Garage Voskuil. (dont remove N:M relations).

Exercise 5: Hotel company


A hotel company has several hotels in the Netherlands. Each hotel has a unique name, an
address, a city name and a telephone number.
Hotels can have two types of rooms; bedrooms and conference rooms. Each room has a room
number and a price per night. The room number is unique within the hotel. For bedrooms also
the number of beds and the availability of a shower is kept. For conference rooms the number
of seats and the availability of a beamer is stored.
The hotel company has several employees. Each employee has a unique employee number, a
name and a salary and is working for one hotel. Each hotel has a hotel manager, which is an
employee of the hotel.

Give an ER diagram for the case described above. The ER diagram should at least contain:
all entities
all attributes described in the case (also mention identifiers that you introduced)
relationships
maximum and minimum cardinalities

12 November 2014

EDB2

Practical Reader

Exercise 6:
Employees of a company have a unique employee-number, a name, date of birth, address and
city.
Employees can be assigned to projects. Each project has a unique project-number and a
project name. Whenever an employee is assigned to a project, the start-date and the end-date
of the project-assignment is kept.
Every project has one project leader.
An Employee can be supervisor of one or more other employees.
Give an ER diagram for the case described above. The ER diagram should at least contain:
all entities
all attributes described in the case (also mention identifiers that you introduced)
relationships
maximum and minimum cardinalities

12 November 2014

Das könnte Ihnen auch gefallen