--sql the relationship between table and table--
First of all, learn to find the relationship between the table and the table
Only the relationship between the table and the table can be found.
Can be a key table, and easy to query.
There are three relationships between table and table
(1) There is a one-to-one relationship between the primary keys of two tables
Add a table with the primary key of the table as a foreign key.
(2) There is a one-to-many relationship between the primary keys of the two tables
In the "One" table, create a foreign key for the "one" table with the primary key of the "many" table.
(3) There are many-to-many relationships between the primary keys of the two tables
Re-create a new table and add the primary key for the table as a foreign key for the two table.
Plus the relationship property between the two tables.
--sql Building Table--
For example, create a table for a database named class
(not finished) SQL Database Build table (basic Daniel, please float over, thank you.)