Search
 
SCRIPT & CODE EXAMPLE
 

SQL

cascade delete on update

CREATE TABLE child (
        id INT, 
        parent_id INT,
        INDEX par_ind (parent_id),
        FOREIGN KEY (parent_id) 
            REFERENCES parent(id)
            ON UPDATE CASCADE ON DELETE CASCADE
    ) ENGINE=INNODB;
Comment

on update cascade

CREATE TABLE child (
    id INT, 
    parent_id INT,
    INDEX par_ind (parent_id),
    FOREIGN KEY (parent_id) 
        REFERENCES parent(id)
        ON UPDATE CASCADE
) ENGINE=INNODB;
Comment

PREVIOUS NEXT
Code Example
Sql :: compare if is null sql 
Sql :: select * from 
Sql :: update all columns in one update 
Sql :: test connection to sql server 
Sql :: SELECT SQL LIKE 
Sql :: migrations.RunSQL 
Sql :: table user postgres 
Sql :: how do you insert boolean to postgresql 
Sql :: mysql create database 
Sql :: how to join result table in mysql 
Sql :: aliasing in sql 
Sql :: sql query checker 
Sql :: casterar postgres 
Sql :: use table postgres 
Sql :: how to count codition 
Sql :: ORACLE: How to get all column with GROUP by only 1 column? 
Sql :: call procedure in wordpress 
Sql :: mysqlimport: Error: 4166 
Sql :: configurer mysqlwampserver a distance 
Sql :: Windows internal database connection 
Sql :: query archive mode 
Sql :: oracle sqlp update amount / quantity 
Sql :: PSQL qith variables 
Sql :: How to calculate average of average salary of departments? 
Sql :: Getting error while running 50 MB script on SQL Server 
Sql :: opensuse start MySQL 
Sql :: SQL INNER JOIN With AS Alias 
Sql :: T-SQL look for records with a hex value in a text field 
Sql :: mariadb select limit offset 
Sql :: Filter on observations that are null SQL 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =