CREATE TABLE Amusement
(Aid Int Primary Key IDENTITY,
Aname Varchar(200) Not Null,
Contact Varchar(100),
Phone Varchar(100),
Address Varchar(100),
Postcode Varchar(10),
AreaId Int,
Input_time Char(17)
)
go
CREATE TABLE Area
(AreaId Int Primary Key IDENTITY,
AreaName Varchar(40) NOT NULL,
AreaType Smallint NOT NULL
)
go
CREATE TABLE Hotel
(Hid Int Primary Key IDENTITY,
Hname Varchar(200) Not Null,
Hlevel Varchar(40),
Contact Varchar(100),
Phone Varchar(100),
Address Varchar(100),
Postcode Varchar(10),
Price1 Decimal(10,2),
Price2 Decimal(10,2),
Price3 Decimal(10,2),
Price4 Decimal(10,2),
AreaId Int,
Input_time Char(17)
)
go
CREATE TABLE lamuse
(lid Int Not Null,
Iid Int Not Null,
aTimes Tinyint
)
go
CREATE TABLE lhotel
(lid Int Not Null,
hid Int Not Null,
rType Tinyint,
rdays Tinyint
)
go
CREATE TABLE lplace
(lid Int Not Null,
pid Int Not Null
)
go
CREATE TABLE lplane
(lid Int Not Null,
direct TinyInt Not Null,
pid Int Not Null
)
go
CREATE TABLE lres
(lid Int Not Null,
rid Int Not Null,
rType Tinyint,
rTimes Tinyint
)
go
CREATE TABLE ltrain
(lid Int Not Null,
direct TinyInt Not Null,
tid Int Not Null,
tType Tinyint
)
go
CREATE TABLE Place
(Pid Int Primary Key IDENTITY,
Pname Varchar(200) Not Null,
Contact Varchar(100),
Phone Varchar(100),
Address Varchar(100),
Postcode Varchar(10),
Adult_price Decimal(10,2),
Child_price Decimal(10,2),
AreaId Int,
Input_time Char(17)
)
go
CREATE TABLE Plane
(Pid Int Primary Key IDENTITY,
AirCom Varchar(50) Not Null,
Pno Varchar(20) Not Null,
Sairport Varchar(40),
Eairport Varchar(40),
Stime Varchar(40),
Etime Varchar(40),
Price1 Decimal(7, 2),
Price2 Decimal(7, 2),
Cycle Char(7),
Input_time Char(17)
)
go
CREATE TABLE Restaurant
(Rid Int Primary Key IDENTITY,
Rname Varchar(200) Not Null,
Rlevel Varchar(40),
Contact Varchar(100),
Phone Varchar(100),
Address Varchar(100),
Postcode Varchar(10),
Breakfast Decimal(10,2),
Dinner Decimal(10,2),
AreaId Int,
Input_time Char(17)
)
go
CREATE TABLE tline
(lid Int Primary Key,
lname Varchar(50),
lday Smallint,
ltype Smallint,
insCom Varchar(40),
insFee Decimal(8, 2),
otherCost Decimal(8, 2),
tourPay Decimal(8, 2),
benefit Decimal(8, 2),
AreaId Int
)
go
CREATE TABLE Train
(Tid Int Primary Key IDENTITY,
Tno Varchar(20) Not Null,
Sstation Varchar(40),
Estation Varchar(40),
Stime Varchar(40),
Etime Varchar(40),
PriceYz Decimal(7, 2),
PriceRz Decimal(7, 2),
PriceYw Decimal(7, 2),
PriceRw Decimal(7, 2),
Input_time Char(17)
)
go
CREATE TABLE Users
(UserName Varchar(40) Primary Key,
Pwd Varchar(40) NOT NULL,
EmpName Varchar(40)
);
INSERT INTO Users Values('Admin', 'Admin', 'Admin')