Comp Sci How to find candidate keys here in DBMS?

  • Thread starter Thread starter shivajikobardan
  • Start date Start date
AI Thread Summary
To find candidate keys in the relation SP(Sno, Sname, Pno, Qty), it is established that Sname is unique for each Sno, indicating a potential primary key of Sname and Sno. However, the uniqueness of Sno for each Sname is questioned, suggesting that additional clarification is needed regarding their definitions. The discussion highlights confusion around the necessity of both attributes for the primary key and the implications of functional dependencies. The concept of attribute closures is mentioned but deemed complex due to the two attributes on the left-hand side. Overall, further information is necessary to accurately determine the candidate keys in this database schema.
shivajikobardan
Messages
637
Reaction score
54
Homework Statement
find candidate keys
Relevant Equations
Normalization in database
Consider a relation given below SP(Sno,Sname,Pno,Qty). Here Sname is considered unique for each Sno. So, FD of above relation is:

Sno,Pno -> Qty
Sname,Pno -> Qty
Sno ->Sname
Sname->Sno

Sname,Sno is one primary key(it's worded in question). What's the other? How to find it is my question. I've heard about taking closures but here there are 2 attributes in the LHS so I can't see a way to do closures.
 
Physics news on Phys.org
It's hard to say much without more information, but I have some questions. You say that "Sname is considered unique for each Sno", but that does not necessarily mean that Sno is unique for each Sname. Is that true?
Does 'S' mean supplier? Does 'Sno' mean the Supplier part number for a part, or is it a number that you have given uniquely to each supplier?
Why do you need both Sname and Sno for a primary key?
Are you sure about Sname ->Sno? Are you saying that there can't be things from two different suppliers with the same name but different part numbers?

IMO, there is a lot left to guess at.
 

Similar threads

Replies
2
Views
996
Replies
1
Views
1K
Replies
6
Views
2K
Replies
1
Views
12K
Replies
14
Views
5K
Replies
1
Views
4K
Back
Top