Question

This is just an example I have created. Assume this is the relation I have:

0NF Car(CarID PK, (TireID,Tire_Colour, Tire_Punctured), Safe) Where TireID, Tire_Colour, Tire_Punctured is part of a repeated group.

A car would be deemed safe if all of it's tires are not punctured.

Would the following functional dependency be correct:

CardID, TireID, Tire_Punctured -> {Safe}

If I were to continue normalizing and I decomposed the relation into separate tables how would I show the dependency of Safe across the tables.

Sample Data
------------
CarID   |  TireID  |   Tire_Colour   |   Tire_Punctured   |   Safe   |  
   1          23             black              false            true  
   1          11             blue               false            true  
   1          29             black              false            true  
   1           1             black              false            true  

   2           4             red                false            false  
   2          34             purple             false            false  
   2          24             black              true             false  
   2          64             black              false            false  
Was it helpful?

Solution

Classical normalization theory can apply to this scenario only if you regard the (TireID, Tire_Colour, Tire_Punctured) part of your schema as denoting a *single* attribute/column, and that attribute/column itself takes on *relation (/ table) values *. Relation-valued attributes, RVA's for short, in modern theory.

In that case, you have the two FD's carID -> yourRVA and yourRVA -> safe.

The former expresses the fact that knowing which car we're talking about allows us to know what set of tires is involved (and their state), and the second expresses the fact that the state of the tires determines (all by itself) whether the car is safe or not.

If you "unwrap" this design (*) into a more traditional one (by replacing the RVA attribute with the scalar attributes it contains), then the yourRVA -> safe FD simply isn't expressible anymore, because obviously yourRVA no longer exists. Specifying such rules in such designs is beyond the scope of, and cannot be done with, functional dependencies.

(*) and if you are to implement this in an SQL system, you will be forced to do so because SQL systems (and perhaps even the SQL language itself) typically don't support RVA's in base tables.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top