sql - Automatic connection of a new table in a existing Mysql database -
i have schema on db there tables. have create table schema , have connect others present on schema.i make example:
tables present:
school(idschool,numstud,idcountry); shop(idshop,idcountry);
new table:
country(idcountry,....);
i want know if there automatic mode connect them (it means not set foreign key manually).
i want know if there automatic mode connect them (it means not set foreign key manually).
no.
how dbms know country.idcountry
, school.idcountry
given same name intention connected, instead of accidentally?
you'll have use alter table ... add foreign key (...) references ...
1 explicitly create foreign key in existing table.
1 or alter table ... add constraint ... foreign key (...) references ...
.
Comments
Post a Comment