Reference no: EM13944397
1. Mark T(rue) or F(alse) for each statement below ( 2/each)
(1) If a table does not have any functional dependencies, then the table is in at least 3NF. ( )
(2) If a table is in 3NF, it is always in 2NF. ( )
(3) An FD XY ? WV can be decomposed into X ?WV and Y ?WV. ( )
(4) Query processing in relations in higher normal form is more efficient that in lower normal form, since higher normal forms cause smaller relations.
(5) A binary modeling allows an attribute to a relationship. ( )
(6) A table can have both a primary index and a clustering index at the same time. ( )
(7) An index for an alternate key is always dense. ( )
(8) An OODBMS allows a user-defined data type. ( )
(9) The object identity in an OODB system can be defined by a designer. ( )
2. Answer briefly.
(a). As a SQL developer, explain how do you enforce the following types of constraints in SQL-based database systems? Use English to explain. You may explain using an example. (6)
Primary Key
Alternate key
Foreign keys
(b) In relation R7(A, B, C, D, E, F, G), how do you represent, using the FDs, the fact that the R7 has two candidate keys {AB, ACG}. (4)
(c) What are the major differences between hashing and B+-tree indexes? Discuss in terms of access time to records, types of queries best supported (exact matching, partial matching, range queries, full-table scan), and table growth. (5)
(d) What are major differences between entity in ER model and class in object-oriented systems? Try to use as many concepts as possible discussed in the course. (4)
(e) What are advantages and disadvantages of using 2K block size and 16K block size in terms of storage utilization, query processing with a large table, and updating a single row. (4)
(f) Why XML is important in structuring and exchanging data over the web? (4)
3. Consider the following relation:
R(A,B,C,D,E,F)
FD:
B?C
A?DE
AB?F
(a) Why is this table not in 2NF? (3)
(b) Normalize the data shown in this table to third normal form (3NF).
Identify the primary and foreign keys in your 3NF relations. Underline primary keys in the decomposed relations. Mark with * for all foreign keys. (4)
4. Consider a universal relation STUDENT below: Assume each attribute has an atomic value.
STUDENT(SID, Name, DOB, Advisor, Dept, Dept_office, Term, Year, Course, Instructor, Grade}.
The FDs are: 2 3
SID --> Name, DOB, Advisor
Advisor --> Dept
Dept --> Dept_Office
Course --> Instructor
SID, Term, Year, Course --> Grade
The primary key of this table is SID+Term+Year+Course.
(a) Mark T/F for each FD against 2NF and 3NF above. (8)
(b) Based on the analysis done in (a), in what normal form is the relation STUDENT ? (2)
(c) Show the 3NF decomposition. Underline primary keys in the decomposed relations. Mark with * for all foreign keys. Show all processes. (3)
5. Consider a table named EMPLOYEE which contains 500,000 rows of 100 bytes each. Assume that the block size is 2000 bytes. Assume the data and index trees fill the data up to 80% of each node. Ignore all other overheads. Show calculations in all parts that follow.
(a) Calculate the blocking factor for the data records. (2)
(b) Calculate the number of blocks the rows of the EMPLOYEE table will take. (3)
(c) Assume you want to create a dense multi-level primary key index on the PK (E# CHAR(10) ) of EMPLOYEE. Calculate the index entry size assuming a rowid of 6 bytes. (2)
(d) Then calculate how many leaf-level blocks there will be in the index tree. (3)
(e) Assuming leaf-level node and middle-level nodes have the same structure, calculate how many blocks exist on the each level of the index tree. (3)
(f) Draw a schematic diagram for the index tree you constructed. Just show nodes, levels (depth), and the number of nodes in each level. (2)
6. For the following problem, use COMPANY example in p. 159 of Elmasri's book. Suppose we have another table called CONSULTANT showing which consultant helps which departments as follows:
CONSULTANT ( CON#, Cname, Expertise, DNUMBER)
c1 Joy C/S 1
c2 Bob OOSA 1
c3 Jack C++ 5
c4 Cindy Oracle NULL
(a) Show the syntax of Left Outer JOIN in Oracle syntax between department and consultant to process the following query: "For all departments, find department name and consultant's name and their expertise for every department" (3)
(b) Show the result of the above query. (3)
7. Suppose we have the following schema. PKs are underlined and FKs are marked with asterisk (*).
PURCHASE (P#, P_date, Terms)
LINE_ITEM (P#*, Line#, Item#, Quantity)
ITEM (Item#, Item_Name, ManuF#*)
Manufacture (ManuF#, ManuF_name, Address)
(a) Show the IE model with the crowfoot notation for the above schema.(4)
8. See the ERD in Chen's notation below. Show the IDEF1X notation of the ERD. Decompose all the M:N relationships into two 1:N relationships. (10).