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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:20:58+00:00 2026-06-03T02:20:58+00:00

I am designing an SQL database which has 2 tables that require a ‘manager_id’.

  • 0

I am designing an SQL database which has 2 tables that require a ‘manager_id’. The ‘Employees’ table and the ‘Facilities’ table. Because Managers are considered to be employees, I’m not sure if I should have a separate ‘Managers’ table or to just integrate it into the ’employees’ table. I’m new to SQL and not sure about cases like this. This is the code I have so far:

CREATE TABLE Employees (
emp_id NUMBER(5) NOT NULL,
emp_name VARCHAR2(20) NOT NULL,
emp_add1 VARCHAR2(30) NOT NULL,
emp_add2 VARCHAR2(30) NOT NULL,
emp_add3 VARCHAR2(30),
emp_town VARCHAR2(30),
emp_county NUMBER(2) NOT NULL,
emp_telno NUMBER(10),
emp_position NUMBER(3) NOT NULL,
emp_manager NUMBER(4),
CONSTRAINT pk_empid PRIMARY KEY (emp_id),
CONSTRAINT fk_empcounty FOREIGN KEY (emp_county) REFERENCES County(county_id),
CONSTRAINT fk_empposition FOREIGN KEY (emp_position) REFERENCES Positions(position_id),
CONSTRAINT fk_empmanager FOREIGN KEY (emp_manager) REFERENCES Manager(manager_id)
);

CREATE TABLE Facilities (
facility_id NUMBER(2) NOT NULL,
facility_name VARCHAR(15) NOT NULL,
facility_manager NUMBER(4) NOT NULL,
CONSTRAINT pk_facilityid PRIMARY KEY (facility_id);
CONSTRAINT fk_facilitymanager FOREIGN KEY (facility_manager) REFERENCES Manager(manager_id)
);
  • 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-03T02:21:00+00:00Added an answer on June 3, 2026 at 2:21 am

    This is question about relational normalisation (the organisation of data in a relational database).

    So how to organise:

    Well though there are many steps in normalisation with the aim to produce the most efficient structure. In your case you should first try the approach of putting the common bits in the same table and the non common bits should be in another.

    So since the manger is an employee (lets say with the attributes employee title, name, department) this should be in the employee table. But lets say managers have clipboards (e.g. attributes colour and size) that non managers don’t. In which case the you’d add a Manager table to handle those.

    -- employeee table
    id  Name      Title      Dept
    1   adohertyd Coder      IT
    2   Preet     Ninja      SillyWalks
    3   Skeety    Secretary  Cleaning
    
    -- manager table 
    manager_id  employee_id  clipboard_size  clipboard_colour
    1           2            Big             Black
    

    The you’d find a manager like this

    select Name, Dept, clipboard_size  
    from employee e 
    inner join manager m on e.id = m.employee_id
    

    As you go further you may find it more efficient to bring some of those attributes into the employee table and have a ‘Is_manager’ column. This is essentially denormalisation and something that you should avoid until you need it.

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

Sidebar

Related Questions

We are designing a SQL Server database with link tables for many-to-many relations. The
I'm designing a few applications that will share 2 or 3 database tables and
I am designing a table in the database which will store log entries from
This is my first time designing tables in a sql database and I have
I am currently in the process of designing a database. I have a table
I'm developing an asp.net application that has some potentially large data tables. I would
I am designing a standard ASP.Net site with a SQL database. I have a
When designing a database to use MVCC (Multi-Version Concurrency Control), you create tables with
I'm designing a small SQL database to be used by a web application. Let's
I'm designing a reporting solution which uses SQL Server 2008 R2 as its backend

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.