Why Is Sno, Pno=>Qty, Sname=>Qty in 3NF?

  • Comp Sci
  • Thread starter shivajikobardan
  • Start date
In summary, the conversation discusses the concept of third normal form (3NF) and how it applies to the given functional dependencies (FDs). The participants agree that for the first two FDs (Sno,Pno=>Qty and Sname,Pno=>Qty), the LHS is a super key and the RHS is a non-prime attribute, making them in 3NF. However, there is a disagreement about the last two FDs (Sno=>Sname and Sname=>Sno). While one participant argues that they are not in 3NF because they do not follow the rule of LHS being a super key, the other participant points out that they serve as lookup tables to translate between sno and sname.
  • #1
shivajikobardan
674
54
Homework Statement
3NF third normal form
Relevant Equations
none
Sno,Pno=>Qty
Sname,Pno=>Qty
Sno=>Sname
Sname=>Sno

To be in 3NF, LHS should be super key and RHS should be non-prime attribute.
It holds true for first 2 FDs. But for the last two, it doesn't hold true. So, why is it in 3NF?
chatGPT says it holds true for all FDs, but I can't see how.
 
Physics news on Phys.org
  • #2
The last two look like lookup tables to translate between sno and sname. Given sno I can find sname and given sname I can find sno.
 
  • #3
shivajikobardan said:
Homework Statement:: 3NF third normal form
Relevant Equations:: none

Sno,Pno=>Qty
Sname,Pno=>Qty
Sno=>Sname
Sname=>Sno
This is impossible to answer without knowledge of what data are contained in the columns, however assuming Sname represents a person's name, and given the fact that two people can have the same name what do you think about your statement that Sname,Pno=>Qty is in 3NF?
 

FAQ: Why Is Sno, Pno=>Qty, Sname=>Qty in 3NF?

What is 3NF (Third Normal Form)?

Third Normal Form (3NF) is a database normalization stage that aims to reduce the duplication of data and ensure referential integrity by organizing the database into tables in such a way that every non-key attribute is non-transitively dependent on the primary key. This means that non-key attributes should depend only on the primary key and not on any other non-key attributes.

What is the significance of "Sno, Pno => Qty" in the context of 3NF?

"Sno, Pno => Qty" indicates that the combination of "Sno" (Supplier Number) and "Pno" (Part Number) uniquely determines the quantity (Qty). This means that Qty is functionally dependent on the composite key (Sno, Pno). For a table to be in 3NF, all non-key attributes must be fully functionally dependent on the primary key, which is satisfied by this relationship.

Why is "Sname => Qty" not in 3NF?

"Sname => Qty" suggests that the supplier name (Sname) determines the quantity (Qty), which implies a partial dependency if Sname is not part of the primary key. In 3NF, all non-key attributes must be fully functionally dependent on the whole primary key, not just part of it. If Sname is not a key or part of a composite key, this violates the rules of 3NF.

How does "Sno, Pno => Qty" ensure the table is in 3NF?

"Sno, Pno => Qty" ensures that Qty is fully functionally dependent on the composite primary key (Sno, Pno). This means there are no transitive dependencies where a non-key attribute depends on another non-key attribute. By ensuring that Qty depends only on the combination of Sno and Pno, the table adheres to the requirements of 3NF.

What steps should be taken if a table is not in 3NF due to "Sname => Qty"?

If a table is not in 3NF because of a dependency like "Sname => Qty," you should decompose the table to eliminate partial and transitive dependencies. This often involves creating new tables where each non-key attribute is fully functionally dependent on the primary key. For instance, you might separate the supplier information into one table and the part-supplier relationship into another, ensuring that each table adheres to 3NF.

Similar threads

Replies
2
Views
916
Replies
1
Views
1K
Replies
2
Views
1K
Replies
2
Views
4K
Replies
14
Views
5K
Replies
19
Views
2K
Replies
6
Views
2K
Replies
4
Views
3K
Back
Top