Guest User

Untitled

a guest
Jul 17th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. CREATE TABLE Rota (
  2. RotaId INT NOT NULL IDENTITY(1, 1) PRIMARY KEY,
  3. EmployeeId INT NOT NULL FOREIGN KEY REFERENCES Employee(Employee),
  4. -- Other columns
  5. )
  6.  
  7. CREATE TABLE EmployeeOvertime (
  8. EmployeeOvertimeId INT NOT NULL IDENTITY(1, 1) PRIMARY KEY,
  9. EmployeeId INT NOT NULL FOREIGN KEY REFERENCES Employee(Employee),
  10. -- Other columns
  11. )
  12.  
  13. CREATE TABLE RotaOvertime (
  14. RotaId INT NOT NULL FOREIGN KEY REFERENCES Rota(RotaId),
  15. EmployeeOvertimeId INT NOT NULL FOREIGN KEY REFERENCES EmployeeOvertime(EmployeeOvertimeId),
  16. UNIQUE (RotaId, EmployeeOvertimeId)
  17. )
Add Comment
Please, Sign In to add comment