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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:38:49+00:00 2026-06-07T16:38:49+00:00

I’m doing a project for my Database exam, and I’m stuck at a tricky

  • 0

I’m doing a project for my Database exam, and I’m stuck at a tricky point. This is an excerpt of my ER diagram:

https://i.stack.imgur.com/d1WQd.png

As you can see, the entity Employee is generalization of Waiter and Cook. Head waiter and Chief cook are specializations of respectively Waiter and Cook. Only chiefs can fullfill an Order (non included in this excerpt) to the supplier. Obiously only one Chief at a time can Fulfil an order (I’ve made a single Fulfilment relationship to make the diagram less messy).

After remodeling the ER diagram (sorry if I’m not using the correct words, I’m translating in English), this is the result:

https://i.stack.imgur.com/GFOyD.png

So an Employee must have a Role (Waiter, Cook or whatever else), and for each role there could (obviously) be only one Chief. I really don’t know if this is correct, the double generalization confuses me a lot.

Next step is the logical diagram (tables), and this is a total mess!
This is a possible solution:

enter image description here

This is a possible translation to the relational model (with an Unique Not Null constraint on FK2 in tblChief) , but it has a weakness: if you change Employees role in tblEmployee, tblChief won’t see this error and integrity will be broken. Could adding a FK between tblEmployee(Role) and tblChief(Role) be a good solution? Or would it be ugly/messy?

I’ve thought of a second possible solution. I prefer it, but still I don’t know if it’s OK:

enter image description here

Here I’ve merged the entity Role with the entity Chief in a single table. The field Chief references IDEmployee, again it must be Unique and Not Null.

Are these solutions correct? I’m sure that this will be a big mess when inserting and updating Employees and Roles (AFAIK it can’t be done without temporarily removing the integrity checks). Could be this done in a different way?

Sorry for the long post (and for the image links, but I can’t post them directly) and many thanks if you’ll answer me 🙂

  • 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-07T16:38:52+00:00Added an answer on June 7, 2026 at 4:38 pm

    The last diagram does not make sense.

    Each employee has 1 role (this is a FK relationship)

    Each role can have one superior role. This is a nullable FK relationship back to the role table. (Itself). Not to employee as you have it.

    To find all employees that are managers you would have a select statement like this:

    SELECT * 
    FROM employees
    WHERE roleID in (SELECT roleID 
                     FROM role 
                     WHERE superiorID IS NULL)
    

    or

    SELECT * 
    FROM employees E
    LEFT JOIN role R ON E.roleID = R.roleID
    WHERE R.superiorID IS NULL
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I am doing a simple coin flipping experiment for class that involves flipping a
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

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.