Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.42 KB | None | 0 0
  1. CREATE TABLE USERFAVS(
  2.     UserID int(11),
  3.     ImageID int(11),
  4.     PRIMARY KEY (UserID, ImageID)
  5. );
  6.  
  7. ALTER TABLE USERFAVS
  8.    ADD CONSTRAINT `fk_userID`
  9.         FOREIGN KEY (UserID) REFERENCES users (UserID);
  10.        
  11. ALTER TABLE USERFAVS
  12.    ADD CONSTRAINT `fk_ImageID`
  13.         FOREIGN KEY (ImageID) REFERENCES imagedetails (ImageID);
  14.  
  15.     FOREIGN KEY (UserID) REFERENCES users(UserID),
  16.     FOREIGN KEY (ImageID) REFERENCES imagedetails(ImageID),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement