巴扎黑2017-04-17 16:41:48
When two tables establish a one-to-many relationship, the "one" end is the parent table, and the "many" end is the child table.
General
Set the primary key in the parent table
Set the foreign key in the child table
According to your choice: Method 2
PHPz2017-04-17 16:41:48
Method 2, but it is not recommended to build foreign keys on the database
巴扎黑2017-04-17 16:41:48
Method 1 + Method 2 together, because I want to conveniently query the current version of the file and make data redundant, haha