Answered step by step
Verified Expert Solution
Question
1 Approved Answer
- - Customers Table CREATE TABLE Customers ( CustomerID INT PRIMARY KEY, FirstName VARCHAR ( 2 5 5 ) , LastName VARCHAR ( 2 5
Customers Table
CREATE TABLE Customers
CustomerID INT PRIMARY KEY,
FirstName VARCHAR
LastName VARCHAR
MailingAddress VARCHAR
PhoneNumber VARCHAR
EmailAddress VARCHAR
;
Credit Cards Table
CREATE TABLE CreditCards
CardNumber VARCHAR PRIMARY KEY,
CustomerID INT,
CardType VARCHAR
FOREIGN KEY CustomerID REFERENCES CustomersCustomerID
;
Cars Table
CREATE TABLE Cars
VIN VARCHAR PRIMARY KEY,
Make VARCHAR
Model VARCHAR
Year INT,
Color VARCHAR
CustomerID INT,
FOREIGN KEY CustomerID REFERENCES CustomersCustomerID
;
Maintenance Visits Table
CREATE TABLE MaintenanceVisits
VisitID INT PRIMARY KEY,
CarVIN VARCHAR
DateOfVisit DATE,
PromisedReturnDate DATE,
MileageAtDropOff INT,
CoordinatorID INT,
FOREIGN KEY CarVIN REFERENCES CarsVIN
FOREIGN KEY CoordinatorID REFERENCES EmployeesEmployeeID Assuming there's an Employees table
;
Parts Table
CREATE TABLE Parts
SKUNumber VARCHAR PRIMARY KEY,
PartName VARCHAR
ShelfLocation VARCHAR
RowNumber INT,
StackNumber INT,
SupplierID INT,
UnitsInStock INT,
MinimumUnits INT,
FOREIGN KEY SupplierID REFERENCES SuppliersSupplierID Assuming there's a Suppliers table
;
MaintenancePartsUsed Table
CREATE TABLE MaintenancePartsUsed
VisitID INT,
PartSKUNumber VARCHAR
UnitsUsed INT,
TechnicianID INT,
FOREIGN KEY VisitID REFERENCES MaintenanceVisitsVisitID
FOREIGN KEY PartSKUNumber REFERENCES PartsSKUNumber
FOREIGN KEY TechnicianID REFERENCES TechniciansTechnicianID Assuming there's a Technicians table
;
Assuming tables for Employees, Suppliers, and Technicians exist
Technicians table would just have an EmployeeID as a FK to Employees Make and show an ER diagram out of this SQL statement with the rectangles, diamonds, etc. Make the diagram
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