0
26kviews
Consider the following relation

CAR-SALE (Car#, Date-sold, Salesman#, commission%, Discount-amt)

Assume that {Car#, Salesman#} is the primary key. Additional dependencies are

Date-sold -> Discount-amt

Salesman# -> commission%

Based on the given primary key, is this relation in 1NF, 2NF or 3NF? Why or why not? How would you successively normalize it completely?

1 Answer
2
4.3kviews

1. Introduction:

Normalization is a process of achieving good database design. A database design needs some refinement which is achieved through normalization. Complex relations are decomposed into simpler relation using normalizations. Normalization is also used to check quality of database design. There are three levels of normalization. In a given relation R A and B are attributes, B is functionally dependent on A, and each value of A determines exactly one value of B.

i. 1NF

The relational schema R is in 1NF if an only if:

  • All attributes or R are atomic in nature.
  • All non-key attributes should be functionally dependent on key attribute.

ii. 2NF

The relational schema R is in 2NF if an only if:

  • R is already in 1NF.
  • There is no partial dependency in R which exists between non-key and key attributes.

iii. 3NF

The relational schema R is in 3NF if an only if:

  • R is already in 3NF.
  • There is no transitive dependency which exists between key and non-key attributes through another non-key attributes.

2. Explanation:

i. Since all attribute values are single atomic, the given relation CAR-SALE is in 1NF.

ii. Salesman# → commission% …Given

Thus, it is not fully functionally dependent on the primary key {Car#, Salesman#}. Hence, it is not in 2 NF.

The 2 NF decomposition for this relation is:

  • CAR_SALE1(Car#, Salesman#, DateSold, DiscountAmount)
  • CAR_SALE2(Salesman#, Commission%)

iii. The given relationship is not in 3NF because there exists a transitive dependency in the form

DiscountAmount → DateSold → (Car#, Salesman#)

Thus, DateSold is neither a key itself nor a subset of a key and DiscountAmount is not a prime attribute.

The 3 NF decomposition are as follows:

  • CAR_SALES1A(Car#, Salesman#, DateSold)
  • CAR_SALES1B(DateSold, DiscountAmount)
  • CAR_SALE3(Salesman#, Commission%)
Please log in to add an answer.