create table cusOrder(
	orderID int primary key auto_increment,
	customerID varchar(10),
	orderTime datetime,
	deliveryDay date,
	deliveryPostcode char(8),
	deliveryAddr varchar(300),	
	receiverName varchar(60), 
	status char(10),
	foreign key (customerID) references customer(customerID));

create table orderWine(
    id int primary key auto_increment,
    ordID int,
    wID int,
    qty int,
    foreign key (ordID) references cusOrder(orderID),
    foreign key (wID) references wine(wineID)); 

create table orderWineSet(    
    id int primary key auto_increment,
    ordID int,
    setID varchar(20),
    qty int,
    foreign key (ordID) references cusOrder(orderID),
    foreign key (setID) references wineSet(setID));

create table bill(
    billID int primary key not null auto_increment,
    cID varchar(10),
    ordID int,
    reqDay datetime,
    deadline datetime,
    payAmount int,
    status varchar(100),
    foreign key (cID) references customer(customerID),
    foreign key (ordID) references cusOrder(orderID));