Guest User

Untitled

a guest
Jun 24th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. Table3 { (int id, int type) PK }
  2. Table1 { (int id, int type [CHECK type = 1]) FK Table3 }
  3. Table2 { (int id, int type [CHECK type = 2]) FK Table3 }
  4.  
  5. Table4 { (int id, int type [CHECK type IN (1,2)]) PK }
  6. Table1 { (int id, int type [CHECK type = 1]) FK Table4 }
  7. Table2 { (int id, int type [CHECK type = 2]) FK Table4 }
  8. Table3 { (int id, int type) FK Table4 }
  9.  
  10. TABLE_A:
  11. PK_FIELD int NOT NULL
  12. OTHER_FIELD int NOT NULL, NOT IN TABLE_B.OTHER_FIELD
  13.  
  14. TABLE_B:
  15. PK_FIELD int NOT NULL
  16. OTHER_FIELD int NOT NULL, NOT IN TABLE_A.OTHER_FIELD
  17.  
  18. TABLE_C:
  19. PK_FIELD int NOT NULL
  20. OTHER_FIELD int NOT NULL IN (TABLE_A.OTHER_FIELD OR TABLE_B.OTHER_FIELD
Add Comment
Please, Sign In to add comment