Assignment 1 for Database Systems | CS 411, Assignments of Deductive Database Systems

Material Type: Assignment; Class: Database Systems; Subject: Computer Science; University: University of Illinois - Urbana-Champaign; Term: Unknown 2006;

Typology: Assignments

Pre 2010

Uploaded on 03/10/2009

koofers-user-p9r-1
koofers-user-p9r-1 🇺🇸

5

(1)

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Homework 1
Administrivia
Out: 28th January, 2006.
Due date: At the beginning of the lecture on 7th February, 2006. Please submit a hard
copy of your homework. Bring it down to the lecture table (the one with the PC that I use
to display the slides).
The hard copy should be as clearly readable as possible. You may be subtracted points
for unreadability and ugly presentation.
Off-campus students: You should e-mail your solutions to Yoonkyong Lee
<[email protected]> in the pdf format. Send the pdf file as attachment with your email by
2 PM UIUC time (CST). Off-campus students in other time zones should note that the
deadline is according to CST.
Please note: Late homework will not be accepted, barring exceptional
circumstances.
Goal of this homework: To get you to practice and learn important concepts in conceptual
design with ER model, and to get started on relational model.
ER Basics
Problem 1. (25 points) Consider the database of an online bookstore.
Every book has a title, isbn, year and price. The store also keeps the author and
publisher for any book.
For authors, the database keeps the name, address and the url of their homepage.
For publishers, the database keeps the name, address, phone number and the url of
their website.
The store has several warehouses, each of which has a code, address and phone
number.
The warehouse stocks several books. A book may be stocked at multiple
warehouses. (In previous sentence, we are not referring to a particular copy of the
book. Consider for example “the complete book” for our course. This book may
be stocked at multiple warehouses.)
The database records the number of copies of a book stocked at various
warehouses.
The bookstore keeps the name, address, email-id, and phone number of its
customers.
A customer owns several shopping basket. A shopping basket is identified by a
basketID and contains several books.
pf3

Partial preview of the text

Download Assignment 1 for Database Systems | CS 411 and more Assignments Deductive Database Systems in PDF only on Docsity!

Homework 1

Administrivia

Out: 28th^ January, 2006. Due date: At the beginning of the lecture on 7th^ February, 2006. Please submit a hard copy of your homework. Bring it down to the lecture table (the one with the PC that I use to display the slides).

The hard copy should be as clearly readable as possible. You may be subtracted points for unreadability and ugly presentation.

Off-campus students: You should e-mail your solutions to Yoonkyong Lee in the pdf format. Send the pdf file as attachment with your email by 2 PM UIUC time (CST). Off-campus students in other time zones should note that the deadline is according to CST.

Please note: Late homework will not be accepted, barring exceptional circumstances.

Goal of this homework: To get you to practice and learn important concepts in conceptual design with ER model, and to get started on relational model.

ER Basics

Problem 1. (25 points) Consider the database of an online bookstore.

  • Every book has a title, isbn, year and price. The store also keeps the author and publisher for any book.
  • For authors, the database keeps the name, address and the url of their homepage. For publishers, the database keeps the name, address, phone number and the url of their website.
  • The store has several warehouses , each of which has a code, address and phone number.
  • The warehouse stocks several books. A book may be stocked at multiple warehouses. (In previous sentence, we are not referring to a particular copy of the book. Consider for example “the complete book” for our course. This book may be stocked at multiple warehouses.)
  • The database records the number of copies of a book stocked at various warehouses.
  • The bookstore keeps the name, address, email-id, and phone number of its customers.
  • A customer owns several shopping basket. A shopping basket is identified by a basketID and contains several books.
  • Some shopping baskets may contain more than one copy of same book. The database records the number of copies of each book in any shopping basket.

Design an ER diagram for such a bookstore. You are NOT required to identify keys or constraints for this problem.

Problem 2. (25 points) You are hired as a database consultant for an art gallery. In this problem, you have to design the ER diagram for their database. The information that galleries need to store are as follows:

  • Galleries keep information about artists , their names (which are unique), birthplaces, age, and style of art.
  • For each piece of artwork , the artist who has painted the artwork, the year it was made, its unique title, and its price must be stored.
  • Pieces of artwork are also classified into various groups , for example, portraits, still life; a given piece may be classified into at most one group. Each group is identified by a name (like those just given) that describes the group.
  • Galleries keep information about customers , who are uniquely identified by their names. For each customer, galleries keep that person’s name, address, total amount of dollars spent in the gallery.
  • Customers tend to like some groups and some artists. Galleries also record the artists and groups of art that a customer likes.

Draw the ER diagram for the database. You are NOT required to identify keys or constraints for this problem.

Constraints and Design Principles

Problem 3. (25 points) For this problem, duplicate the ER diagram you designed for Problem 2, and modify it to include following constraints. You have to submit only one ER diagram that includes all of the following constraints.

a) Identify keys for the entity sets. b) A piece of artwork is classified into at most one group. c) Each artwork has been painted by exactly one artist.

Problem 4. (10 points) We can convert any weak entity set to a strong entity set by adding appropriate attributes. What are these attributes? What is the resulting problem when we add these attributes?