0

I'm trying to model a workstation subject which represents two subordinate subjects that share common characteristics with the main subject. These are: desktop and laptop

Each subordinate subject contains characteristics that are germane to that particular subject and the ws_asset_no (PK) field that relates it to the parent subject.

workstation

ws_asset_no
date_issued
date_returned
operating_system

desktop

ws_asset_no
monitor_asset_no

laptop

ws_asset_no
laptop_category

laptop_category is a multivalued field that will get resolved into a table.

Can anyone please confirm that this is the right approach and advise about the relationships.

Thank you

zan
  • 355
  • 6
  • 16

1 Answers1

1

What you do is correct and it's probably best for your scenario. Remember that ws_asset_no in tables laptop and desktop have to be both primary key and foreign key.

The alternative approaches you could take are:

  • (Single Table Inheritance) put all data in table workstation, and add auxiliary column workstation_type which tells if the workstation is a laptop, or a desktop
  • (Concrete Table Inheritance) have tables laptop and desktop (no table workstation) with all data for laptop and desktop.

See this question for more details on the different approaches to database inheritance

Community
  • 1
  • 1
Agnieszka
  • 336
  • 2
  • 4