当前位置:Gxlcms > 数据库问题 > CodeSmith和PowerDesigner的使用安装和数据库创建

CodeSmith和PowerDesigner的使用安装和数据库创建

时间:2021-07-01 10:21:17 帮助过:4人阅读

/*==============================================================*/
/* Database name: PD_test */
/* DBMS name: Microsoft SQL Server 2005 */
/* Created on: 2010/6/13 星期日 17:27:17 */
/*==============================================================*/


dropdatabase PD_test
go

/*==============================================================*/
/* Database: PD_test */
/*==============================================================*/
createdatabase PD_test
go

use PD_test
go

/*==============================================================*/
/* Table: Major */
/*==============================================================*/
createtable Major (
MajorID intidentity,
Name nvarchar(20) notnull,
Remark nvarchar(Max) null,
constraint PK_MAJOR primarykey (MajorID)
)
go

/*==============================================================*/
/* Table: Student */
/*==============================================================*/
createtable Student (
StudentID nvarchar(20) notnull,
MajorID intnull,
Name nvarchar(20) notnull,
Sex bitnotnull,
Age intnull,
Remark nvarchar(Max) null,
constraint PK_STUDENT primarykey (StudentID)
)
go

altertable Student
addconstraint FK_STUDENT_REFERENCE_MAJOR foreignkey (MajorID)
references Major (MajorID)
go 技术分享

 

CodeSmith和PowerDesigner的使用安装和数据库创建

标签:

人气教程排行