5.1
Partial Dependency : A functional dependency X Y is a
partial dependency if some attribute A
X can be
removed and the dependency still holds.
In the given Dependency Diagram :
Combination of C4 and C5 is the candidate key and
C1 is partially dependent on C4.
Transitive dependency : A functional dependency X Y in a
relational schema , R, is a transitive dependency if there is a set
of attributes Z that is not a subset of any key of R and both
X
Z and Z
Y
holds.
In the given Dependency Diagram :
Combination of C4 and C5 is the candidate key.,
C2 is dependent on the key (C4,C5) but C3 is dependent on C3
Hende C3 is transitively dependent on (C4 , C5)
5.2
A relational Schema, R is in 2NF if every non-prime attribute , A in R, is fully functionally dependent on the primary key of R. It removes partial dependency.
C1 is partially dependent on (C4, C5)
To convert the Schema to 2NF, we remove the partial dependency. We create another table with C1 and C4 where C4 is the primary key and make C4 a foreign key in this table.
Dependency diagram :
5.3
A Relational schema , R is in 3NF if it is in 2NF and no non-prime attribute of R is transitively dependent on the primary key of R.
A Relational schema , R, is in 3NF if whenever a functional
dependency XA holds in
R, either
(a) X is the super key of R or,
(b) A is a prime attribute of R
In the given Dependency Diagram, C3 is transitively dependent on (C4,C5). To remove the transitive dependency , we remove C2 and C3 from this table and create another table with C2 and C3 where C2 is the primary key of the table and it forms foreign key in the main table.
Dependency Diagram:
0 5bour. C1 C2 C5 5.1 Identify and discuss the partial and transitive dependencies in the above d...
2. The following is the relation notation of a table for a veterinary office. [70 pts. total] VETERINARY_OFFICE (PetID, PetName, PetType, PetBreed, OwnerID, OwnerLastName, OwnerFirstName, ServiceDescription, ServiceDate, ServiceCharge) The functional dependencies are given below: PetID -> PetName, PetType, PetBreed, OwnerID, OwnerLastName, OwnerFirstName OwnerID -> OwnerLastName, OwnerFirstName ServiceDescription -> ServiceCharge PetID, ServiceDate > ServiceDescription, ServiceCharge Assumptions: 1)A pet belongs to only one owner, 2) an owner may have more than one pet, 3A pet receives at most one treatment on any...
PROBLEM STATEMENT: Suppose you have a client that has given you
the following business rules to form the basis for a database
design. The database must enable the manager of a company dinner
club to mail invitations to the club’s members, to plan the meals,
to keep track of who attends the dinners, and so on. Each dinner
serves many members, and each member may attend many dinners. A
member receives many invitations, and each invitation is mailed to
many...
Question 1.Write a SQL statement for each of the following
questions based on the above tables (50 Points).
1) Create “Enrollment” table.
2) Change the credits of “Database” course from 2 to 3.
3) List the course titles (not Course_No) and grades John Doe
had taken.
4) Calculate average of Café Balance, and name new field as
Average Balance.
5) Create a roster for “Database” course (list student ID, last
name, first name, major, and status for each student enrolled...