Database Design tools we still use enterprise connector 7.5 in Chinese
Here I will introduce ea a little. I personally prefer enterprise impact ect. This tool is similar to Rational Rose.
The cracked version is available on the Internet. It supports full-Process Modeling from Requirement Analysis to design deployment.
We used its use case modeling. Next we started to use its database modeling. The following is the EA operation interface:
Double-click the data model under the model on the right and select the table under the class on the left to create a new table:
The key here is to select a database: I chose SQL Server 2005. after entering the data name, select table detail:
Select columns/variables:
Defines the column name and data type for the table, as well as constraints and Foreign keys.
To add a link between a table and a table, you can select the link icon of the operation (the first one ):
Double-click the newly created Association (that is, the link just created above) and select:
Select the primary foreign key and level (that is, one-to-many ).
Note that source role indicates the master table, and target role indicates the slave table.
Below are the databases I have defined:
After modeling, you can generate an SQL statement to create a database:
Select all objects as follows:
Enter the following window:
Select generate primary/foreign key, generate index/constraint (you can generate according to your own needs), and then save:
The generated SQL statement is as follows:
Create Table userinfo (
Userid int not null,
Isadmin tinyint not null,
Username nvarchar (50) not null,
Createdate datetime,
Modifydate datetime
)
;
Create Table Info (
Infoid int not null,
Infoname nvarchar (200) not null,
Infocontent text,
Typeid int,
Pictureurl nvarchar (4000 ),
Createid int,
Createdate datetime,
Modifydate datetime,
Attachmenturl nvarchar (4000 ),
Istop tinyint
)
;
Create Table infotype (
Typeid int not null,
Typename nvarchar (100 ),
Createid int,
Istop tinyint,
Createdate datetime,
Modifydate datetime
)
;
Alter table userinfo add constraint pk_user
Primary Key clustered (userid)
;
Alter table info add constraint pk_info
Primary Key clustered (infoid)
;
Alter table infotype add constraint pk_infotype
Primary Key clustered (typeid)
;
Alter table infotype
Add constraint uq_infotype_typename unique (typename)
;
Create a database in SQL Server and run the SQL statement generated above.
This completes the database design.