When there isnt a suitable natural key present, you would normally make a surrogate key like a unique ID number, so approach #1 would be best.
"Hafiz Ahmad" <24*3*5*
6@s*u*e*t*u*a*e*u*a*> wrote:
> while I was putting dummy data in each of the table to verify
> - if the table is in 3NF
> - if the Primary Key need to be changed;
>
> for Vehicle Type table, I can see Make & Model are taken as composite primary keys, but I can use duplicate values in each of these columns. e.g. below is a table I generated
>
> Make Model Doors Body Trim Fuel
> Toyota Camry 4 Sedan Sport Petrol
> Toyota Camry 4 Sedan L Hybrid
> Honda City 4 Sedan Aspire Hybrid
> Honda Civic 4 Hatch Sport Hybrid
>
> Considering the company may have multiple cars of same make/mode/doors...….., the table is not in even 1NF. I can solve it by
>
> 1- adding a unique identifier as a serial number in this table and use it with PK or
> 2- merge Vehicle table which has three attributes regNum / FleetNum / Colour with vehicle type. regNum / FleetNum both are unique and qualify to be a PK of the merged table.
>
> Can you please guide which approach I should take? if we are allowed to merge / split / move attributes around from the ERD model, I would prefer to merge two tables rather than adding additional attributes.
>
> I did consider using subclass / superclass however for the sake of implementation in SQLITE, merging seems to be best option.