DBMS Exercises
 

What is Cardinality of a Relation?

What is the cardinality and existence of each of the following relationships in just the direction given?
State any assumptions you have to make.

Husband to wife
Student to degree
Child to parent
Player to team
Student to course
Citizen to Country

For each of the following pairs of rules, identify two entity types and one relationship. State the cardinality of the relationship in each case and draw ER Diagram.

  • A department employs many persons.
  • A manager manages one department.
  • An author may write many books. A book may be written by many authors.
  • A team consists of many players. A player plays for only one team.
  • A lecturer teaches, at most, one course. A course is taught by exactly one lecturer.
  • A flight connects two airports. An airport is used by many flights.
  • A purchase order may be for many products. A product may appear on many purchase orders.
  • A customer may submit many orders. An order is for exactly one customer.


Draw an ER diagram and indicate the cardinality for each relationship.

School Exercise

A school has many classes. Subjects are taught by teachers. One teacher teaches only one subject. Each class may be taught by several teachers, and a teacher may teach several classes. A particular class always uses the same room. Because classes may meet at different times or on different evenings, it is possible for different classes to use the same room. The school needs a system to manage time table for teachers and class room allocation.
(c) Shilpa Sayura Foundation 2006-2017