It's UWAweek 42 (2nd semester, week 12)

help1402

This forum is provided to promote discussion amongst students enrolled in CITS1402 Relational Database Management Systems.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

How do I ask a good question?
Displaying the 2 articles in this topic
Showing 2 of 612 articles.
Currently 115 other people reading this forum.


 UWA week 40 (2nd semester, week 10) ↓
SVG not supported

Login to reply

👍?
helpful
10:59pm Tue 1st Oct, Hafiz A.

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.


SVG not supported

Login to reply

👍?
helpful
11:39am Thu 3rd Oct, Adam W.

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.

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy