Create database yf
on primary
(name = USERDBFile3,
filename ='D:\sql\YF\yaofan.mdf',
size=10MB,
maxsize=100MB,
filegrowth=10MB),
(name = USERDBFile4,
filename='D:\sql\YF\USERDBFile4.ndf',
size =10MB,
maxsize=100MB,
filegrowth=10%)
log on
(name =USERDBLog2,
filename='D:\sql\YF\USERDBLog.2df',
size =10MB,
maxsize=50MB,
filegrowth=5MB)
go
use yf
go
--创建药品Drug表
create table Drug
(DRno varchar(10) NOT NULL primary key,
DRname varchar(50) NOT NULL,
DRspecs varchar(20) NOT NULL,
DRpice varchar(10) null,
DRmanuadate date,
DRnumber INT,
DRunit char(10),
DRvaliddate date)
go
--创建数据表suppliers供应商
create table Suppliers
(SUno varchar(10) NOT NULL PRIMARY KEY,
SUname varchar(50) NOT NULL ,
SUaddr varchar(50) NOT NULL,
SUcontatacts varchar(10) NOT NULL,
SUtel char(11) NOT NULL)
GO
--创建顾客表Customer
create table Customer
(CUno varchar(50) NOT NULL PRIMARY KEY,
CUname varchar(50) NOT NULL,
CUsex char(2) NOT NULL,
CUborn date NOT NULL,
CUtel char(11) NOT NULL)
GO
--创建数据表Purchase入库
create table Purchase
(DRno varchar(10) NOT NULL primary key,
SUmo varchar(10),
Pnumber int,
Pdate date,)
go
--创建数据表Sale
create table Sale
(CUno varchar(10) not null primary key,
DRno varchar(10) not null,
Snumber int not null,
Sdate date not null)
go