A
A
Alexey2020-05-29 15:36:00
MariaDB
Alexey, 2020-05-29 15:36:00

How to automatically set null for elements associated with id?

Given table 1.
id_tabl1(pk), name
Given table 2.
id_tabl2(pk), name, tabl1 (fk: tabl1 on id_tabl1) Cascading

update by fk.

table1 has the possibility of null values.

I can’t remember and find how to put null in an entry in table 2 if the entry from table 1 to which it referred was deleted.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2020-05-29
@Upachko

foreign key ... on delete set null

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question