--创建数据库
CREATE DATABASE stuDB
ON
(
NAME='student.mdf',
FILENAME='E:/chengxu/SQL/student.mdf',
SIZE=3MB,
FILEGROWTH=2MB,
MAXSIZE=100MB
)
LOG ON
(
NAME='student.ldf',
FILENAME='E:/chengxu/SQL/student.ldf',
SIZE=3MB,
FILEGROWTH=2MB,
MAXSIZE=100MB
)
GO
--建学生表
CREATE TABLE student
(
stuNo NCHAR(6) NOT NULL,
stuName NVARCHAR(20) NOT NULL,
stuSex NCHAR(4) NOT NULL,
stuAge SMALLINT NOT NULL,
stuAddress NVARCHAR(50),
stuScore FLOAT,
stuSeat SMALLINT IDENTITY(1,1)
)