I want to create two tables Publisher and Book. Here are the SQL statements for creating the tables.
I want to create a foreign key constraint in the Book table. I'm not sure why it's throwing this error. I cross-checked all the parenthesis. The syntax seems to be fine but it's not creating the table.
CREATE TABLE Publisher
(
pub_name varchar2(128) PRIMARY KEY,
phone integer,
address varchar2(20)
);
CREATE TABLE Book
(
book_id integer NOT NULL PRIMARY KEY,
title varchar2(256),
pub_year number(4) UNSIGNED,
pub_name REFERENCES Publisher(pub_name) ON DELETE CASCADE ON UPDATE CASCADE
);
In Oracle, there's no
UNSIGNEDnorON UPDATE CASCADE.