sqlserver创建数据库和表

create database MySchool
on
(
name='MySchool_data',
filename='D:\WORK\Database\MySchool_data.mdf',
size=5mb,
maxsize=10mb,
filegrowth=15%
)
log on
(
name='MySchool_log',
filename='D:\WORK\Database\MySchool_log.ldf',
size=2mb,
maxsize=4mb,
filegrowth=1mb
)
go
use MySchool
go
create table Class
(
cId int identity(1,1) primary key,
cName nvarchar(50) not null,
cDesc Text
)
create table Student
(
sId int identity(1,1) primary key,
sClassId int not null,
sName nvarchar(50) not null,
sAge int not null,
sNo numeric(18,0),
sSex char(1) not null,
sEmail varchar(50)
)

你可能感兴趣的:(sqlserver)