Question
SQL Question. Please create an ER Diagram for the following: Create Table Employee ( empNumber CHAR (8) PRIMARY KEY NOT NULL, SSN CHAR (9) NULL,
SQL Question. Please create an ER Diagram for the following:
Create Table Employee
(
empNumber CHAR (8) PRIMARY KEY NOT NULL,
SSN CHAR (9) NULL,
firstName VARCHAR (25) NOT NULL,
lastName VARCHAR (25) NOT NULL,
address VARCHAR (50) NULL,
state CHAR (2) NULL,
zip CHAR (5) NULL,
job VARCHAR (50) NOT NULL,
CONSTRAINT checkJob CHECK (Job IN ('Cast Member', 'Engineer', 'Inspector', 'Project Manager'))
)
Create Table Project
(
projectID char(4) PRIMARY KEY NOT NULL,
projectName VARCHAR (50) NOT NULL,
fundedBudget DECIMAL(16,2) NULL,
firmFedID CHAR(9) NOT NULL,
startDate DATE NULL,
projectTypeCode CHAR(5) NOT NULL,
projectTypeDesc VARCHAR (50) NULL,
projectStatus VARCHAR(25) NULL,
CONSTRAINT checkProjStat CHECK (projectStatus IN ('Active', 'Inactive', 'Cancelled', 'On-Hold', 'Completed')),
projectEndDate DATE NULL,
projectManager CHAR(8) FOREIGN KEY REFERENCES employee(empNumber)
)
Create Table Activity
(
activityID CHAR (4) NOT NULL PRIMARY KEY,
activityName VARCHAR (50) NOT NULL,
activityTypeCode char (2) NOT NULL,
activityStatus VARCHAR (25) NULL,
CONSTRAINT checkActStat CHECK (activityStatus IN ('Active', 'Inactive', 'Cancelled', 'On-Hold', 'Completed')),
activityTypeDesc VARCHAR (50) NULL,
costToDate DECIMAL (16,2) NULL,
startDate DATE NULL,
endDate DATE NULL,
projectID char(4) FOREIGN KEY REFERENCES Project(projectID)
)
Create Table Firm
(
firmFedID char (9) NOT NULL PRIMARY KEY,
firmName varchar (50) NOT NULL,
firmAddress varchar (50) NULL
)
Create Table Job
(
projectID char (4) NOT NULL,
activityID char (4) NOT NULL,
)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started