Guest User

Untitled

a guest
Jun 25th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
  2. /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  3.  
  4. /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  5. /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
  6.  
  7. Create table table1 (id int not null, val varchar(10))
  8. Create table table2 (id int, t1id int, val varchar(10))
  9.  
  10. Alter table table1 add
  11. Constraint pk_table1 Primary Key (id)
  12. Alter table table2 Add
  13. Constraint fk_table1 Foreign Key (t1id) References table1(id)
Add Comment
Please, Sign In to add comment