create table user(
id number primary key,
name varchar2(32) not null unique,
password varchar2(32) not null,
address varchar2(512),
postcode varchar2(10),
email varchar2(32),
home_phone varchar2(32),
cell_phone varchar2(32),
office_phone varchar2(32)
);
insert into user values(1,'tarena','tarena','dazhongsi','100081','tarena@tarena.com.cn','62136369','62136369','62136369');
create table product(
id number primary key,
name varchar2(32) not null,
description varchar2(64),
price number(8,2) not null
);
insert into product values(1,'pencil','pencil',2.00);
insert into product values(2,'pen','pen',5.00);
insert into product values(3,'rubber','rubber',1.00);
insert into product values(4,'notebook','notebook',2.00);
insert into product values(5,'gluewater','gluewater',5.00);
insert into product values(6,'pencilcase','pencilcase',10.00);
insert into product values(7,'ballpen','ballpen',2.00);
create table user_order(
id number primary key,
status number,
user_id number references user(id),
cost number(10,2)
);
create table order_item(
id number primary key,
amount number,
product_id number references product(id),
order_id number references user_order(id)
);