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 NOT NULL ; Table for people employees customers, potential employees CREATE TABLE People PersonalID INT PRIMARY KEY, LastName VARCHAR NOT NULL, FirstName VARCHAR NOT NULL, Age INT CHECK Age Gender VARCHAR AddressLine VARCHAR AddressLine VARCHAR City VARCHAR State VARCHAR ZipCode VARCHAR PhoneNumber VARCHAR; Table for employees CREATE TABLE Employees EmployeeID INT PRIMARY KEY, PersonalID INT, Rank VARCHAR Title VARCHAR SupervisorID INT, FOREIGN KEY PersonalID REFERENCES PeoplePersonalID FOREIGN KEY SupervisorID REFERENCES EmployeesEmployeeID; 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 EmployeesEmployeeID FOREIGN KEY DepartmentID REFERENCES DepartmentsDepartmentID; Table for job positions CREATE TABLE JobPositions JobID INT PRIMARY KEY, JobDescription VARCHAR PostedDate DATE, DepartmentID INT, FOREIGN KEY DepartmentID REFERENCES DepartmentsDepartmentID; Table for job applications CREATE TABLE Applications ApplicationID INT PRIMARY KEY, PersonalID INT, JobID INT, ApplicationDate DATE, FOREIGN KEY PersonalID REFERENCES PeoplePersonalID FOREIGN KEY JobID REFERENCES JobPositionsJobID; Table for interviews CREATE TABLE Interviews InterviewID INT PRIMARY KEY, JobID INT, InterviewerID INT, IntervieweeID INT, InterviewTime DATETIME, Grade INT CHECK Grade BETWEEN AND FOREIGN KEY JobID REFERENCES JobPositionsJobID FOREIGN KEY InterviewerID REFERENCES EmployeesEmployeeID FOREIGN KEY IntervieweeID REFERENCES PeoplePersonalID; Table for products CREATE TABLE Products ProductID INT PRIMARY KEY, ProductType VARCHAR Size VARCHAR ListPrice DECIMAL Weight DECIMAL Style VARCHAR; Table for marketing sites CREATE TABLE MarketingSites SiteID INT PRIMARY KEY, SiteName VARCHAR Location VARCHAR; Table for sales CREATE TABLE Sales SaleID INT PRIMARY KEY, SalespersonID INT, CustomerID INT, ProductID INT, SaleTime DATETIME, SiteID INT, FOREIGN KEY SalespersonID REFERENCES EmployeesEmployeeID FOREIGN KEY CustomerID REFERENCES PeoplePersonalID FOREIGN KEY ProductID REFERENCES ProductsProductID FOREIGN KEY SiteID REFERENCES MarketingSitesSiteID; Table for vendors CREATE TABLE Vendors VendorID INT PRIMARY KEY, VendorName VARCHAR Address VARCHAR AccountNumber VARCHAR CreditRating INT, PurchasingWebServiceURL VARCHAR; Table for parts supplied by vendors CREATE TABLE Parts PartID INT PRIMARY KEY, VendorID INT, PartName VARCHAR Weight DECIMAL Price DECIMAL FOREIGN KEY VendorID REFERENCES VendorsVendorID; Table for product parts CREATE TABLE ProductParts ProductID INT, PartID INT, Quantity INT, PRIMARY KEY ProductID PartID FOREIGN KEY ProductID REFERENCES ProductsProductID FOREIGN KEY PartID REFERENCES PartsPartID; Table for employee salaries CREATE TABLE Salaries SalaryID INT PRIMARY KEY, EmployeeID INT, TransactionNumber INT, PayDate DATE, Amount DECIMAL FOREIGN KEY EmployeeID REFERENCES EmployeesEmployeeID;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
