Posted By

JohnnyGamba on 10/30/10


Tagged

sql


Versions (?)

Actualizar, Eliminar llaves primarias de una tabla y sus tablas hijas


 / Published in: SQL
 

  1. CREATE TABLE Bugs (
  2.  
  3. reported_by BIGINT UNSIGNED NOT NULL,
  4. STATUS VARCHAR(20) NOT NULL DEFAULT 'NEW' ,
  5.  
  6. FOREIGN KEY (reported_by) REFERENCES Accounts(account_id)
  7. ON UPDATE CASCADE
  8. ON DELETE RESTRICT,
  9.  
  10. FOREIGN KEY (STATUS) REFERENCES BugStatus(STATUS)
  11. ON UPDATE CASCADE
  12. ON DELETE SET DEFAULT
  13. );

Report this snippet  

You need to login to post a comment.