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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:29:29+00:00 2026-06-18T12:29:29+00:00

I am working on an assignment for class where I have to take an

  • 0

I am working on an assignment for class where I have to take an ERD and create SQL statements to capture the relations. I am asking if the SQL statements I have created capture these relationships. In particular, I believe that “Dependent” is a weak entity and I do not know how to capture this relationship.

The ERD: https://i.stack.imgur.com/lkL1E.jpg

ERD

Here are my SQL statements:

CREATE TABLE Employees (
    ssn INTEGER, salary REAL, phone VARCHAR(24), PRIMARY KEY (ssn))

CREATE TABLE Departments (
    dno INTEGER, dname VARCHAR(150), budget REAL, PRIMARY KEY (dno), 
    managerid INTEGER, FOREIGN KEY (managerid) REFERENCES Employees (ssn))

CREATE TABLE Works_in (
    eid INTEGER, did INTEGER, PRIMARY KEY (ssn, did), FOREIGN KEY (ssn) 
    REFERENCES  Employees(eid), FOREIGN KEY (did) REFERENCES Dept (did))

CREATE TABLE Child (
    parentssn INTEGER, name VARCHAR(50), age INTEGER, FOREIGN KEY (parentssn)   REFERENCES Employees (ssn))

If it is not acceptable to post homework questions, please feel free to delete this.

I appreciate any and all help.

Thank you!

  • 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-18T12:29:30+00:00Added an answer on June 18, 2026 at 12:29 pm

    You did a good try.
    Works_In is a relationship not a table.
    So every employee will have a departmentid which references the department table.

    CREATE TABLE Employees (
        ssn INTEGER, salary REAL, phone VARCHAR(24),deptno INTEGER, PRIMARY KEY (ssn),
    FOREIGN KEY (parentdept) REFERENCES Departments(dno))
    
    CREATE TABLE Departments (
        dno INTEGER, dname VARCHAR(150), budget REAL, PRIMARY KEY (dno), 
        managerid INTEGER, FOREIGN KEY (managerid) REFERENCES Employees (ssn))
    
    
    CREATE TABLE Child (
        parentssn INTEGER, name VARCHAR(50), age INTEGER, FOREIGN KEY (parentssn)   
    REFERENCES Employees (ssn))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working on my assignment for Java and I have created a class called Triangle.
Working on an assignment for my Intro Programming class, I created a function and
I'm working on an assignment where I have to create three rows of three
I'm working on an assignment for my CIS class in python. We have to
I am working on an assignment and have to create two classes, one represents
I am working on a homework assignment for a class and I have solved
I have been working on and off on an assignment for my C class
This is an assignment i am working on for class. To make a long
We are working on a lab assignment for my CS&E class and I think
I am working on a project for my advanced Java class, and the assignment

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.