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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:02:55+00:00 2026-05-13T20:02:55+00:00

I have an employee table, employee has interests, so the table can be designed

  • 0

I have an employee table, employee has interests, so the table can be designed like this:

create table emp(
 id int(10) not null auto_increment,
 name varchar(30),
 interest varchar(50),
 primary key(id)
);

or this:

create table emp(
 id int(10) not null auto_increment,
 name varchar(30),
 interest enum('football','basketball','music','table tennis','volleyball'),
 primary key(id)
);

The number of interests can be about 50.

How should i design the table? Should i use enum or others ?

Edit:

Thanks for your reponse.

Assume that a person can be a Mr. or Madame or Ms.

I make a drop down list in PHP.

<select name="role">
<option value="Mr.">Mr.</option>
<option value="Ms">Ms</option>
<option value="Madame">Madame</option>
</select>

And for the DB part, I can do this:

create table emp(
    id int(10) not null auto_increment,
    name varchar(30),
    role varchar(50),
    primary key(id)
);

or this:

create table emp(
    id int(10) not null auto_increment,
    name varchar(30),
    role enum('Mr.','Ms.','Madame'),
    primary key(id)
);

In this context, which is better?

  • 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-13T20:02:55+00:00Added an answer on May 13, 2026 at 8:02 pm

    You should really make 3 tables, assuming that an employee can have multiple interests. (Your current design limits each employee to 1 interest.) Something like this:

    Employee (emp)
    -------
    id
    name
    
    Interest
    -------
    id
    description
    
    Employee_Interest
    --------
    employeeID
    interestID
    

    Regarding the edit, I’d say the enum is the better of your 2 examples as it limits you to predetermined allowable values. But many would argue that you should make a lookup table (Role with id and description) even for that

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

Sidebar

Related Questions

Some existing web services I consume have methods that look something like this: List<Employee>
I have 2 tables: 1. Employees 2. Vouchers Employees table has a single primary
Suppose I have a dataset with those two immortal tables: Employee & Order Emp
If I have a query like: Select EmployeeId From Employee Where EmployeeTypeId IN (1,2,3)
I have a Dictionary<int, string> cached (for 20 minutes) that has ~120 ID/Name pairs
I have an EMPLOYEE table in a SQL Server 2008 database which stores information
Suppose I have a table called Companies that has a DepartmentID column. There's also
I have two entities: Project, Employee Employee has primary key {employeeId} + some other
I have table with following details Table name EMPLOYEE and columns EMPID (PK smallint
I have the following requirement I have a Employee class: public class Employee {

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.