create database pay on (
/因为C盘有权限设定等,无法在C盘中建立/
Name = pay1,Filename=‘E:\TNT\SQL\paydata1.mdf’,
Size = 10,Maxsize=100,FileGrowth=5%)
LOG on (Name=pay3,filename=‘E:\TNT\SQL\paylog.ldf’,
Size=5,
Maxsize=25,
FileGrowth=10);
/drop database pay;/
alter database pay add file ( Name = pay2,Filename=‘E:\TNT\SQL\paydata2.ndf’,
Size = 5,Maxsize=20,FileGrowth=2);/添加文件实验一——1/
/已经执行以下语句 control+L/
use pay create table pay.dbo.dept
(DeptNo varchar(10) not null unique,
DeptName varchar(20) not null);
use pay create table pay.dbo.person
(No char(6) primary key,
Name char(10) not null,
Sex char(2) not null,
Birthday DATETIME/* DEFAULT GETDATE()*/,
Professor varchar(12),
DeptNo varchar(10) not null foreign key(DeptNo) REFERENCES dept(DeptNo));
use pay create ta