Docsity

Database Systems Homework 1 - E/R Diagram and Schema Design, Assignments of Deductive Database Systems

Toggle sidebar
bg1
CS411 Database Systems
Fall 2008
HW#1
Due: 3:15pm CST, 09/23/07
Note: Print your name and NetID in the upper right corner of every page of your submission.
Handin your stapled homework to Donna Coleman in 2120 SC. In case Donna is not in office,
slide your homework under the door.
To grade homeworks faster, the homework is partitioned into two parts. Please, submit
each part separately. For each part, make sure to write down your name and NetID.
There is a bonus credit of 2% if your homework is written by a word processor software and
formatted correctly: Each part must be separable so that it can be independently graded. If
you submit a paper copy then each part should i) be separately stapled and ii) include your
netid.
Expect to lose points if your handwritten answer is unclear or misread by the grader.
1
pf3
pf4
pf5

Partial preview of the text

Download Database Systems Homework 1 - E/R Diagram and Schema Design and more Assignments Deductive Database Systems in PDF only on Docsity!

CS411 Database Systems

Fall 2008

HW#

Due: 3:15pm CST, 09/23/

Note: Print your name and NetID in the upper right corner of every page of your submission. Handin your stapled homework to Donna Coleman in 2120 SC. In case Donna is not in office, slide your homework under the door.

To grade homeworks faster, the homework is partitioned into two parts. Please, submit each part separately. For each part, make sure to write down your name and NetID.

There is a bonus credit of 2% if your homework is written by a word processor software and formatted correctly: Each part must be separable so that it can be independently graded. If you submit a paper copy then each part should i) be separately stapled and ii) include your netid.

Expect to lose points if your handwritten answer is unclear or misread by the grader.

Problem 1 E/R Diagram (15 points)

Suppose you are hired to develop a geographical information system. Your first task is to develop its databases, with the following information:

  • A continent has a name and contains different countries (e.g., Europe). Each country resides only in one continent.
  • Each country has a name, a population value, official language(s), and its capital city. Each official language may be shared by different countries (e.g.English).
  • Each language has a unique ID (LangID) and a name.
  • Each city carries a name and a population value. Each city resides only in one country. The name of each city is unique within its country.
  • Each river has a unique ID (RiverID), a name, and its length. Rivers run through one or more countries.
  • International treaties are identified by their names. They also contain their subjects as well as starting dates. Each treaty consists of at least two countries.

Please design and draw an E/R diagram that captures the above information. Note that we can accept that an attribute is a set of values. Also, be careful to indicate any key and participation constraints (multiplicity constraints).

Problem 3 Schema Design (10 points)

a) Convert the E/R diagram of Problem 1 to a relational database schema. Don’t forget to indicate the keys (by underlining them) for each relation. Note that you don’t need to combine the relations for removing duplications in this problem. (4 points)

b) Convert the treaty, pact, organization, and convention subclass relationships in Problem 2 into relational schema, using the following three approaches: ER approach, Object- Oriented approach, and Null approach. (6 points, 2 points for each approach)

Problem 4 Basic Concepts of Keys (25 points, part b 10 and other parts 5 points)

a Assume that your database files are damaged and you do not have any information about the schema of a database. However, you have the values of tables of your database instance. How do you distinguish the candidate keys for each relation us- ing this information.

b What is the minimum and maximum number of super keys in a relation whose number of attributes is n?

c What is the minimum and maximum number of primary keys in a relation whose number of attributes is n?

d Consider a relation with schema R(A,B,C,D) with functional dependencies (FD’s): BC → A, AD → B, CD → B, AC → D. Find all the candidate keys of R.

Problem 6 Normalization and Schema Design (10 points)

Consider the relation U niversity as (name, city, departments, f aculties, students).

  • Each university has only one name.
  • Each university resides only in one city.
  • Each university has one or more departments.
  • Each faculty teaches in one or more departments.
  • Each student studies in one or more department.

The following table shows an instance of this relation:

name city departments faculties students UIUC Urbana CS Winslett Rishi UIUC Urbana CS Han Hector UIUC Urbana ECE Winslett Mitra UIUC Urbana CS Han Kim UIUC Urbana ECE Hong Rishi

Provide the BCNF normal form and the 4th normal form for this relation.