Question: Draw a dependency diagram for each table - - Table for departments CREATE TABLE Departments ( DepartmentID INT PRIMARY KEY, DepartmentName VARCHAR ( 2 5

Draw a dependency diagram for each table
-- Table for departments CREATE TABLE Departments ( DepartmentID INT PRIMARY KEY, DepartmentName VARCHAR(255) NOT NULL ); -- Table for people (employees, customers, potential employees) CREATE TABLE People ( PersonalID INT PRIMARY KEY, LastName VARCHAR(255) NOT NULL, FirstName VARCHAR(255) NOT NULL, Age INT CHECK (Age <65), Gender VARCHAR(10), AddressLine1 VARCHAR(255), AddressLine2 VARCHAR(255), City VARCHAR(255), State VARCHAR(50), ZipCode VARCHAR(10), PhoneNumber VARCHAR(15)); -- Table for employees CREATE TABLE Employees ( EmployeeID INT PRIMARY KEY, PersonalID INT, Rank VARCHAR(255), Title VARCHAR(255), SupervisorID INT, FOREIGN KEY (PersonalID) REFERENCES People(PersonalID), FOREIGN KEY (SupervisorID) REFERENCES Employees(EmployeeID)); -- Table for departments employees work in CREATE TABLE EmployeeDepartments ( EmployeeID INT, DepartmentID INT, StartTime DATETIME, EndTime DATETIME, PRIMARY KEY (EmployeeID, DepartmentID, StartTime), FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID), FOREIGN KEY (DepartmentID) REFERENCES Departments(DepartmentID)); -- Table for job positions CREATE TABLE JobPositions ( JobID INT PRIMARY KEY, JobDescription VARCHAR(255), PostedDate DATE, DepartmentID INT, FOREIGN KEY (DepartmentID) REFERENCES Departments(DepartmentID)); -- Table for job applications CREATE TABLE Applications ( ApplicationID INT PRIMARY KEY, PersonalID INT, JobID INT, ApplicationDate DATE, FOREIGN KEY (PersonalID) REFERENCES People(PersonalID), FOREIGN KEY (JobID) REFERENCES JobPositions(JobID)); -- Table for interviews CREATE TABLE Interviews ( InterviewID INT PRIMARY KEY, JobID INT, InterviewerID INT, IntervieweeID INT, InterviewTime DATETIME, Grade INT CHECK (Grade BETWEEN 0 AND 100), FOREIGN KEY (JobID) REFERENCES JobPositions(JobID), FOREIGN KEY (InterviewerID) REFERENCES Employees(EmployeeID), FOREIGN KEY (IntervieweeID) REFERENCES People(PersonalID)); -- Table for products CREATE TABLE Products ( ProductID INT PRIMARY KEY, ProductType VARCHAR(255), Size VARCHAR(50), ListPrice DECIMAL(10,2), Weight DECIMAL(10,2), Style VARCHAR(255)); -- Table for marketing sites CREATE TABLE MarketingSites ( SiteID INT PRIMARY KEY, SiteName VARCHAR(255), Location VARCHAR(255)); -- Table for sales CREATE TABLE Sales ( SaleID INT PRIMARY KEY, SalespersonID INT, CustomerID INT, ProductID INT, SaleTime DATETIME, SiteID INT, FOREIGN KEY (SalespersonID) REFERENCES Employees(EmployeeID), FOREIGN KEY (CustomerID) REFERENCES People(PersonalID), FOREIGN KEY (ProductID) REFERENCES Products(ProductID), FOREIGN KEY (SiteID) REFERENCES MarketingSites(SiteID)); -- Table for vendors CREATE TABLE Vendors ( VendorID INT PRIMARY KEY, VendorName VARCHAR(255), Address VARCHAR(255), AccountNumber VARCHAR(50), CreditRating INT, PurchasingWebServiceURL VARCHAR(255)); -- Table for parts supplied by vendors CREATE TABLE Parts ( PartID INT PRIMARY KEY, VendorID INT, PartName VARCHAR(255), Weight DECIMAL(10,2), Price DECIMAL(10,2), FOREIGN KEY (VendorID) REFERENCES Vendors(VendorID)); -- Table for product parts CREATE TABLE ProductParts ( ProductID INT, PartID INT, Quantity INT, PRIMARY KEY (ProductID, PartID), FOREIGN KEY (ProductID) REFERENCES Products(ProductID), FOREIGN KEY (PartID) REFERENCES Parts(PartID)); -- Table for employee salaries CREATE TABLE Salaries ( SalaryID INT PRIMARY KEY, EmployeeID INT, TransactionNumber INT, PayDate DATE, Amount DECIMAL(10,2), FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID));

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!