Search code examples
database-designrelational-databasedatabase-normalization

Normalization confusion , is a type of something a transitive dependency?


Does the v_type need to be in a separate table, yes or no please explain which normalization rule does is applied ? I want this table normalize upto 3NF.

Vechile
v_id (pk) | V_name     |  V_type
----------------------------------
v1          Ferrai        car
v2          merto         train
v3          City_bus      bus
v4          Lamborgini    car
v5          grey hound    bus

Solution

  • As far as stands here, this table is normalized. It's legal to use strings like "car" or "metro" as primary key for a V_type table, or just as attributes of your vehicle table. Normalization would only be violated if you put additional attributes of V_type entity into the Vehicle table, e.g. an attribute public that determines whether it's public or private transport.

    Even if you don't have such additional attributes, there might be a reason for separating the vehicles types into a table of their own. That way you can control which vehicle types may exist. In your current design, if someone enters a record like

    v18   Mercedes   cra
    

    that would be accepted. If, however, you have a vehicle type table that contains entries only for valid vehicle types like car, metro, bus, and train, you can ensure by a foreign key constraint that the vehicle table will only reference those types.