create table passenger(pnr number(10) primary key,
trainnumber number(5) foreign key references train(trainnumber),
noofseats number(4),
price number(4),
doj varchar2(10))
ORA-00907:缺少右括号
答案 0 :(得分:1)
foreign key
表达式是多余的(读:错误)。语法只是添加references
:
create table passenger(pnr number(10) primary key,
trainnumber number(5) references train(trainnumber), -- here
noofseats number(4),
price number(4),
doj varchar2(10))
答案 1 :(得分:1)
将yout CREATE TABLE
语句更改为如下所示
create table passenger(pnr number(10) primary key,
trainnumber number(5),
noofseats number(4),
price number(4),
doj varchar2(10),
foreign key (trainnumber) references train(trainnumber))