Friday, September 16, 2016

Relationship Types

  • ·         A relationship where each record in Table A can be related to one, and only one, record in Table B, and each record in Table B relates to one, and only one, record in Table A. 1:1
  • ·         A relationship where a single record in Table A can be related to one or more records in Table B, but a single record in Table B can only be related to one record in Table A. 1:M
  • ·         A relationship in which many records in one table match many records in another table. M:M
  • ·         Unnecessarily repetitive. - redundant

1. Identify the relationship types of the statements below
Type
Statement
 M:M
A snowboard instructor may instruct one or more snowboarders. Not mentioned: All snowboarders are not bound to use same instructor
1:M
A bicycle may be owned by a child. Not mentioned:  One bicycle will have only one owner, but a child can own multiple bicycles.
 M:M
Classroom crayons may be used by students in a classroom
 1:1
A passport belongs to a person. Not mentioned: ignore expired passports
 1:M
A female elephant gives birth to an elephant. No mentioned: an elephant has one and only mother, but female elephant can give birth to multiple elephants.



2. Provide two examples for each relationship type.
Relationship Type
Example
One-to-one
 I have only one SSN  XXXXXXXXX and XXXXXXXXX belongs only to me
One-to-one
  I have a unique valid driver license number, this number cannot be assigned to anyone else.
One-to-many
A bicycle may be owned by a child, child may own multiple bicycles.
One-to-many
 I have three passports, two are expired, and the current one is valid. But the passport, whether it is valid or not, must be of one person.
Many-to-many
 Classroom crayons may be used by students in a classroom
Many-to-many
 In my house there are 10 laptops and 4 family members, anyone can use any laptop and any laptop can be used by any family member.

3. Draw an entity relationship diagram to represent the following:
a. Each CLUB must be assigned to one and only one DEPARTMENT
b. Each DEPARTMENT may be responsible for one or more CLUBs
c. Each STUDENT may join one or more CLUBs
d. Each CLUB may be composed of one or more STUDENTs






No comments:

Post a Comment