create table Customers
(
    CustomersID int unsigned not null auto_increment primary key, //主键,自曾
    Name char(50) not null,
    Address char(120) not null,
    City char(30) not null
)

1 create table orders
2 (
3 orderID int unsigned not null auto_increment primary key,
4 customerID int unsigned not null,
5 amount float(6,2),
6 date date not null
7 )
8
9  create table books
10 (
11 ISBN char(13) not null primary key,
12 author char(50),
13 title char(50),
14 price float(4,2) //指定显示宽度和小数点后的位数
15 )
16
17  create table order_itme
18 (
19 orderID int unsigned not null,
20 isbn char(13) not null,
21 quantity tinyint unsigned,
22 primary key(orderID,isbn) //使用多列组成主键
23
24 )
25
26 create table book_reviews
27 (
28 isbn char(13) not null primary key,
29 review text
30 )

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
  • 2022-01-07
  • 2021-12-19
  • 2021-09-25
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-02
  • 2021-12-04
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案