user1405697
user1405697

Reputation:

3NF normalization

I have to normalize the following in 3NF:

Service (Service_ID, Service Item, service item cost, date of service)  
Customer (customer ID, customer name, customer telephone number, customer address)  
Vehicle (Vehicle ID, vehicle make, vehicle model, vehicle year)  
Parts (Parts ID, part code, part describtion, part cost)

What I got after normalization:

Service (Service_ID (PK), Service Item, service item cost, date of service, Vehicle_ID (FK))  
Customer (customer ID (PK), customer name, customer telephone number, customer address)  
Vehicle (Vehicle ID (PK), vehicle make, vehicle model, vehicle year, Customer_ID (FK))  
Parts (Parts ID (PK), part code, part describtion, part cost, Vehicle_ID (FK))

Do you think I am on completely the wrong track?

Upvotes: 1

Views: 1118

Answers (1)

Starting relation

  • Service (Service_ID, Service Item, service item cost, date of service)

Ending relation

  • Service (Service_ID (PK), Service Item, service item cost, date of service, Vehicle_ID (FK))

Normalization up to 3NF identifies several kinds of functional dependencies, and removes the troublesome ones by projection. (By creating another relation.) If you remove a troublesome dependency in a relation by projection, it always ends up with fewer attributes than it started with.

Your relation "Service" ends up with more columns than you started with. While it makes sense to record which vehicle the service applies to, that can't possibly have anything to do with normalization, based solely on what you started with.

Identifying a missing foreign key, while unarguably an important thing to do, isn't part of normalization per se. Starting with {Service_ID, Service Item, service item cost, date of service, Vehicle_id, vehicle make, vehicle model, vehicle year}, normalization would have said that Service_ID -> Vehicle_ID, and Vehicle_ID -> vehicle make, vehicle model, and vehicle year. That's a transitive dependency. To fix that transitive dependency,

  • those four columns would be projected, forming a new relation (your Vehicles table),
  • vehicle make, vehicle model, and vehicle year would be removed from the starting relation, leaving it with 3 fewer attributes than it started with.

And there's still a vehicle id in the service relation.

So your teacher has given you an assignment that does not require you to normalize. It requires you to identify where someone else screwed up the normalization, and fix it. Nothing wrong with that kind of assignment, but there's a lot wrong with calling it normalization. (IMHO)

Upvotes: 3

Related Questions