1, using Powerdesignerp: Primary key F: Foreign key M: Nullable
2, when two tables establish a primary foreign key relationship, the primary foreign key name is the same. For example, A table a_id name Description ID (P)
B table b_id name Description ID (P)
To set the b_id in table B to the foreign key of table A, add a field named b_id in Table A.
3, after the modeling is completed, you can generate the database file, click database----Generate Database----Select the file save path, define the filename (default: t_carsell.sql)----determine
This file is powerdesigner based on drawing, connect the relationship between the various icons automatically generated SQL statements, put in the database execution is OK
4, if the database is installed, directly double-click Open, write the code in front of CREATE database to define the name you want
Go
Create a database
5, select the database code that was generated by the open file in the third step to run
6, Database creation succeeded
Generating a database with the PowerDesigner modeling tool