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


/ Published in: SQL
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.