Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- span class="re5"> CREATE TABLE DepositsTypes(
- DepositTypeId IT PRIMARY KEY,
- Name VARCHAR(50)
- )
- CREATE TABLE Deposits(
- DepositID INT PRIMARY KEY IDENTITY,
- Amount DECIMAL (10, 2),
- StartDate DATE,
- EndDate DATE,
- DepositTypeId INT,
- CustomerID INt,
- CONSTRAINT FK_Deposits_DeposistsTypes FOREIGN KEY (DepositTypeId)
- REFERENCES DepositTypes(DepositTypeId),
- CONSTRAINT FK_Deposits_Customers FOREIGN KEY(CustomerId)
- REFERENCES Customers(CustomerId)
- )
- CREATE TABLE EmployeesDeposits(
- EmployeeID INT,
- DepositID INT,
- CONSTRAINT PK_EmployeesDeposits PRIMARY KEY (EmployeeID, DepositID),
- CONSTRAINT FK_EmployeesDeposits_Employees FOREIGN KEY (EmployeeID)
- REFERENCES Employees(EmployeeID),
- CONSTRAINT FK_EmployeesDeposits_Deposits FOREIGN KEY (DepositID)
- REFERENCES Deposits(DepositID)
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement