How to find candidate keys here in DBMS?

  • Context: Comp Sci 
  • Thread starter Thread starter shivajikobardan
  • Start date Start date
Click For Summary
SUMMARY

The discussion centers on identifying candidate keys for the relation SP(Sno, Sname, Pno, Qty), where Sname is unique for each Sno. The functional dependencies provided are Sno, Pno -> Qty; Sname, Pno -> Qty; Sno -> Sname; and Sname -> Sno. The primary key is identified as Sname, Sno, but the discussion raises questions about the uniqueness of Sno for each Sname and the necessity of both attributes in the primary key. The participant resolved their issue by referring to a candidate key calculator tool.

PREREQUISITES
  • Understanding of functional dependencies in relational databases
  • Knowledge of primary keys and candidate keys in DBMS
  • Familiarity with attribute closures in database theory
  • Basic concepts of relational schema design
NEXT STEPS
  • Explore how to compute attribute closures in relational databases
  • Learn about candidate key determination techniques in DBMS
  • Research the implications of functional dependencies on database normalization
  • Examine tools like candidate key calculators for practical applications
USEFUL FOR

Database students, data architects, and anyone involved in relational database design and normalization processes will benefit from this discussion.

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 ·
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
8
Views
5K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 1 ·
Replies
1
Views
12K
  • · Replies 21 ·
Replies
21
Views
6K
  • · Replies 26 ·
Replies
26
Views
7K
  • · Replies 1 ·
Replies
1
Views
5K