Search
 
SCRIPT & CODE EXAMPLE
 

SQL

mysql delet from the child table when we delete the rows from the parent

MySQL ON DELETE CASCADE

syntax:
CREATE TABLE Employee (  
  emp_id int(10) NOT NULL,  
  ...
  ...
  PRIMARY KEY (emp_id)  
);  

CREATE TABLE Payment (  
  payment_id int(10) PRIMARY KEY NOT NULL,  
  emp_id int(10) NOT NULL,  
  ...
  ...
  FOREIGN KEY (emp_id) REFERENCES Employee (emp_id) ON DELETE CASCADE  
);  
Comment

PREVIOUS NEXT
Code Example
Sql :: sql server inner join 
Sql :: import sql file to mysql db using shell commands 
Sql :: sql select inside select sub query 
Sql :: oracle add attribute to table 
Sql :: flask sqlalchemy remove duplicates 
Sql :: linq inner join 
Sql :: copy data from one database to another 
Sql :: SQL Comments Within Statements 
Sql :: three inner joins sql 
Sql :: description query in sql 
Sql :: select indexname psql 
Sql :: What is SQL data store? 
Sql :: mysql select non integer values 
Sql :: sql is null and is not null 
Sql :: mysql multiply 
Sql :: mysqldump cli command 
Sql :: clustered-nonclustered indexes(constraints) 
Sql :: sqlalchemy query join many to many 
Sql :: last mysql 
Sql :: search from comma separated values in sql server 
Sql :: sql procedure 
Sql :: python list from sql 
Sql :: stuff and replace in sql 
Sql :: table user postgres 
Sql :: identity column in sql server 
Sql :: non relational database 
Sql :: TITLE: SQL Server principal "dbo" does not exist 
Sql :: install sql 
Sql :: recursive query herarchical data sql server 
Sql :: configurer mysqlwampserver a distance 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =