Dinesh Soni Dinesh Soni - 3 days ago 5
SQL Question

ORA-00907: missing right parenthesis Error while creating a table on oracle

I am getting

ORA-00907: missing right parenthesis

Error while creating a table on oracle

here is what I did:

create table customers(
cust_num number(4),
company varchar2(20),
cust_rep number(3),
credit_limit number(15),
custraint cust_num_pk
primary key(cust_num));


whats wrong ??

Answer

There's nothing called Custraint. It's Constraint.

It should be:

create table customers(
  cust_num number(4),
  company varchar2(20),
  cust_rep number(3),
  credit_limit number(15),
  constraint cust_num_pk primary key(cust_num)
);
Comments