Database design process the foreign key role

 

转自" Https://Zhidao.Baidu.Com/question/445274717.Html "

A table has fields (e.g., ID number) made the primary key of this table also has a field B (ID number), where a certain ID number field from the same table of contents A, B, then the table is called the field table a foreign key field, that is, two tables with the ID number in this field were established. 
Table A, ID number field inside ID number must be unique, can not be duplicated, while Table B inside the same ID number can appear multiple times. This is known as Table A and Table B field ID number ID number field to establish a one to many relationship. 
Foreign keys allow identification number is guaranteed to be from Table A, that is, to ensure that the specification of the data; if you want to delete a table ID number A, then B must first delete the table the same ID number, which ensures data integrity

 

Guess you like

Origin www.cnblogs.com/isme-zjh/p/11793063.html