Question: what can i fix this sql code and make it work ( keep the columns the same ) - - table 1 : Staff CREATE
what can i fix this sql code and make it work keep the columns the same
table : Staff
CREATE TABLE Staff
EmployeeID INT PRIMARY KEY,
FirstName VARCHAR
LastName VARCHAR
PhoneNumber VARCHAR
Email VARCHAR
;
table : Service
CREATE TABLE Service
ServiceID INT PRIMARY KEY,
PetrolFilling VARCHAR
GlassCleaning VARCHAR
CarWash VARCHAR
CarTankFilter VARCHAR
PaymentID INT,
FOREIGN KEY PaymentID REFERENCES PaymentPaymentID
;
table : Payment
CREATE TABLE Payment
PaymentID INT PRIMARY KEY,
PaymentType VARCHAR
TotalAmount DECIMAL
LiterAmount DECIMAL
PetrolRate DECIMAL
CustomerID INT,
AccountID INT,
FOREIGN KEY CustomerID REFERENCES CustomerCustomerID
FOREIGN KEY AccountID REFERENCES CustomerAccountID
;
table : Property
CREATE TABLE Property
PropertyID INT PRIMARY KEY,
Location VARCHAR
BuildingNumber VARCHAR
City VARCHAR
Country VARCHAR
;
table : Customer
CREATE TABLE Customer
CustomerID INT PRIMARY KEY,
AccountID INT,
FirstName VARCHAR
LastName VARCHAR
Gender VARCHAR
PaymentID INT,
FOREIGN KEY PaymentID REFERENCES PaymentPaymentID
;
table :junction StaffService
CREATE TABLE StaffService
EmployeeID INT,
ServiceID INT,
FOREIGN KEY EmployeeID REFERENCES StaffEmployeeID
FOREIGN KEY ServiceID REFERENCES ServiceServiceID
PRIMARY KEY EmployeeID ServiceID
;
junction table CustomerService
CREATE TABLE CustomerService
CustomerID INT,
AccountID INT,
ServiceID INT,
FOREIGN KEY CustomerID REFERENCES CustomerCustomerID
FOREIGN KEY AccountID REFERENCES CustomerAccountID
FOREIGN KEY ServiceID REFERENCES ServiceServiceID
PRIMARY KEY CustomerID AccountID, ServiceID
;
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
