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 7945073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:44:49+00:00 2026-06-04T00:44:49+00:00

suppose i am modeling a database and i have an entity Equipement , it

  • 0

suppose i am modeling a database and i have an entity Equipement, it can be a Workstation or a Peripheral, when translating to SQL, what is the best way ? Equipement table with the common attributes and the two others ? or just the two child tables?

  • 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-06-04T00:44:50+00:00Added an answer on June 4, 2026 at 12:44 am

    You can use either a universal table, vertical partitioning or horizontal partitioning. A universal table has ALL attributes and an additional type attribute. This attribute represents which type your entity has. Attributes which you do not have for a special type are NULL. In your example you could have a table:

    Equipment(e_id, attr_general,attr_workstation,attr_peripheral,type)
    

    With following Rows:

    e_id | attr_general | attr_workstation | attr_peripheral | type
    ---------------------------------------------------------------
      1  |    valueG    |      valueW      |       NULL      |  'W'
      2  |    valueG    |      NULL        |       valueP    |  'P' 
    

    If you use vertical partitioning you map all your classes to tables and reference them with you base entity:

    Equipment(e_id,attr_general) -> PK is e_id
    
    Workstation(w_id,attr_workstation) -> PK,FK w_id where FK referencing to e_id
    
    Peripheral(p_id,attr_peripheral) -> PK,FK p_id where FK referencing to e_id
    

    If you use horizontal partioning you reference again to your base entity but you take all
    attributes from each base entity as well:

    Equipment(e_id,attr_general) -> PK is e_id
    
    Workstation(w_id,attr_general, attr_workstation) -> PK,FK w_id where FK referencing to e_id
    
    Peripheral(p_id,attr_general,attr_peripheral) -> PK,FK p_id where FK referencing to e_id
    

    I personally use universal tables for entities which does not have many different attributes. If it comes that you have too many different attributes I would avoid this type, because you will have a lot of NULL fields.

    Hope that could help you!

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

Sidebar

Related Questions

Suppose I have a table like: Tab(MyDate datetime null, MyIs bit null, ...) Then
Suppose I have a table MYtable as given below: ID A B C 1
Suppose I have the following table: PERSON : ID INT NAME STRING LASTNAME STRING
Suppose i have an XML file, that i use as local database, like this):
Suppose we have a table A: itemid mark 1 5 2 3 and table
Suppose I have: Toby Tiny Tory Tily Is there an algorithm that can easily
Suppose I have a table with parent-child relationships. parent child 1 4 1 5
Suppose I have some lookup table, q(w, x, y, z) , where various combination
suppose I have the following source table (called S): name gender code Bob 0
Suppose I have a table like: id............value ``````````````````` A............1 A............2 A............3 B............1 and so

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.