Question

Q2: Explain with example the difference between super keys and functional dependencies in relational databases. Show...

Q2: Explain with example the difference between super keys and functional dependencies in relational databases. Show how to find a key (super/candidate) for the following functional dependencies:

? = {?,?,?,?,?,?,?,?,?,?,?,?,?}
? = {?→????,?→???,?→?,??→?,??→?}
0 0
Add a comment Improve this question Transcribed image text
Answer #1

A Super key is a combination of one or more than one attributes that can uniquely identify a row in the Relational Database

whereas

A Functionally dependency is used to show dependency of one attribute other other when one attribute can uniquely identify the other attribute

Like if we say A---> B then it means that A can uniquely determine B and Attribute B is functionally dependent on Attribute A

For Example

we have a Student Database

Stu_ID Stu_name Stu_Age
1 A 20
2 B 25
3 C 16
4 D 16

Here Stu_ID attribute uniquely identifies each row student table So it the super key

And

if we know Stu_ID we can tell the student name associated with it. This is known as functional dependency

We can write it as Stu_ID->Stu_Name

ii)

When we are given set of Functional Dependencies then to find the candidate key . we need to take attribute closure of set of attributes and the set that covers all the attributes in the closure That is the Candidate Key

All those attributes which can be functionally determined from an attribute set is called as a closure of that attribute Denoted as { Attribute name } +.

For example we have A-->BC C---->A

{A} + ={ A,B,C} {B}+ ={ B} {C}+ ={ A ,C}

Now we have

? = {?,?,?,?,?,?,?,?,?,?,?,?,?}

? = {?→????,?→???,?→?,??→?,??→?}

***Important Note*** :-->If any Attribute is not in RHS of Any Functional Dependency then it must be include in Key

So we have A ,I .L that are not present in The RHS of any FD's

Lets see their Closure

{ AIL} += { A B C D E F G H I J K M }

Hence we can get all attributed in closure

So Candidate Key is AIL

This is how you can get the key from given set of FD's

I hope that you understood the Concept so DO Like the answer and have any doubt ask in comment . I will reply asap

Add a comment
Know the answer?
Add Answer to:
Q2: Explain with example the difference between super keys and functional dependencies in relational databases. Show...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT