create database petstore;
use petstore;
create table account (
userid char(6) not null ,
fullname varchar(10) not null ,
    password varchar(20) not null ,
    sex char(2) not null ,
    address varchar(40) null ,
    email varchar(20) null ,
    phone varchar(11) not null ,
    primary key (userid)
);
create table category(
catid char(10) not null ,
    catname varchar(20) null ,
    primary key (catid)
);
create table product (
productid char(10) not null ,
    catid char(10) not null ,
    name varchar(30) null ,
    descn text null,
    listprice decimal(10,2) null,
    unitcost decimal(10,2) null,
    qty int(11) not null ,
    primary key (productid)
);
create table orders (
orderid int(11) not null auto_increment,
    userid char(6) not null ,
    orderdate datetime not null ,
    totalprice decimal(10,2) default null ,
    status tinyint(1) default null ,
    primary key (orderid)
);
create table lineitem(
orderid int(11) not null ,
    itemid char(10) not null ,
    quantity int(11) not null ,
    unitprice decimal(10,2) not null ,
    primary key (orderid,itemid)
);© 版权声明
THE END
    








 
				
暂无评论内容