登录
mysql -h hostname -u username -p
创建数据库-books
create database books
创建表格-customer
create table customers
(customerid int unsigned not null auto_increment primarykey,
name char(50) not null,
address char(100) not null,
city char(30) not null)
创建表格-orders
create table orders
(orderid int unsigned not null auto_increment primary key,
customerid int unsigned not null,
amount float(6,2),
date date not null)
创建表格-books
create table books
(isbn char(13) not null primary key,
author char(50),
title char(100),
price float(4,2))
创建表格-order_items
create table order_items
(orderid int unsigned not null,
isbn char(13) not null,
quantity tinyint unsigned,
primary key (orderid,isbn))