Answers for "mysql foreign key on update"

SQL
6

alter table add foreign key mysql

ALTER TABLE orders
ADD 
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
Posted by: Guest on May-29-2020
1

mysql modify foreign key

-- 2 Step process
ALTER TABLE tbl_name_1 DROP FOREIGN KEY fk_name;
ALTER TABLE tbl_name_1 ADD FOREIGN KEY fk_name(fk_col)
            REFERENCES tbl_name_2(pk_name) ON DELETE RESTRICT;


-- Use to find the name of the FOREIGN KEY 
SHOW CREATE TABLE tbl_name;
Posted by: Guest on July-20-2021
1

mysql alter add foreign key

ALTER TABLE ordenes ADD ticket VARCHAR(50) NOT NULL;
ALTER TABLE ordenes ADD CONSTRAINT fk_ticket FOREIGN KEY (ticket) REFERENCES tickets(ticket);
Posted by: Guest on October-19-2020

Code answers related to "mysql foreign key on update"

Code answers related to "SQL"

Browse Popular Code Answers by Language