1 / 9

Entity - Relationship Modelling Exercises by Artem Chebotko

Entity - Relationship Modelling Exercises by Artem Chebotko. Exercise 1. Draw an ER diagram and translate it to the relational model for the following: A customer orders at least one book from a bookstore. A bookstore can process (orders from) many (or none) customers.

fred
Download Presentation

Entity - Relationship Modelling Exercises by Artem Chebotko

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Entity - Relationship ModellingExercisesby Artem Chebotko

  2. Exercise 1 • Draw an ER diagram and translate it to the relational model for the following: • A customer orders at least one book from a bookstore. • A bookstore can process (orders from) many (or none) customers. • A book can be ordered many (or zero) times.

  3. Exercise 2 • Draw an ER diagram and translate it to the relational model for the following: • A customer places at least one order. • An order is placed by exactly one customer. • An order is sent to exactly one bookstore. • A bookstore handles many (or none) orders. • An order includes at least one book. • A book can be included in many (or zero) orders.

  4. Exercise 3 • Draw an ER diagram and translate it to the relational model for the following: • An animal shelter has many (or none) pets. • A pet can be a cat or a dog. No other kinds of animals are allowed in a shelter. • A pet is characterized by a tag (unique id), name, breed, age, coat, pattern, and weight.

  5. Exercise 4 • Draw an ER diagram and translate it to the relational model for the following: • An animal shelter has many (or none) pets. • A pet can be a cat or a dog. No other kinds of animals are allowed in a shelter. • A pet is characterized by a tag (unique id), name, breed, age, coat, pattern, and weight. In addition, height and other size characteristics are recorded for dogs and food preferences are recorded for cats. • A dog is walked by a volunteer at least twice a day.

  6. Exercise 5 • Draw an ER diagram and translate it to the relational model for the following: • An animal shelter has many (or none) pets. • A pet can be a cat or a dog. Occasionally, a shelter hosts other kinds of animals (deer, raccoon, bird, etc.) that may require medical (veterinarian) treatment. • A pet is characterized by a tag (unique id), name, breed, age, coat, pattern, and weight.

  7. Exercise 6 • Draw an ER diagram and translate it to the relational model for the following: • A computer programmer in a software development company is described by an employee id, name, phone, address, email, and set of skills (non-empty set). • A programmer works on many (or none) projects. • A project has at least one programmer assigned to it. • A project has a name, description, and set of skills (non-empty set) required to contribute to it.

  8. Exercise 7 • Draw an ER diagram and translate it to the relational model for the following: • A university offers a number of courses. • A course may have one or more (or none) courses as prerequisites. • A course may or may not have one or more scheduled sections. • A professor teaches at least one course section. • A student is enrolled in at least three and at most seven course sections. • A professor assigns grades to students enrolled in a course section that s/he teaches.

  9. Exercise 8 • Draw an ER diagram and translate it to the relational model for the following: • A bank offers three types of accounts: checking, savings, and loan/credit. • A checking account has account-number, date-opened, balance, and service-fee. • A savings account has account-number, date-opened, balance, and interest-rate. • A loan/credit account has account-number, date-opened, balance, service-fee, interest-rate, and credit-limit.

More Related