| A1:
|
create database orders;
use orders;
create table customer
(
customerID int not null auto_increment primary key,
customerName varchar(20),
customerAddress varchar(80)
) type = InnoDB;
create table orders
(
orderID int not null auto_increment primary key,
orderDate date,
customerID int not null references customer(customerID)
) type = InnoDB;
create table item
(
itemID int not null auto_increment primary key,
itemName varchar(20)
) type = InnoDB;
create table orderItem
(
orderID int not null references orders(orderID),
itemID int not null references item(itemID),
itemQuantity int,
primary key (orderID, itemID)
) type = InnoDB;
|