Simple conceptual question

simple conceptual answer –

when two tables are related with a foreign key, we usually name one of these tables as the parent table, and the other as the child table

the child table contains the foreign key, which references the parent table’s primary key

what usually happens is that a row must already exist in the parent table before a row which references it can be inserted into the child table

so when you insert a row in the child table, you must give the foreign key value, which must reference an existing primary key value in the parent table

2 Likes