Create table user ( userID char(10) primary key, name varchar(6) not null, sex char(2) not null, ) create table clothes ( barcode char (20)primary key, brand varchar(20)not null, price float not null, introduction varchar(40)not null, type varchar(40)not null, date datetime ) create table customer ( customerID char(10)primary key, customername varchar(6)not null, phone char(11)not null, address varchar(40)not null, code char(6)not null check(Czip like ‘[0-9][0-9][0-9][0-9][0-9][0-9]’) ) create table supplier ( factoryID char(4)primary key, factoryname varchar(40)not null, contact varchar(6)not null, phone char(11)not null, address char(40)not null ) create table supply ( barcode char(20)references clothes(barcode), factoryID char(4)references supplier(factoryID), price float, amount int check(amount>0), date datetime, primary key(barcode ,factoryID,price,amount,date) ) create table store ( storeID char(3)primary key, address char(20)not null default’下沉花园’for地址, ) create table inventory ( storeID char(3)references store(storeID), barcode char(20)references clothes(barcode), amount int not null, primary key(storeID,barcode) ) create table order ( orderID char(6)primary key, transaction char(10)not null, date datetime not null, pricesum float not null check(pricesum>0), amount int not null, customerID char(10)references customer(customerID), barcode char(20)references clothes(barcode), userID char(10)references user(userID), ) create table shoppingcart ( shoppingcartID char(10)primary key, customerID char(10)not null, clothesID char(10)not null, amount int not null, ) create table logistics ( logisticsID char(20)primary key, company char(10)not null, customerID varchar(6)not null, phone char(11)not null, address varchar(40)not null, )
时间: 2024-04-06 09:28:36 浏览: 153
CHAR和VARCHAR类型-第2章 mysql教程基础知识--张文元
请问你想询问什么?以上是一段 SQL 语句,它创建了十个表格,分别是 user、clothes、customer、supplier、supply、store、inventory、order、shoppingcart、logistics,每个表格都有不同的属性和关系。你是否对这些表格和属性有什么疑问或需要更深入的了解?
阅读全文