SlideShare uma empresa Scribd logo
1 de 94
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
SOLUTION ASSIGNMENT - 2
Department: Department of Computer Engineering & Applications
Subject Name & Code: Database Management System (CSE 3003)
1. Suppose you are given a relation R = (A,B,C,D,E) with the following functional dependencies:
{CE → D,D → B,C → A}.
a. Find all candidate keys.
b. Identify the best normal form that R satisfies (1NF, 2NF, 3NF, or BCNF).
c. If the relation is not in BCNF, decompose it until it becomes BCNF. At each step, identify a
new relation, decompose and re-compute the keys and the normal forms they satisfy.
Answer:
a. The only key is {C, E}
b. The relation is in 1NF
c. Decompose into R1=(A,C) and R2=(B,C,D,E). R1 is in BCNF, R2 is in 2NF. Decompose R2
into, R21=(C,D,E) and R22=(B,D). Both relations are in BCNF.
2. Suppose you are given a relation R=(A,B,C,D,E) with the following functional dependencies:
{BC → ADE, D → B}.
a. Find all candidate keys.
b. Identify the best normal form that R satisfies (1NF, 2NF, 3NF, or BCNF).
c. If the relation is not in BCNF, decompose it until it becomes BCNF. At each step, identify a
new relation, decompose and re-compute the keys and the normal forms they satisfy.
Answer:
a. The keys are {B,C} and {C,D}
b. The relation is in 3NF
c. It cannot be put into BCNF, even if I remove D and put into a relation of the form (B, C, D) (I
need C for the functional dependency), the resulting relation would not be in BCNF.
3. Suppose you are given a relation R=(A,B,C,D,E) with the following functional dependencies:
BD → E,A → C.
a. Show that the decomposition into R1=(A,B,C) and R2=(D,E) is lossy.
b. Find a single dependency from a single attribute X to another attribute Y such that when you
add the dependency X → Y to the above dependencies, the decomposition in part a is no longer
lossy.
Answer:
a. intersection of R1 and R2 is ф hence this decomposition cannot be shown as lossless hence it
is lossy.
b. This decomposition cannot be made lossless. The problem is there is no longer a way to make
sure BD → E holds across two relations since they do not share any attributes. However, a lossy
decomposition of the form (A,B,C), (C,D,E) can be made lossless by adding an FD B → C.
4. You are given the following set of functional dependencies for a relation R(A,B,C,D,E,F),
F = {AB → C,DC → AE,E → F}.
a. What are the keys of this relation?
b. Is this relation in BCNF? If not, explain why by showing one violation.
c. Is the decomposition (A,B,C,D) (B,C,D,E,F) a dependency preserving decomposition? If not,
explain briefly.
Answer.
a. What are the keys of this relation?
{A,B,D} and {B,C,D}.
b. Is this relation in BCNF? If not, explain why by showing one violation.
No, all functional dependencies are actually violating this. No dependency contains a superkey
on its left side.
c. Is the decomposition (A,B,C,D) (B,C,D,E,F) a dependency preserving decomposition? If not,
explain briefly.
Yes, AB → C and DC → A are preserved in the first relation. DC → E and E → F are preserved
in the second relation.
5. You are given the below functional dependencies for relation R(A,B,C,D,E), F =
{AB → C,AB → D,D → A,BC → D,BC → E}.
a. Is this relation is in BCNF? If not, show all dependencies that violate it.
b. Is this relation in 3NF? If not, show all dependencies that violate it.
c. Is the following dependency implied by the above set of dependencies? If so, show how using
the Amstrong’s Axioms: ABC → AE
Answer:
Keys for the relation: {A,B}, {B,D}, {B,C}.
a. Not in BCNF since D → A does have a super key on the left hand side.
b. In 3NF since in D → A, A is part of a key.
c. BC → E (given)
ABC → AE by the augmentation rule.
6. You are given the below set of functional dependencies for a relation R(A,B,C,D,E,F,G),
F = {AD → BF,CD → EGC,BD → F,E → D, F → C,D → F}.
a. Find the minimal cover for the above set of functional dependencies
b. Using the functional dependencies that you computed in step a, find the keys for this relation.
Is it in BCNF? Explain your reasoning.
c. Suppose we decompose the above relation into the following two relations:
R1(A,B,C,D,E) R2(A,D,F,G)
Use the functional dependencies in the minimal cover. For each relation, write down the
functional dependencies that fall within that relation
(you can decompose a dependency of the form AD → BF into two i.e. AD → B and AD → F
when computing this).
Answers.
a.
Step 1.
{AD → B,AD → F,CD → E,CD → G,CD → C,BD → F,E → D, F → C,D → F}
Step 2. removeCD → C, AD → F, and BD → F.
{AD → B,CD → E,CD → G, F → C,D → F,E → D}
Step 3. remove D from CD → E and CD → G
{AD → B,D → E,D → G, F → C,D → F,E → D}
Finally recombine
{AD → B,D → EGF, F → C,E → D}.
b. Keys: {A,D}, {A,E}. Not in BCNF since the last three functional dependencies do not have a
superkey on the left hand side.
c. R1(A,B,C,D,E) Dependencies: AD → B,D → E,E → D R2(A,D,F,G) Dependencies: D →
GF.
Not functional dependency preserving, the dependency F → C is not preserved.
head(R1)  head(R2) = {A,D}
R1: AD → ABCDE is not true since C is not implied by A,D
R2: AD → ADFG is true since this is implied by D → GF as follows:
AD → AD inclusion rule, since D → GF, use set accumulation rule, AD → ADGF. Hence, this
is a lossless decomposition.
7. You are given the following set F of functional dependencies for a relation R(A,B,C,D,E,F):
F = {ABC → D,ABD → E,CD → F,CDF → B,BF → D}.
a. Find all keys of R based on these functional dependencies.
b. Is this relation in Boyce-Codd Normal Form? Is it 3NF? Explain your answers.
c. Can the set F be simplified (by removing functional dependencies or by removing attributes
from the left hand side of functional dependencies) without changing the closure of F (i.e. F+)?
Hint. Consider the steps of the minimal cover algorithm. Do any of them apply to this functional
dependency?
Answer.
a. Keys: {A,B,C} and {A,C,D}
b. It is not in BCNF. Counterexample ABD → E and ABD is not a superkey.
It is not in 3NF. Counterexample ABD → E, and ABD is not a superkey and E is not prime
attribute (part of a key).
c. Let F’ be obtained by replacing CDF → B with CD → B.
According to F and F’, CD+ = {C, D, B, F}. Hence, we can remove F from this functional
dependency without changing the meaning of the system.
8. Consider the relation R(V, W, X, Y, Z) with functional dependencies {Z → Y, Y → Z,X →
Y,X → V, VW → X}.
a) List the possible keys for relation R based on the functional dependencies above.
b) Show the closure for attribute X given the functional dependencies above.
c) Suppose that relation R is decomposed into two relations, R1(V, W, X) and R2(X, Y, Z). Is
this decomposition a lossless decomposition? Explain your answer.
Answer.
a. {V,W}, {X,W}
b. X+ = {X, V, Y,Z}
c. Yes it is lossless. To be lossless the attributes in common between the two relations must
functionally determine all the attributes in one of the two relations. The only attribute in common
is X and it functionally determines all the attributes in R2.
9. Given relation R(W, X, Y, Z) and set of functional dependencies F = {X → W,WZ → XY, Y
→ WXZ}. Compute the minimal cover for F.
Answer.
Step 1: X → W,WZ → X,WZ → Y, Y → W, Y → X, Y → Z
Step 2: Don’t need WZ → X, since WZ → Y and Y → X
Don’t need Y → W, since Y → X and X → W
This leaves {X → WWZ → Y, Y → X, Y → Z}
Step 3: Only need to consider WZ → Y . Can’t eliminate W or Z. So nothing is eliminated.
Step 4: {X → WWZ → Y, Y → XZ} is the minimal cover
10. Given relation R(W, X, Y, Z) and set of functional dependencies G = {Z → W, Y → XZ,XW
→ Y }, where G is a minimal cover:
a) Decompose R into a set of relations in Third Normal Form.
b)Is your decomposition in part a) also in Boyce Codd Normal Form? Explain your answer.
Answer.
a. Possible keys: {Y }, {X,Z}, {W,X}
R1=(Z, W), R2=(X, Y, Z), R3=(X, Y, W)
b.Yes. In each of the three relations, the left side of the funcational dependencies that apply are
superkeys for the relation. Hence, all three relations satisfy the definition of BCNF.
11. Find 3NF decomposition of the following relational schema:
R = {Faculty, Dean, Dept, Chairperson, Professor, Rank, Student}
with the set of functional dependencies,
F = {Faculty → Dean, Dept → Chairperson, Professor → {Rank, Chairperson}, Dept → Faculty,
Student → {Dept, Faculty, Dean}, Dean→ Faculty, {Professor, Rank} → {Dept, Faculty}}
Answer: Solution already provided.
12. Consider the given relation EMP_DEPT (ENAME, SSN, BDATE, ADD, DNO, DNAME,
DMGRSSN) with the set G of the function dependencies:
G = {(SSN →ENAME, BDATE, DNO), (ENAME→ ADD), (DNO →DNAME, DMGRSSN)}
Find the key of the relation with respect to G and normalize the relation up to 3NF.
13. Consider the following functional dependencies in a database.
Date_of_Birth->Age, Age->Eligibility, Name->Roll_number, Roll_number->Name,
Course_number->Course_name, Course_number->Instructor, (Roll_number,Course_number)-
>Grade
What normal form does the relation (Roll_number, Name, Date_of_birth, Age) follow? Give
reasons for your answer.
Answer: The above schema is in 1NF since the key of schema (Roll_number, Name, Date_of_birth,
Age) is either of the two: (Roll_number, Date_of_birth) or (Name, Date_of_birth) but since
Date_of_Birth->Age is a partial dependency, the schema is not in 2NF hence it is in 1NF.
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Shalabh Chaudhary [GLAU]
TIME : 30 mins DBMS QUIZ TOTAL MARKS : 25
NAME: SHALABH CHAUDHARY SEM: III
1. Which normal form is considered adequate for normal relational database design?
(a) 2NF (b) 5NF (c) 4NF (d) 3NF
2. Which of the following is TRUE?
(a) Every relation in 2NF is also in BCNF
(b) A relation R is in 3NF if every non-prime attribute of R is fully functionally dependent on every key of R
(c) Every relation in BCNF is also in 3NF
(d) No relation can be in both BCNF and 3NF
3.The employee information in a company is stored in the relation
Employee (name, sex, salary, deptName)
Consider the following SQL query
Select deptName From Employee Where sex = ‘M’ Group by deptName Having avg(salary) > (select avg (salary) from
Employee)
It returns the names of the department in which
(a) the average salary is more than the average salary in the company
(b) the average salary of male employees is more than the average salary of all male employees in the company
(c) the average salary of male employees is more than the average salary of
employees in the same department.
(d) the average salary of male employees is more than the average salary in the company
4. Assume that, in the suppliers relation above, each supplier and each street within a city has a unique name, and (sname, city)
forms a candidate key. No other functional dependencies are implied other than those implied by primary and candidate keys.
Which one of the following is TRUE about the above schema?
(a) The schema is in BCNF (b) The schema is in 3NF but not in BCNF
(c) The schema is in 2NF but not in 3NF (d) The schema is not in 2NF
5. Relation R has eight attributes ABCDEFGH. Fields of R contain only atomic values. F={CH→G, A→BC, B→CFH, E→A,
F→EG} is a set of functional dependencies (FDs) so that F + is exactly the set of FDs that hold for R.
How many candidate keys does the relation R have?
(a) 3 (b) 4 (c) 5 (d) 6
6. The relation R is
(a) in 1NF, but not in 2NF. (b) in 2NF, but not in 3NF. (c) in 3NF, but not in BCNF. (d) in BCNF.
7. The ................. is related to the concept of multi-valued dependency.
A) fourth normal form B) boyce codd normal form C) fifth normal form D) third normal form
8. A table is in BCNF if it is in 3NF and if every determinant is a ............... key.
A) dependent B) normal C) candidate D) Both B & C
9. A table is in 3NF if it is in 2NF and if it has no ......................
A) functional dependencies B) transitive dependencies
C) trivial functional dependency D) multivalued dependencies
10. Consider a relation with 3 attributes. How many maximum candidate keys could be atmost at the same time?
A. 2 B. 3 C. 4 D. 5
11. Let F = {AB-> C, AC-> B, B->D, BC->A} is set of FD of R(A,B,C,D). How many no of functional dependencies can you
get in the minimal cover of F?
A. 3 B. 4 C. 5 D. 6
12. Consider a relation R(ABCD) with FD's {A-> D, B ->D, D->BC} which is decomposed into R1(AB) and R2(BCD).
Which of the following is true?
A. Lossless join and dependency preserving decomposition B. Lossless join but not dependency preserving decomposition
Shalabh Chaudhary [GLAU]
C. Lossy join and dependency preserving decomposition D. Lossy join and not dependency preserving decomposition
13. Consider a relation R(ABCDE) with FD's {A->D,B->C,D->E,CE->B}. If we project R onto schema(ABC), what is true
about the keys of ABC?
A.Only A is the key B. Only AB is the key C. Only AB,AC are keys D. Only AB, BC, AC keys
14. A relation R(ABCD) has FD's F = {A->C, B->D}. How many minimal no of relational tables require lossless join and
dependency preserving BCNF decomposition?
A. 2 B. 3 C. 4 D. 5
15. Consider a relation R(ABCDE) with FD's F = {A->BC,C->D,B->E,A->E,B->A}. Which of the following is true regarding
R?
A. BC is superkey but not candidate key B. AC is candidate key so also superkey
C. There is only one candidate key of R D. None of these.
16. A relation R(ABCD) with F ={AB->C,C->D,D->C,A->B} is in
A. 1NF but not in 2NF B. 2NF but not in 3NF C. 3NF but not in BCNF D. BCNF
17. Consider a relation R(ABCDEFG) with F = {A->B,B->C,C->D,D->E,E->F,F->A}. Find the no of candidate keys?
A. 1 B. 3 C. 4 D. 6
18. Find the highest normal form of R?
A. 1NF B.2NF C. 3NF D. BCNF
19. For which of the following set of FD's, the relation R(ABCDE) is in 3NF but not in BCNF.
I. AB->CD, B->E,AC->BD II. A->B,BC->E,ED->A III. A->B,B->C,C->D,D->E,E->A IV. AB->CD,AC->BED,D->A
A. I,II,III,IV B. II,III C. II only D. II,IV
20. Consider a relation R(ABCD) with functional dependency as A->B,AB->C,BC->D. Find the minimal cover.
A. A->B,B->D B. AB->C,C->D C. A->B,A->C,BC->D D. A->D
21. Consider a relation R(ABCDE) with FD's {A->B,B->C,D->E}. Find the next higher normal form decomposition set for R?
A. D={R1(AB), R2(BC), R3(DE)} B. {R1(ABC),R2(CD),R3(DE)}
C. D={R1(ABC), R2(CDE)} D. D={R1(AB), R2(BC), R3(DE)}
22. Given R(ABCDE) with FD's AB->C,DE->C,B->D. Indicate all 3NF violations?
A. AB->C,DE->C B. AB->C,B->D C. AB->C,DE->C and B->D D. None of these
23. 14. A relation R(ABCD) has FD's F = {A->C, B->D}. Find the highest normal form?
A. 1NF B.2NF C. 3NF D. BCNF
24. Consider a relation R(ABCDE) with FD's {A->D,B->C,D->E,CE->B}. Find the highest normal form?
A. 1NF B.2NF C. 3NF D. BCNF
25. Consider relation R(ABCD) as follows:
A B C D
a b z 1
e b r 1
a d z 1
e d r 1
a f z 2
e f r 2
Find the total no of functional dependencies possible?(Ignore self dependencies such as A->A or B->B or AB->AB)
A.10 B.15 C. 12 D. 9
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner

Mais conteúdo relacionado

Mais procurados

Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in DatabaseRoshni Singh
 
SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...
SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...
SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...vtunotesbysree
 
Architectural modeling chapter 5 of omd
Architectural modeling chapter 5 of omdArchitectural modeling chapter 5 of omd
Architectural modeling chapter 5 of omdjayashri kolekar
 
Dbms 7: ER Diagram Design Issue
Dbms 7: ER Diagram Design IssueDbms 7: ER Diagram Design Issue
Dbms 7: ER Diagram Design IssueAmiya9439793168
 
Distributed Query Processing
Distributed Query ProcessingDistributed Query Processing
Distributed Query ProcessingMythili Kannan
 
Load Balancing in Parallel and Distributed Database
Load Balancing in Parallel and Distributed DatabaseLoad Balancing in Parallel and Distributed Database
Load Balancing in Parallel and Distributed DatabaseMd. Shamsur Rahim
 
Naming in Distributed Systems
Naming in Distributed SystemsNaming in Distributed Systems
Naming in Distributed SystemsNandakumar P
 
Decomposition methods in DBMS
Decomposition methods in DBMSDecomposition methods in DBMS
Decomposition methods in DBMSsoniyagoyal3
 
Relational Algebra and Calculus.ppt
Relational Algebra and Calculus.pptRelational Algebra and Calculus.ppt
Relational Algebra and Calculus.pptAnkush138
 

Mais procurados (20)

Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in Database
 
SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...
SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...
SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...
 
Architectural modeling chapter 5 of omd
Architectural modeling chapter 5 of omdArchitectural modeling chapter 5 of omd
Architectural modeling chapter 5 of omd
 
Dempster shafer theory
Dempster shafer theoryDempster shafer theory
Dempster shafer theory
 
DBMS Canonical cover
DBMS Canonical coverDBMS Canonical cover
DBMS Canonical cover
 
And or graph
And or graphAnd or graph
And or graph
 
Relational model
Relational modelRelational model
Relational model
 
Dbms 7: ER Diagram Design Issue
Dbms 7: ER Diagram Design IssueDbms 7: ER Diagram Design Issue
Dbms 7: ER Diagram Design Issue
 
Schedule in DBMS
Schedule in DBMSSchedule in DBMS
Schedule in DBMS
 
Distributed Query Processing
Distributed Query ProcessingDistributed Query Processing
Distributed Query Processing
 
Predicate logic
 Predicate logic Predicate logic
Predicate logic
 
Load Balancing in Parallel and Distributed Database
Load Balancing in Parallel and Distributed DatabaseLoad Balancing in Parallel and Distributed Database
Load Balancing in Parallel and Distributed Database
 
Naming in Distributed Systems
Naming in Distributed SystemsNaming in Distributed Systems
Naming in Distributed Systems
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
Decomposition methods in DBMS
Decomposition methods in DBMSDecomposition methods in DBMS
Decomposition methods in DBMS
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Recovery system
Recovery systemRecovery system
Recovery system
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Distributed database
Distributed databaseDistributed database
Distributed database
 
Relational Algebra and Calculus.ppt
Relational Algebra and Calculus.pptRelational Algebra and Calculus.ppt
Relational Algebra and Calculus.ppt
 

Semelhante a Database Management System [DBMS]

Database normalization
Database normalizationDatabase normalization
Database normalizationVARSHAKUMARI49
 
JEE+Crash+course+_+Phase+I+_+Session+1+_+Sets+and++Relations+&+Functions+_+7t...
JEE+Crash+course+_+Phase+I+_+Session+1+_+Sets+and++Relations+&+Functions+_+7t...JEE+Crash+course+_+Phase+I+_+Session+1+_+Sets+and++Relations+&+Functions+_+7t...
JEE+Crash+course+_+Phase+I+_+Session+1+_+Sets+and++Relations+&+Functions+_+7t...7anantsharma7
 
Relations and function class xii copy
Relations and function class xii   copyRelations and function class xii   copy
Relations and function class xii copycsanjeive
 
MODULE 4 -Normalization_1.ppt
MODULE 4 -Normalization_1.pptMODULE 4 -Normalization_1.ppt
MODULE 4 -Normalization_1.pptBelkinAntony1
 
Relations and Functions #BB2.0.pdf
Relations and Functions #BB2.0.pdfRelations and Functions #BB2.0.pdf
Relations and Functions #BB2.0.pdfAakashKushwaha26
 
24042020_normalization 1.pdf
24042020_normalization 1.pdf24042020_normalization 1.pdf
24042020_normalization 1.pdfShivani139202
 
DBMS FDs and Normalization.pptx
DBMS FDs and Normalization.pptxDBMS FDs and Normalization.pptx
DBMS FDs and Normalization.pptxSakshamLal3
 
Modules Linear Algebra Drills
Modules Linear Algebra DrillsModules Linear Algebra Drills
Modules Linear Algebra DrillsDaniel Bragais
 
MATH 107 FINAL EXAMINATIONMULTIPLE CHOICE1. Deter.docx
MATH 107 FINAL EXAMINATIONMULTIPLE CHOICE1. Deter.docxMATH 107 FINAL EXAMINATIONMULTIPLE CHOICE1. Deter.docx
MATH 107 FINAL EXAMINATIONMULTIPLE CHOICE1. Deter.docxTatianaMajor22
 
Integration material
Integration material Integration material
Integration material Surya Swaroop
 
2.1 Basics of Functions and Their Graphs
2.1 Basics of Functions and Their Graphs2.1 Basics of Functions and Their Graphs
2.1 Basics of Functions and Their Graphssmiller5
 
DBMS-Normalization.ppt
DBMS-Normalization.pptDBMS-Normalization.ppt
DBMS-Normalization.pptKalpanaThakre2
 

Semelhante a Database Management System [DBMS] (20)

Database normalization
Database normalizationDatabase normalization
Database normalization
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
JEE+Crash+course+_+Phase+I+_+Session+1+_+Sets+and++Relations+&+Functions+_+7t...
JEE+Crash+course+_+Phase+I+_+Session+1+_+Sets+and++Relations+&+Functions+_+7t...JEE+Crash+course+_+Phase+I+_+Session+1+_+Sets+and++Relations+&+Functions+_+7t...
JEE+Crash+course+_+Phase+I+_+Session+1+_+Sets+and++Relations+&+Functions+_+7t...
 
UNIT 2 -PPT.pptx
UNIT 2 -PPT.pptxUNIT 2 -PPT.pptx
UNIT 2 -PPT.pptx
 
Cs501 fd nf
Cs501 fd nfCs501 fd nf
Cs501 fd nf
 
Relations and function class xii copy
Relations and function class xii   copyRelations and function class xii   copy
Relations and function class xii copy
 
MODULE 4 -Normalization_1.ppt
MODULE 4 -Normalization_1.pptMODULE 4 -Normalization_1.ppt
MODULE 4 -Normalization_1.ppt
 
Dependency preserving
Dependency preservingDependency preserving
Dependency preserving
 
Relations and Functions #BB2.0.pdf
Relations and Functions #BB2.0.pdfRelations and Functions #BB2.0.pdf
Relations and Functions #BB2.0.pdf
 
test
testtest
test
 
24042020_normalization 1.pdf
24042020_normalization 1.pdf24042020_normalization 1.pdf
24042020_normalization 1.pdf
 
DBMS FDs and Normalization.pptx
DBMS FDs and Normalization.pptxDBMS FDs and Normalization.pptx
DBMS FDs and Normalization.pptx
 
Modules Linear Algebra Drills
Modules Linear Algebra DrillsModules Linear Algebra Drills
Modules Linear Algebra Drills
 
MATH 107 FINAL EXAMINATIONMULTIPLE CHOICE1. Deter.docx
MATH 107 FINAL EXAMINATIONMULTIPLE CHOICE1. Deter.docxMATH 107 FINAL EXAMINATIONMULTIPLE CHOICE1. Deter.docx
MATH 107 FINAL EXAMINATIONMULTIPLE CHOICE1. Deter.docx
 
Integration material
Integration material Integration material
Integration material
 
Integration
IntegrationIntegration
Integration
 
Functions
FunctionsFunctions
Functions
 
2.1 Basics of Functions and Their Graphs
2.1 Basics of Functions and Their Graphs2.1 Basics of Functions and Their Graphs
2.1 Basics of Functions and Their Graphs
 
Assignment#16
Assignment#16Assignment#16
Assignment#16
 
DBMS-Normalization.ppt
DBMS-Normalization.pptDBMS-Normalization.ppt
DBMS-Normalization.ppt
 

Mais de Shalabh Chaudhary

Mais de Shalabh Chaudhary (15)

Everything about Zoho Workplace
Everything about Zoho WorkplaceEverything about Zoho Workplace
Everything about Zoho Workplace
 
C Pointers & File Handling
C Pointers & File HandlingC Pointers & File Handling
C Pointers & File Handling
 
C MCQ & Basic Coding
C MCQ & Basic CodingC MCQ & Basic Coding
C MCQ & Basic Coding
 
PL-SQL, Cursors & Triggers
PL-SQL, Cursors & TriggersPL-SQL, Cursors & Triggers
PL-SQL, Cursors & Triggers
 
Soft Computing [NN,Fuzzy,GA] Notes
Soft Computing [NN,Fuzzy,GA] NotesSoft Computing [NN,Fuzzy,GA] Notes
Soft Computing [NN,Fuzzy,GA] Notes
 
Software Engineering (SE) Notes
Software Engineering (SE) NotesSoftware Engineering (SE) Notes
Software Engineering (SE) Notes
 
Operating System (OS) Notes
Operating System (OS) NotesOperating System (OS) Notes
Operating System (OS) Notes
 
Data Communication & Networking Notes
Data Communication & Networking NotesData Communication & Networking Notes
Data Communication & Networking Notes
 
Java Basics for Interview
Java Basics for InterviewJava Basics for Interview
Java Basics for Interview
 
Collections in Java Notes
Collections in Java NotesCollections in Java Notes
Collections in Java Notes
 
OOPs & Inheritance Notes
OOPs & Inheritance NotesOOPs & Inheritance Notes
OOPs & Inheritance Notes
 
Java Fundamentals
Java FundamentalsJava Fundamentals
Java Fundamentals
 
Unified Modeling Language(UML) Notes
Unified Modeling Language(UML) NotesUnified Modeling Language(UML) Notes
Unified Modeling Language(UML) Notes
 
Advanced JAVA Notes
Advanced JAVA NotesAdvanced JAVA Notes
Advanced JAVA Notes
 
Core JAVA Notes
Core JAVA NotesCore JAVA Notes
Core JAVA Notes
 

Último

Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 

Último (20)

DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 

Database Management System [DBMS]

  • 24. SOLUTION ASSIGNMENT - 2 Department: Department of Computer Engineering & Applications Subject Name & Code: Database Management System (CSE 3003) 1. Suppose you are given a relation R = (A,B,C,D,E) with the following functional dependencies: {CE → D,D → B,C → A}. a. Find all candidate keys. b. Identify the best normal form that R satisfies (1NF, 2NF, 3NF, or BCNF). c. If the relation is not in BCNF, decompose it until it becomes BCNF. At each step, identify a new relation, decompose and re-compute the keys and the normal forms they satisfy. Answer: a. The only key is {C, E} b. The relation is in 1NF c. Decompose into R1=(A,C) and R2=(B,C,D,E). R1 is in BCNF, R2 is in 2NF. Decompose R2 into, R21=(C,D,E) and R22=(B,D). Both relations are in BCNF. 2. Suppose you are given a relation R=(A,B,C,D,E) with the following functional dependencies: {BC → ADE, D → B}. a. Find all candidate keys. b. Identify the best normal form that R satisfies (1NF, 2NF, 3NF, or BCNF). c. If the relation is not in BCNF, decompose it until it becomes BCNF. At each step, identify a new relation, decompose and re-compute the keys and the normal forms they satisfy. Answer: a. The keys are {B,C} and {C,D} b. The relation is in 3NF c. It cannot be put into BCNF, even if I remove D and put into a relation of the form (B, C, D) (I need C for the functional dependency), the resulting relation would not be in BCNF. 3. Suppose you are given a relation R=(A,B,C,D,E) with the following functional dependencies: BD → E,A → C. a. Show that the decomposition into R1=(A,B,C) and R2=(D,E) is lossy. b. Find a single dependency from a single attribute X to another attribute Y such that when you add the dependency X → Y to the above dependencies, the decomposition in part a is no longer lossy. Answer: a. intersection of R1 and R2 is ф hence this decomposition cannot be shown as lossless hence it is lossy. b. This decomposition cannot be made lossless. The problem is there is no longer a way to make sure BD → E holds across two relations since they do not share any attributes. However, a lossy decomposition of the form (A,B,C), (C,D,E) can be made lossless by adding an FD B → C. 4. You are given the following set of functional dependencies for a relation R(A,B,C,D,E,F), F = {AB → C,DC → AE,E → F}. a. What are the keys of this relation? b. Is this relation in BCNF? If not, explain why by showing one violation.
  • 25. c. Is the decomposition (A,B,C,D) (B,C,D,E,F) a dependency preserving decomposition? If not, explain briefly. Answer. a. What are the keys of this relation? {A,B,D} and {B,C,D}. b. Is this relation in BCNF? If not, explain why by showing one violation. No, all functional dependencies are actually violating this. No dependency contains a superkey on its left side. c. Is the decomposition (A,B,C,D) (B,C,D,E,F) a dependency preserving decomposition? If not, explain briefly. Yes, AB → C and DC → A are preserved in the first relation. DC → E and E → F are preserved in the second relation. 5. You are given the below functional dependencies for relation R(A,B,C,D,E), F = {AB → C,AB → D,D → A,BC → D,BC → E}. a. Is this relation is in BCNF? If not, show all dependencies that violate it. b. Is this relation in 3NF? If not, show all dependencies that violate it. c. Is the following dependency implied by the above set of dependencies? If so, show how using the Amstrong’s Axioms: ABC → AE Answer: Keys for the relation: {A,B}, {B,D}, {B,C}. a. Not in BCNF since D → A does have a super key on the left hand side. b. In 3NF since in D → A, A is part of a key. c. BC → E (given) ABC → AE by the augmentation rule. 6. You are given the below set of functional dependencies for a relation R(A,B,C,D,E,F,G), F = {AD → BF,CD → EGC,BD → F,E → D, F → C,D → F}. a. Find the minimal cover for the above set of functional dependencies b. Using the functional dependencies that you computed in step a, find the keys for this relation. Is it in BCNF? Explain your reasoning. c. Suppose we decompose the above relation into the following two relations: R1(A,B,C,D,E) R2(A,D,F,G) Use the functional dependencies in the minimal cover. For each relation, write down the functional dependencies that fall within that relation (you can decompose a dependency of the form AD → BF into two i.e. AD → B and AD → F when computing this). Answers. a. Step 1. {AD → B,AD → F,CD → E,CD → G,CD → C,BD → F,E → D, F → C,D → F} Step 2. removeCD → C, AD → F, and BD → F. {AD → B,CD → E,CD → G, F → C,D → F,E → D} Step 3. remove D from CD → E and CD → G {AD → B,D → E,D → G, F → C,D → F,E → D} Finally recombine {AD → B,D → EGF, F → C,E → D}.
  • 26. b. Keys: {A,D}, {A,E}. Not in BCNF since the last three functional dependencies do not have a superkey on the left hand side. c. R1(A,B,C,D,E) Dependencies: AD → B,D → E,E → D R2(A,D,F,G) Dependencies: D → GF. Not functional dependency preserving, the dependency F → C is not preserved. head(R1) head(R2) = {A,D} R1: AD → ABCDE is not true since C is not implied by A,D R2: AD → ADFG is true since this is implied by D → GF as follows: AD → AD inclusion rule, since D → GF, use set accumulation rule, AD → ADGF. Hence, this is a lossless decomposition. 7. You are given the following set F of functional dependencies for a relation R(A,B,C,D,E,F): F = {ABC → D,ABD → E,CD → F,CDF → B,BF → D}. a. Find all keys of R based on these functional dependencies. b. Is this relation in Boyce-Codd Normal Form? Is it 3NF? Explain your answers. c. Can the set F be simplified (by removing functional dependencies or by removing attributes from the left hand side of functional dependencies) without changing the closure of F (i.e. F+)? Hint. Consider the steps of the minimal cover algorithm. Do any of them apply to this functional dependency? Answer. a. Keys: {A,B,C} and {A,C,D} b. It is not in BCNF. Counterexample ABD → E and ABD is not a superkey. It is not in 3NF. Counterexample ABD → E, and ABD is not a superkey and E is not prime attribute (part of a key). c. Let F’ be obtained by replacing CDF → B with CD → B. According to F and F’, CD+ = {C, D, B, F}. Hence, we can remove F from this functional dependency without changing the meaning of the system. 8. Consider the relation R(V, W, X, Y, Z) with functional dependencies {Z → Y, Y → Z,X → Y,X → V, VW → X}. a) List the possible keys for relation R based on the functional dependencies above. b) Show the closure for attribute X given the functional dependencies above. c) Suppose that relation R is decomposed into two relations, R1(V, W, X) and R2(X, Y, Z). Is this decomposition a lossless decomposition? Explain your answer. Answer. a. {V,W}, {X,W} b. X+ = {X, V, Y,Z} c. Yes it is lossless. To be lossless the attributes in common between the two relations must functionally determine all the attributes in one of the two relations. The only attribute in common is X and it functionally determines all the attributes in R2. 9. Given relation R(W, X, Y, Z) and set of functional dependencies F = {X → W,WZ → XY, Y → WXZ}. Compute the minimal cover for F. Answer. Step 1: X → W,WZ → X,WZ → Y, Y → W, Y → X, Y → Z Step 2: Don’t need WZ → X, since WZ → Y and Y → X Don’t need Y → W, since Y → X and X → W This leaves {X → WWZ → Y, Y → X, Y → Z} Step 3: Only need to consider WZ → Y . Can’t eliminate W or Z. So nothing is eliminated.
  • 27. Step 4: {X → WWZ → Y, Y → XZ} is the minimal cover 10. Given relation R(W, X, Y, Z) and set of functional dependencies G = {Z → W, Y → XZ,XW → Y }, where G is a minimal cover: a) Decompose R into a set of relations in Third Normal Form. b)Is your decomposition in part a) also in Boyce Codd Normal Form? Explain your answer. Answer. a. Possible keys: {Y }, {X,Z}, {W,X} R1=(Z, W), R2=(X, Y, Z), R3=(X, Y, W) b.Yes. In each of the three relations, the left side of the funcational dependencies that apply are superkeys for the relation. Hence, all three relations satisfy the definition of BCNF. 11. Find 3NF decomposition of the following relational schema: R = {Faculty, Dean, Dept, Chairperson, Professor, Rank, Student} with the set of functional dependencies, F = {Faculty → Dean, Dept → Chairperson, Professor → {Rank, Chairperson}, Dept → Faculty, Student → {Dept, Faculty, Dean}, Dean→ Faculty, {Professor, Rank} → {Dept, Faculty}} Answer: Solution already provided. 12. Consider the given relation EMP_DEPT (ENAME, SSN, BDATE, ADD, DNO, DNAME, DMGRSSN) with the set G of the function dependencies: G = {(SSN →ENAME, BDATE, DNO), (ENAME→ ADD), (DNO →DNAME, DMGRSSN)} Find the key of the relation with respect to G and normalize the relation up to 3NF. 13. Consider the following functional dependencies in a database. Date_of_Birth->Age, Age->Eligibility, Name->Roll_number, Roll_number->Name, Course_number->Course_name, Course_number->Instructor, (Roll_number,Course_number)- >Grade What normal form does the relation (Roll_number, Name, Date_of_birth, Age) follow? Give reasons for your answer. Answer: The above schema is in 1NF since the key of schema (Roll_number, Name, Date_of_birth, Age) is either of the two: (Roll_number, Date_of_birth) or (Name, Date_of_birth) but since Date_of_Birth->Age is a partial dependency, the schema is not in 2NF hence it is in 1NF.
  • 32. Shalabh Chaudhary [GLAU] TIME : 30 mins DBMS QUIZ TOTAL MARKS : 25 NAME: SHALABH CHAUDHARY SEM: III 1. Which normal form is considered adequate for normal relational database design? (a) 2NF (b) 5NF (c) 4NF (d) 3NF 2. Which of the following is TRUE? (a) Every relation in 2NF is also in BCNF (b) A relation R is in 3NF if every non-prime attribute of R is fully functionally dependent on every key of R (c) Every relation in BCNF is also in 3NF (d) No relation can be in both BCNF and 3NF 3.The employee information in a company is stored in the relation Employee (name, sex, salary, deptName) Consider the following SQL query Select deptName From Employee Where sex = ‘M’ Group by deptName Having avg(salary) > (select avg (salary) from Employee) It returns the names of the department in which (a) the average salary is more than the average salary in the company (b) the average salary of male employees is more than the average salary of all male employees in the company (c) the average salary of male employees is more than the average salary of employees in the same department. (d) the average salary of male employees is more than the average salary in the company 4. Assume that, in the suppliers relation above, each supplier and each street within a city has a unique name, and (sname, city) forms a candidate key. No other functional dependencies are implied other than those implied by primary and candidate keys. Which one of the following is TRUE about the above schema? (a) The schema is in BCNF (b) The schema is in 3NF but not in BCNF (c) The schema is in 2NF but not in 3NF (d) The schema is not in 2NF 5. Relation R has eight attributes ABCDEFGH. Fields of R contain only atomic values. F={CH→G, A→BC, B→CFH, E→A, F→EG} is a set of functional dependencies (FDs) so that F + is exactly the set of FDs that hold for R. How many candidate keys does the relation R have? (a) 3 (b) 4 (c) 5 (d) 6 6. The relation R is (a) in 1NF, but not in 2NF. (b) in 2NF, but not in 3NF. (c) in 3NF, but not in BCNF. (d) in BCNF. 7. The ................. is related to the concept of multi-valued dependency. A) fourth normal form B) boyce codd normal form C) fifth normal form D) third normal form 8. A table is in BCNF if it is in 3NF and if every determinant is a ............... key. A) dependent B) normal C) candidate D) Both B & C 9. A table is in 3NF if it is in 2NF and if it has no ...................... A) functional dependencies B) transitive dependencies C) trivial functional dependency D) multivalued dependencies 10. Consider a relation with 3 attributes. How many maximum candidate keys could be atmost at the same time? A. 2 B. 3 C. 4 D. 5 11. Let F = {AB-> C, AC-> B, B->D, BC->A} is set of FD of R(A,B,C,D). How many no of functional dependencies can you get in the minimal cover of F? A. 3 B. 4 C. 5 D. 6 12. Consider a relation R(ABCD) with FD's {A-> D, B ->D, D->BC} which is decomposed into R1(AB) and R2(BCD). Which of the following is true? A. Lossless join and dependency preserving decomposition B. Lossless join but not dependency preserving decomposition
  • 33. Shalabh Chaudhary [GLAU] C. Lossy join and dependency preserving decomposition D. Lossy join and not dependency preserving decomposition 13. Consider a relation R(ABCDE) with FD's {A->D,B->C,D->E,CE->B}. If we project R onto schema(ABC), what is true about the keys of ABC? A.Only A is the key B. Only AB is the key C. Only AB,AC are keys D. Only AB, BC, AC keys 14. A relation R(ABCD) has FD's F = {A->C, B->D}. How many minimal no of relational tables require lossless join and dependency preserving BCNF decomposition? A. 2 B. 3 C. 4 D. 5 15. Consider a relation R(ABCDE) with FD's F = {A->BC,C->D,B->E,A->E,B->A}. Which of the following is true regarding R? A. BC is superkey but not candidate key B. AC is candidate key so also superkey C. There is only one candidate key of R D. None of these. 16. A relation R(ABCD) with F ={AB->C,C->D,D->C,A->B} is in A. 1NF but not in 2NF B. 2NF but not in 3NF C. 3NF but not in BCNF D. BCNF 17. Consider a relation R(ABCDEFG) with F = {A->B,B->C,C->D,D->E,E->F,F->A}. Find the no of candidate keys? A. 1 B. 3 C. 4 D. 6 18. Find the highest normal form of R? A. 1NF B.2NF C. 3NF D. BCNF 19. For which of the following set of FD's, the relation R(ABCDE) is in 3NF but not in BCNF. I. AB->CD, B->E,AC->BD II. A->B,BC->E,ED->A III. A->B,B->C,C->D,D->E,E->A IV. AB->CD,AC->BED,D->A A. I,II,III,IV B. II,III C. II only D. II,IV 20. Consider a relation R(ABCD) with functional dependency as A->B,AB->C,BC->D. Find the minimal cover. A. A->B,B->D B. AB->C,C->D C. A->B,A->C,BC->D D. A->D 21. Consider a relation R(ABCDE) with FD's {A->B,B->C,D->E}. Find the next higher normal form decomposition set for R? A. D={R1(AB), R2(BC), R3(DE)} B. {R1(ABC),R2(CD),R3(DE)} C. D={R1(ABC), R2(CDE)} D. D={R1(AB), R2(BC), R3(DE)} 22. Given R(ABCDE) with FD's AB->C,DE->C,B->D. Indicate all 3NF violations? A. AB->C,DE->C B. AB->C,B->D C. AB->C,DE->C and B->D D. None of these 23. 14. A relation R(ABCD) has FD's F = {A->C, B->D}. Find the highest normal form? A. 1NF B.2NF C. 3NF D. BCNF 24. Consider a relation R(ABCDE) with FD's {A->D,B->C,D->E,CE->B}. Find the highest normal form? A. 1NF B.2NF C. 3NF D. BCNF 25. Consider relation R(ABCD) as follows: A B C D a b z 1 e b r 1 a d z 1 e d r 1 a f z 2 e f r 2 Find the total no of functional dependencies possible?(Ignore self dependencies such as A->A or B->B or AB->AB) A.10 B.15 C. 12 D. 9