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

  • Home
  • SEARCH
  • 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 6572315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:59:25+00:00 2026-05-25T14:59:25+00:00

I need to create a table in a relational database using SQL for persons

  • 0

I need to create a table in a relational database using SQL for persons having the columns Name, LastName and so on.

I’ll have three different kinds of People: Seller, Buyer and Customer.

Every person has other information/attributes.

Do I need to create a table for each different type of Person or can a single table be used for all three types?

If I used a single table, what if one type of “Person”, say Seller, has different attributes from another Person type?

  • 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-25T14:59:25+00:00Added an answer on May 25, 2026 at 2:59 pm

    You can create 1 or two tables. Of course you can create 3 tables for each user role. It depend’s on what you would like to achieve. Common solution to your question is: create two tables, one for users and one for their roles (examples for mysql:

    Create table `person_role` (
    id int not null,
    roleName varchar(255) not null,
    PRIMARY KEY(`id`)
    ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
    
    Create table `person`(
    id int not null.
    name varchar(255) not null,
    lastName varchar(255) not null,
    role int not null,
    PRIMARY KEY(`id`),
    CONSTRAINT FOREIGN KEY(`role`) REFERENCES person_role(`id`)
    ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create a database table to store different changelog/auditing (when something was
I have a table in MS Access database and need to create a query
I need to create a table in MySQL which stores the different currency symbols
I need to create an SQL query to insert some data into a table
I have the following table structure in my database: create table Encargado( ID int
i need to create an employee shift database. so i have 3 tables so
I have a relational database with about 100 tables. Each table has unique, numerical,
I have questions which are represented like this in my SQL database : CREATE
I've got a list of synonyms and need to create a database in SQL
I have a table with a few relational columns and one XML column which

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.