I have been searching and playing around with the code trying to figure out why its giving me parenthesis error when I followed the format of Oracle referencing in other tables
Create table TourOperator (TOID int PRIMARY KEY, Cname varchar (20), phone long int);
Create table Airline(Aname varchar(20) PRIMARY KEY, Website varchar(255), Phone int(10), TOID int, FOREIGN KEY(TOID) REFERENCES TourOperator);
The Impaler :
You have a few issues in your SQL, according to the Oracle syntax:\n\nThe type INT cannot be qualified with a size.\nThe type VARCHAR technically does exist in Oracle, but is not recommended; use VARCHAR2 instead.\nThe syntax of the foreign key clause is wrong.\nAvoid the type LONG; it's a legacy type that you shouldn't use for new databases. I changed the phone column to VARCHAR2.\n\nThe SQL can run as:\nCreate table TourOperator (\n TOID int PRIMARY KEY, \n Cname varchar2(20), \n phone varchar2(20)\n);\n\nCreate table Airline(\n Aname varchar2(20) PRIMARY KEY, \n Website varchar2(255), \n Phone int, \n TOID int REFERENCES TourOperator (TOID)\n);\n\nSee running example at db<>fiddle.",
2021-03-13T04:19:37