Assignment 4

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 3

Create an ER diagram for each of the following enterprises:

1. A railway system, which needs to model the following: 


1. Stations

2. Tracks, connecting stations. You can assume for simplicity that only one track
exists between any two stations. All the tracks put together form a graph.

3. Trains, with an ID and a name

4. Train schedules recording what time a train passes through each station on its
route. You can assume for simplicity that each train reaches its destination on
the same day, and that every train runs every day. Also for simplicity,
assume that for each train, for each station on its route, you store (a) time in,
(b) time out (same as time in if it does not stop), and (c) a sequence number
so the stations in the route of a train can be ordered by sequence number.

5. Passenger booking consisting of train, date, from-station, to-station, coach,


seat and passenger name; for simplicity, don't bother to model passengers as
entities.

6. After creating the ER diagram, create the associated set of tables (don't
bother about types, just give the attributes of each relation).

 Tables:

a. Booking(id, name, coach, date, seat, trainID, from, to)


Note that the three relationships from booking to train, and from and
to stations have all been folded in since they were many to one with
total participation.

b. Train(id, name)
c. Station(id, name)

d. Travels_through(train_id, station_id, seqno, timein, timeout)

e. Track(station_id1, station_id2)

2. An ER diagram for this database workshop, modeling resource centers, center


coordinators from resource centers, capacity of each center, the faculty who will be
attending at each resource center, and their associated institutions. 

After creating the ER diagram, create the associated set of tables (don't bother about
types, just give the attributes of each relation).

Tables:

a. ResourceCenter(id, capacity)
b. Faculty(id, name, institute_id)

c. Coordinator(faculty_id, resourcecenter_id)

Note that since not all faculty members are coordinators we don't fold
this into the Faculty table

d. Attends(faculty_id, resourcecenter_id)

For the same reason as above, this is not folded into Faculty

e. Institute(id, name)
3. If you have extra time after finishing the above ER diagram, add the clicker quiz
questions, and the answers submitted by each participant, to your ER diagram.

Tables:

a. ResourceCenter(id, capacity)
b. Faculty(id, name, institute_id)

c. Coordinator(faculty_id, resourcecenter_id)

Note that since not all faculty members are coordinators we don't fold this
into the Faculty table

d. Attends(faculty_id, resourcecenter_id)

For the same reason as above, this is not folded into Faculty

e. Institute(id, name)
f. ClickerQuizQuestion(id, questiontext, choice1, choice2, choice3, choice4,
correctanswer)

g. Submits_answer_to(faculty_id, question_id, answerChoice)

You might also like