Docsity

Database Systems Homework 1 - ER Diagram and Schema Design, Assignments of Deductive Database Systems

Toggle sidebar
bg1
CS411 Database Systems
Fall 2007
HW#1
Due: 3:00pm CST, 09/26/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.
This homework is partitioned into two parts as follows:
•Part 1: Problem 1 - Problem 4
•Part 2: Problem 5 - Problem 8
There is a bonus credit of 2% if your homework is 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.
Handwritten submissions will be graded but they will take longer to grade. For clarity,
machine formatted text is preferable: Expect to lose points if your handwritten answer is
unclear or misread by the grader.
1
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

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

CS411 Database Systems

Fall 2007

HW#

Due: 3:00pm CST, 09/26/

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.

This homework is partitioned into two parts as follows:

  • Part 1: Problem 1 - Problem 4
  • Part 2: Problem 5 - Problem 8

There is a bonus credit of 2% if your homework is 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.

Handwritten submissions will be graded but they will take longer to grade. For clarity, machine formatted text is preferable: Expect to lose points if your handwritten answer is unclear or misread by the grader.

Part 1

Problem 1 E/R Diagram (10 points)

Suppose you are hired by the university academic office to develop a course system. Your first task is to develop the course databases, with the following information:

  • Departments have a department ID (DeptID, e.g., CS) and a name (e.g., Computer Science)
  • Instructors have a faculty ID (FID), a name, and a main contact email
  • Courses have a course ID (CID, e.g., CS411), a course name (e.g., Databases System), days (e.g., TR), time (e.g., 03:30pm-04:45pm), and location (e.g., DCL 1310)
  • An instructor may teach more than one course; each course can only be teached by one instructor
  • A department usually offers many courses, and each course may be offered by different departments
  • Students have a UID, a NetID, and a name
  • A student majors in exactly one department and may have some minor departments
  • A student can take several courses

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 students, undergrads, grad students, and TAs 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 (10 points, 5 points for each)

a) Please briefly explain what is a weak entity set. In your answer to Problem 2, is there any weak entity set? If yes, please list all of them and briefly explain why they are weak. Besides, please also list their supporting relationships, if there is any.

b) Briefly describe the following concepts about keys in a relational database design:

  • Candidate key
  • SuperKey
  • Primary key
  • Prime attribute
  • Referential integrity

Problem 6 Functional Dependency and Normal Forms (15 points, 5 points for

each)

a) Use Armstrong’s axioms to prove Pseudo-transitivity rule below. X → Y and Y Z → U , then XZ → U , where X, Y , Z, and U are a set of attributes.

b) The staffs for CS411 came up with the idea of another normal form called No Functioanl Dependency Normal Form (NFDNF). We say that a relation R is in NFDNF if and only if there is no non-trivial functional dependency for R. Is it a good idea to decompose a relation into a set of relations in NFDNF? Give your answer and explain why.

c) A relation R involves a FD that violates BCNF condition and another FD whose left side is a super key for R. Prove that it is impossible to decompose R into a set of relations in BCNF while preserving all the functional dependencies of R.

Problem 7 Normalization and Schema Design (20 points, 5 points for each)

Consider a relation with schema R(A,B,C,D,E) and FD’s AB → C, DE → C, and B → D.

a) Decide whether this relation is in BCNF or not. Explain why.

b) Decompose the relations, if necessary, into collections of relations that are in BCNF. Make sure to indicate which dependency you apply to each decomposition.

c) Decide whether this relation is in 3NF or not. Explain why.

d) Decompose the relations, if necessary, into collections of relations that are in 3NF. Make sure to indicate how you obtain each decomposed relation. (Note that the FD’s given in the problem is a minimum cover of a set functional dependencies for R.)