1
create table Consulting Project(
             ID           varchar(4) not null,
             Name         varchar(5) not null,
             Gender       varchar(1) not null,
             Job_Title    varchar(15) not null,
             Contribution number(1,0) not null
)

and got

ORA-00922: missing or invalid option

Ilyes
  • 14,640
  • 4
  • 29
  • 55
Kelly Yang
  • 21
  • 1
  • 2

2 Answers2

5

Some notes. I would suggest:

create table ConsultingProject(
         ID           varchar2(4) primary key,
         Name         varchar2(5) not null,
         Gender       varchar2(1) not null,
         Job_Title    varchar2(15) not null,
         Contribution number(1,0) not null
);

Notes:

  • Your problem is the space in the table name. Just make it one word
  • Oracle recommends varchar2 instead of varchar.
  • Declaring a primary key is a good idea for a table.
  • The scale and precision are not needed on number. Perhaps you just want char(1).
Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786
2

That because the space in the table name. You can change it to

create table Consulting_Project(
             ID           varchar(4) not null,
             Name         varchar(5) not null,
             Gender       varchar(1) not null,
             Job_Title    varchar(15) not null,
             Contribution number(1,0) not null
)

OR

create table "Consulting Project"(
             ID           varchar(4) not null,
             Name         varchar(5) not null,
             Gender       varchar(1) not null,
             Job_Title    varchar(15) not null,
             Contribution number(1,0) not null
)

a beside not, it's bad idea to create a table without a Primay Key cause every table should have a Primary Key

Why?

Well, the answer is here

Ilyes
  • 14,640
  • 4
  • 29
  • 55