drop table hotel;
create table hotel (
       hid		integer,
       name		varchar(30),
       address		varchar(30),
       city		varchar(30),
       state		char(2),
       zip		char(5),
       phone		char(15),
       contact		varchar(30),
       aaarating	integer,
       petsok		boolean,
       ischambermember	boolean,
       primary key (hid)
);

drop table listing;
create table listing (
       lid		integer,
       hid		integer,
       numrooms		integer,
       price		double(10,2),
       startdate	date,
       enddate		date,
       datemodified	date,
       isdiscounted	boolean,
       notes		varchar(500),
       primary key (lid),
       foreign key (hid) references hotel
);

drop table referral;
create table referral (
       lid		integer,
       datereferred	date,
       startdate	date,
       enddate		date,
       numrooms		integer,
       notes		varchar(500),
       foreign key (lid) references listing
);
