Advertisement
Guest User

Untitled

a guest
Apr 15th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.33 KB | None | 0 0
  1. CREATE TABLE R
  2. (
  3. a INT,
  4. b INT PRIMARY KEY DEFAULT 0,
  5. c INT
  6. );
  7.  
  8. CREATE TABLE S
  9. (
  10. d CHAR,
  11. e INT CONSTRAINT ct REFERENCES R(b),
  12. f INT
  13. );
  14.  
  15. GO
  16.  
  17. INSERT INTO R VALUES
  18. (1, 6, 11),
  19. (2, 7, 12),
  20. (3, 8, 13),
  21. (4, 9, 14),
  22. (5, 10, 15);
  23.  
  24. INSERT INTO S VALUES
  25. ('A', 6, 1),
  26. ('B', 7, 9),
  27. ('C', 7, 2),
  28. ('D', 9, 4),
  29. ('E', 8, 6);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement