Reputation: 131
I'm going through material for the Oracle Database SQL Certification exam. The very first example given doesn't seem to work.
I'm currently using MySQLWorkbench, but have pasted the example into various online tools, too with the same result. I've looked all over for why this would happen, but can find no answer.
CREATE TABLE SHIPS
(
SHIP_ID NUMBER,
SHIP_NAME VARCHAR2(20),
CAPACITY NUMBER,
LENGTH NUMBER
);
This won't compile, and has has the NUMBER and VARCHAR2 underlined in red. On mouse over it says:
Syntax Error: unexpected 'NUMBER' (number)
or:
Syntax Error: unexpected 'VARCHAR2' (identifier)
Upvotes: 0
Views: 316
Reputation: 48850
Your query runs well. I tried it in DB Fiddle and it works. See by yourself in DB Fiddle. You can use this web site to try out your Oracle queries.
Avoid using MySQL tools, since MySQL and Oracle are quite different and your examples won't work as you expect.
Upvotes: 1