create table product(
id int not null primary key auto_increment,
productname varchar(20) not null,
productstye varchar(20) not null,
productdescr varchar(255),
price double
);create table user(
id int not null primary key auto_increment,
username varchar(10) not null,
password varchar(20) not null,
zone varchar(30) ,
address1 varchar(30),
address2 varchar(30),
postcode varchar(8),
homephone varchar(18),
officephone varchar(18),
mobile varchar(13),
email varchar(30)
);create table huxm_order(
id int not null primary key auto_increment,
uid int not null,
cost double,
foreign key (uid) references user(id) 
);/////////////////////////
create table order_item(
id int not null primary key auto_increment,
oid int not null,
pid int not null,
allnum int,
cost double,
foreign key(oid) references huxm_order(id),
foreign key(pid) references porduct(id)
);
/////////////////////////
这个表创建不了,
不知道为什么?
前面三个表都很正常!

解决方案 »

  1.   

    这好像是MYSQL的语法啊,不是ORACLE语法!
      

  2.   

    oracle 不支持 auto_increment。
      

  3.   

    create table order_item(
    id int not null primary key auto_increment,
    oid int not null,
    pid int not null,
    allnum int,
    cost double,
    foreign key (oid) references huxm_order(id),
    foreign key (pid) references product(id)
    );不好意思!
    是自己粗心
    把product写成了porduct
    我也是找了很久才发现的