0
回答
Qracle sql语句 转 MySQL sql语句
【腾讯云】校园拼团福利,1核2G服务器10元/月!>>>   

(有没有懂的高手,回复我转换后的SQL)

 

--删除表
--drop table t_order_item;
--drop table t_mc;
--drop table t_mc_type;
--drop table t_order;
--drop table t_user;
--drop sequence seq_t_mc_type;
--drop sequence seq_t_mc;
--drop sequence seq_t_order;
--drop sequence seq_t_order_item;

create table t_mc_type(
nid        number,
sname      varchar2(30) unique,
constraint  PK_MC_TYPE_NID primary key(nid),
npid       number       not null
);
create sequence seq_t_mc_type;
insert into t_mc_type values(seq_t_mc_type.nextval,'手机',0);
insert into t_mc_type values(seq_t_mc_type.nextval,'电脑',0);
insert into t_mc_type values(seq_t_mc_type.nextval,'电视',0);
insert into t_mc_type values(seq_t_mc_type.nextval,'小米',1);
insert into t_mc_type values(seq_t_mc_type.nextval,'魅族',1);
insert into t_mc_type values(seq_t_mc_type.nextval,'apple',1);
insert into t_mc_type values(seq_t_mc_type.nextval,'华硕',2);
insert into t_mc_type values(seq_t_mc_type.nextval,'戴尔',2);
insert into t_mc_type values(seq_t_mc_type.nextval,'飞利浦',3);
insert into t_mc_type values(seq_t_mc_type.nextval,'索尼',3);
insert into t_mc_type values(seq_t_mc_type.nextval,'OPPO',1);
insert into t_mc_type values(seq_t_mc_type.nextval,'联想',2);

create table t_mc(
nid     number,
sname   varchar2(30)    not null,
sdescription  varchar2(300),
nprice        number(7,2)          default 0.00,
simg          varchar2(300),
smctag        char(1)          check (smctag in ('0','1')),
dcdate        date,
nmaxid        number           not null,
nminid        number           not null,
constraint FK_MAXID FOREIGN KEY (nmaxid) references t_mc_type(nid),
constraint  PK_MC_NID primary key(nid),
constraint FK_MINID FOREIGN KEY (nminid) references t_mc_type(nid)
);
create sequence seq_t_mc;
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'小米5','',1799.00,'','1',to_date('2016-04-26','yyyy-mm-dd'),1,4);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'小米max','',1499.00,'','1',to_date('2016-06-21','yyyy-mm-dd'),1,4);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'小米note','',1699.00,'','0',to_date('2015-11-26','yyyy-mm-dd'),1,4);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'小米4s','',1499.00,'','0',to_date('2016-04-26','yyyy-mm-dd'),1,4);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'红米3','',899.00,'','1',to_date('2016-05-16','yyyy-mm-dd'),1,4);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'红米pro','',1699.00,'','1',to_date('2016-07-24','yyyy-mm-dd'),1,4);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'红米note3','',1099.00,'','0',to_date('2016-03-26','yyyy-mm-dd'),1,4);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'红米3x','',799.00,'','1',to_date('2016-07-26','yyyy-mm-dd'),1,4);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'小米5全网通','',2099.00,'','0',to_date('2016-6-11','yyyy-mm-dd'),1,4);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'小米5 4G','',2699.00,'','1',to_date('2016-04-26','yyyy-mm-dd'),1,4);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'红米4','',899.00,'','1',to_date('2016-04-26','yyyy-mm-dd'),1,4);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'红米note2','',799.00,'','1',to_date('2016-04-26','yyyy-mm-dd'),1,4);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'红米note2增强版','',899.00,'','1',to_date('2016-04-26','yyyy-mm-dd'),1,4);


insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'魅族','',2199.00,'','1',to_date('2016-04-26','yyyy-mm-dd'),1,5);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'魅蓝3s','',799.00,'','0',to_date('2016-05-11','yyyy-mm-dd'),1,5);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'魅族PRO6','',3299.00,'','1',to_date('2016-05-11','yyyy-mm-dd'),1,5);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'魅族PRO5','',3299.00,'','0',to_date('2016-06-26','yyyy-mm-dd'),1,5);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'魅族MX4 Pro','',2999.00,'','1',to_date('2016-06-26','yyyy-mm-dd'),1,5);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'魅族MX5','',2599.00,'','1',to_date('2016-05-21','yyyy-mm-dd'),1,5);


insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'iPhone 6s','',5099.00,'','1',to_date('2016-05-21','yyyy-mm-dd'),1,6);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'iPhone 6s Plus','',5888.00,'','0',to_date('2016-06-12','yyyy-mm-dd'),1,6);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'iPhone 5s','',2599.00,'','1',to_date('2016-06-12','yyyy-mm-dd'),1,6);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'iPhone 6','',3699.00,'','1',to_date('2016-05-21','yyyy-mm-dd'),1,6);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'iPhone SE','',3799.00,'','1',to_date('2016-05-21','yyyy-mm-dd'),1,6);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'iPhone 4','',2599.00,'','0',to_date('2015-05-21','yyyy-mm-dd'),1,6);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'iPhone 4s','',2599.00,'','1',to_date('2015-05-14','yyyy-mm-dd'),1,6);

insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'OPPO R9','',2499.00,'','1',to_date('2016-06-14','yyyy-mm-dd'),1,11);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'OPPO A37','',1299.00,'','1',to_date('2016-05-14','yyyy-mm-dd'),1,11);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'OPPO R7S','',1999.00,'','0',to_date('2016-06-24','yyyy-mm-dd'),1,11);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'OPPO R7 Plus','',2699.00,'','1',to_date('2016-05-24','yyyy-mm-dd'),1,11);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'OPPO N3','',1599.00,'','1',to_date('2016-06-22','yyyy-mm-dd'),1,11);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'OPPO R1C','',999.00,'','0',to_date('2016-05-22','yyyy-mm-dd'),1,11);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'OPPO R9 Plus','',2999.00,'','1',to_date('2016-03-26','yyyy-mm-dd'),1,11);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'OPPO A53','',1599.00,'','0',to_date('2016-02-14','yyyy-mm-dd'),1,11);


insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'华硕R557LI','',3199.00,'','0',to_date('2016-02-14','yyyy-mm-dd'),2,7);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'华硕顽石一','',4899.00,'','1',to_date('2016-05-26','yyyy-mm-dd'),2,7);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'华硕灵耀','',6499.00,'','0',to_date('2016-05-26','yyyy-mm-dd'),2,7);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'华硕X450JB','',4899.00,'','1',to_date('2015-11-26','yyyy-mm-dd'),2,7);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'华硕FL5800','',4999.00,'','1',to_date('2015-11-26','yyyy-mm-dd'),2,7);

insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'小米5','',1999,'','1',to_date('2016-07-08','yyyy-mm-dd'),1,4);

insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'戴尔','',3299,'','1',to_date('2016-05-24','yyyy-mm-dd'),2,8);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'戴尔XPS13-9350-R1609','',7999,'','1',to_date('2016-07-08','yyyy-mm-dd'),2,8);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'戴尔灵越新飞匣15ER-152B','',2999,'','1',to_date('2016-05-24','yyyy-mm-dd'),2,8);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'戴尔灵越新飞匣3000系列','',3299,'','1',to_date('2016-07-08','yyyy-mm-dd'),2,8);

insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'联想','',3299,'','1',to_date('2016-05-23','yyyy-mm-dd'),2,12);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'联想 天逸300','',3799,'','1',to_date('2016-05-23','yyyy-mm-dd'),2,12);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'联想 小新Air','',5999,'','1',to_date('2016-07-08','yyyy-mm-dd'),2,12);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'联想 小新310经典版','',4399,'','1',to_date('2015-07-08','yyyy-mm-dd'),2,12);


insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'飞利浦 55PUF606/T3','',2799,'','1',to_date('2015-07-08','yyyy-mm-dd'),3,9);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'飞利浦 40PFF5361/T3','',1599,'','1',to_date('2015-07-08','yyyy-mm-dd'),3,9);

insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'索尼 U9','',4699,'','1',SYSDATE,3,10);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'索尼 KDL-32W600D','',1899,'','1',SYSDATE,3,10);
insert into t_mc(nid,sname,sdescription,nprice,simg,smctag,dcdate,nmaxid,nminid) values (seq_t_mc.nextval,'索尼 KD-49X8000D','',5699,'','1',SYSDATE,3,10);


create table t_user(
suser     varchar2(30),
spwd      varchar2(30) not null,
sname     varchar2(30) not null,
ssex      varchar2(3)  not null,
dbirth    date,         
semail    varchar2(300),
sphone    varchar2(30) ,
saddress  varchar2(300) not null,
scode     char(6),
nlevel    number(1) check(nlevel in (1,5,9)),
dregdate  date,
slock     char(1) check(slock in ('0','1')),
dlastdate date,
constraint  PK_USER_SUSER primary key(suser),
nlogin    number
);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('admin001','123456','admin001','女',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',5,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('admin002','123456','admin002','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',5,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('admin003','123456','admin003','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',5,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('admin004','123456','admin004','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',1,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('admin005','123456','admin005','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',1,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('admin006','123456','admin006','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',1,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('admin007','123456','admin007','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',1,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('admin008','123456','admin008','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',1,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('admin009','123456','admin009','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',1,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('admin010','123456','admin010','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',1,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('superadmin','123456','superadmin','男',sysdate,'409755968','13075904034','福建省福州市至诚学院中二','350000',1,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('amoslee','123456','amoslee','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',9,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('amoslee020','123456','amoslee020','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',9,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('amoslee021','123456','amoslee021','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',9,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('amoslee022','123456','amoslee022','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',9,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('amoslee023','123456','amoslee023','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',9,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('amoslee024','123456','amoslee024','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',9,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('amoslee025','123456','amoslee025','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',9,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('amoslee026','123456','amoslee026','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',9,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('amoslee027','123456','amoslee027','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',9,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('amoslee028','123456','amoslee028','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',9,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('amoslee029','123456','amoslee029','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',9,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('amoslee030','123456','amoslee030','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',5,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('amoslee031','123456','amoslee031','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',5,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('amoslee032','123456','amoslee032','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',5,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('amoslee033','123456','amoslee033','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',5,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('amoslee034','123456','amoslee034','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',5,sysdate,'0',sysdate,0);
insert into t_user(suser,spwd,sname,ssex,dbirth,semail,sphone,saddress,scode,nlevel,dregdate,slock,dlastdate,nlogin)
values('amoslee035','123456','amoslee035','男',sysdate,'409755968@qq.com','130xxxxxxxx','福建省福州市至诚学院东一','350000',5,sysdate,'0',sysdate,0);


create table t_order(
nid          number,
scuser       varchar2(30) not null,
dgdate       date         not null,
spaytype     varchar2(30) not null,
ssendtype    varchar2(30) not null,
nmctypesize  number       not null,
nmcsize      number       not null,
ntotalprice  number       not null,
sstatus      char(1)      check (sstatus in ('1','2','3')),
smsg         varchar2(2000),
sauser       varchar2(30),
dadate       date,
ssname       varchar2(30) not null,
ssadress     varchar2(30) not null,
sscode       char(6)      not null,
ssphone      varchar2(30) not null,
ssemail      varchar2(300),
constraint FK_ORDER_USER_NAME foreign key (sauser) references t_user(suser),
constraint  PK_ORDER__NID primary key(nid),
constraint FK_ORDER_USER foreign key (scuser) references t_user(suser)
);
create sequence seq_t_order;

create table t_order_item(
nid      number,
norderid number       not null,
itemid   number       not null,
smcname  varchar2(30) not null,
sdescription   varchar2(300),        
simg           varchar2(300),
ncount         number       default 0,
nprice         number       default 0,
ntotalprice    number       default 0,
constraint  PK_ORDER_ITEM_NID primary key(nid),
constraint  FK_ORDER_ITEM FOREIGN KEY (norderid) references t_order(nid),
constraint  FK_MC   FOREIGN KEY (itemid) references t_mc(nid)
);
create sequence seq_t_order_item;

举报
Xenihack
发帖于8个月前 0回/61阅
顶部