user666748
user666748

Reputation: 5

Have error while creating table in oracle?

I have an error in creating table with following command:

Create table Sells
(Store_name varchar2(20) no null,
ISBN char(15) not null,
Unit_price number(3,2) not null,
Shipping_fee number(3,2) not null,
primary key(Store_name, ISBN),
foreign key (Store_name) references Bookstore(Name) on delete cascade,
check(Unit_price>0),
foreign key (ISBN) references Books(ISBN) on delete cascade;

It says:

ORA-00907: missing right parenthesis

Not able to figure out where is the mistake. Anyone provide some help on why this is wrong?

Upvotes: 0

Views: 230

Answers (2)

Raj
Raj

Reputation: 1

Create table Sells (Store_name varchar2(20) not null, ISBN char(15) not null, Unit_price number(3,2) not null, Shipping_fee number(3,2) not null, primary key(Store_name, ISBN), foreign key (Store_name) references Bookstore(Name) on delete cascade, check(Unit_price>0), foreign key (ISBN) references Books(ISBN) on delete cascade*)*;

Upvotes: 0

Edwin Dalorzo
Edwin Dalorzo

Reputation: 78639

create table sells
(
  store_name varchar2(20) not null, 
  isbn char(15) not null, 
  unit_price number(3,2) not null, 
  shipping_fee number(3,2) not null, 
  primary key(store_name, isbn),
  foreign key (store_name) 
    references book_store(name)
      on delete cascade, 
  check(unit_price>0),
  foreign key (isbn) 
    references books(isbn)
    on delete cascade
);

Upvotes: 3

Related Questions