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;
A2:
alter table orders add column comment text;
A3:
drop database orders;
Note that we have changed the name of the table called order to orders because order is a reserved word. You may also choose to put quotes around it to get it to work.