Answers for "drop cascade"

SQL
2

drop cascade

drop table if exists table_name cascade;
Posted by: Guest on February-02-2021
0

on delete cascade

CREATE TABLE child_table
(
  column1 datatype [ NULL | NOT NULL ],
  column2 datatype [ NULL | NOT NULL ],
  ...

  CONSTRAINT fk_name
    FOREIGN KEY (child_col1, child_col2, ... child_col_n)
    REFERENCES parent_table (parent_col1, parent_col2, ... parent_col_n)
    ON DELETE CASCADE
    [ ON UPDATE { NO ACTION | CASCADE | SET NULL | SET DEFAULT } ] 
);
Posted by: Guest on November-11-2020
0

on delete cascade

CREATE TABLE child (
    id INT, 
    parent_id INT,
    INDEX par_ind (parent_id),
    FOREIGN KEY (parent_id) 
        REFERENCES parent(id)
        ON DELETE CASCADE
) ENGINE=INNODB;
Posted by: Guest on July-27-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language