Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6665563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:44:11+00:00 2026-05-26T02:44:11+00:00

I need to implement a database to track a parcel’s location. There can be

  • 0

I need to implement a database to track a parcel’s location.

There can be basically 4 locations, namely on a aeroplane, on a ship, on a car, at a transit office.

I need to have separate entities for these 4 locations because they all have mutiple instances of each (e.g. many aeroplanes, many cars)

Also, each of these 4 entities are managed by one and only one employee (another entity).

I have created an associative entity called job whereby it stores the information about which employee working in each of the 4 locations, similar to a flight number which contains the aeroplane id with the pilot id.

I have examined the attributes of the 4 locations, and found that they could be classified into car being the supertype and aeroplane, ship and office being subtype of car.

there would be a unique attribute of location_id which tells me whether it is on an aeroplane or an office in the supertype, thus the subtype would inherit this attribute.

my question is whether in the tables design, since locations will be separated into four different tables, whenever i referred location_id(FK) from the job entity, is it still possible to do so since a foreign key normally links to only one table and not 4 tables in this case..

EMPLOYEE [ employee_id, employee_name, gender, contact_number, job_scope ]

JOB [ job_id, (employee_id), (location_id) ]

OFFICE [ location_id, office_id, address ]

CAR [ location_id, vehicle_id ]

AEROPLANE [ location_id, vehicle_id, type, unladen_weight ]

SHIP [ location_id, vehicle_id, size ]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:44:12+00:00Added an answer on May 26, 2026 at 2:44 am

    Create a Location table.

    Location-id
    Location-Type
    Description
    

    (N.B.: the second field is redundant, because if the Location is a “Ship” you will find a record in the Ship table and nowhere else, but may be nice to have)

    Location-ID will be the primary key of the Location Table. And it will be a foreign key for Ship, Air, Office etc.

    So let’s say that you want to map 2 “locations”, one is a ship, the other is an office.

    Location table:

    Location-Id | Location-Type | Description
          ...   | ...           | ... 
         005768 | Ship          | "The Sea Witch" Mexican Cargo
          ...   | ...           | ...
         087956 | Office        | "Our offices in Albuquerque"
    

    Office Table

    Office-Id | Address 
       ...    | ...
       087956 | "145 Rose St. Albuquerque"
       ...    | ...
    

    Ship Table

      Ship-Id | Size 
       ...    | ...
       005768 | 14000
       ...    | ...
    

    In case you manage to find some other field which exists for all 4 types of “locations” add it to the Location table.

    The rest should be more or less ok: your Job table will point here, and every “concrete” class will be obtained by joining the Location record with the specific “subtype” record.

    Note: If you meant “location” as something else, for example “geographical area” like “Arizona” or “Gulf of Mexico” you will have to add this as an attribute of the Location table. For Office it will be static, while the other types of “locations” may change it as they move around.

    So the supertype is “Location”, and Office or Ship are subtypes of the “generic” location.

    This is a standard way to model Supertypes in RDBMS, btw, as explained already in some other places.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need ideas to implement a (really) high performance in-memory Database/Storage Mechanism in Java.
I need ideas to implement a (really) high performance in-memory Database/Storage Mechanism. In the
I need to implement an in-memory tuple-of-strings matching feature in C. There will be
I need to implement an OpenID Provider in .Net and wondered....Is there's any OpenSource
need to implement a global error handling, so maybe you can help out with
I am planning to implement database search through a website - I know there
I need to implement a tool that runs programs from SQL Server database when
I need to implement a daemon that needs to extract data from a database,
I need to implement a dialog for a web application (ASP.NET/C#) where users can
I need to implement a custom scoring system in my database design. My program

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.