Answers


Quiz

A1:

c

A2:

a

A3:

c

A4:

d

A5:

b


Exercises

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; 
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.




MySQL Tutorial
MySQL Tutorial
ISBN: 0672325845
EAN: 2147483647
Year: 2003
Pages: 261

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net