Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

EMPLOYEES TABLE

COLUMN NAMES:

EMPLOYEE_ID EMPLOYEE_NAME EMPLOYEE_LASTNAME JOB EMPLOYEE_BUSINESS_PHONE EMPLOYEE_GSM SALARY HIRE_DATE E_MAIL DEPARTMAN_NO

NOTE:FOR THIS TABLE: EMPLOYEE_ID IS PRIMARY KEY AND DEPARTMAN_ID IS FOREIGN KEY

DEPARTMAN TABLE

DEPARTMAN_ID DEPARTMAN_AD NUMBERS_OF_EMPLOYEES MANAGER_NAME LOCATION

NOTE:FOR THIS TABLE DEPARTMAN_ID IS PRIMARY KEY

AND I RUN THIS SCRIPT :

CREATE TABLE DEPARTMAN
(   DEPARTMAN_ID    NUMBER(*, 20) NOT NULL,
DEPARTMAN_AD    VARCHAR2(40) NOT NULL,
DEPARTMAN_SOYAD VARCHAR2(40) NOT NULL), 
CONSTRAINT DEPARTMAN_PK PRIMARY KEY (DEPARTMAN_ID)
);

CREATE TABLE EMPLOYEE
(   EMPLOYEE_ID EMPLOYEE_ID NUMBER(*, 20) NOT NULL,
EMPLOYEE_AD VARCHAR2(40) NOT NULL,
 PERSONEL_SOYAD VARCHAR2(40) NOT NULL ,
 JOB VARCHAR2(40) NOT NULL ,
EMPLOYEE_BUSINESS_PHONE VARCHAR2(40) NOT NULL ,
 PERSONEL_GSM VARCHAR2(40) ,
SALARY VARCHAR2(40) NOT NULL ,
HIRE DATE NOT NULL , 
E_MAIL VARCHAR2(40) ,
 DEPARTMAN_ID NUMBER(*, 20) NOT NULL,
supplier_name   varchar2(50)    not null,
CONSTRAINT FK_DEPARTMAN_COMP
  FOREIGN KEY DEPARTMAN_ID)
  REFERENCES DEPARTMAN(DEPARTMAN_ID)
);

WHEN I RUN THIS SCRIPT *ERROR IS:*

Error starting at line 9 in command:
CREATE TABLE PERSONEL
(       PERSONEL_ID NUMBER(*, 20) NOT NULL,
EMPLOYEE_FIRSTNAME VARCHAR2(40) NOT NULL,
 EMPLOYEE_LASTNAME VARCHAR2(40) NOT NULL ,
 JOB VARCHAR2(40) NOT NULL ,
 EMPLOYEE_BUSINESS_PHONE VARCHAR2(40) NOT NULL ,
 EMPLOYEE_GSM VARCHAR2(40) ,
SALARY VARCHAR2(40) NOT NULL ,
HIRE DATE NOT NULL , 
E_MAIL VARCHAR2(40) ,
 DEPARTMAN_ID NUMBER(*, 20) NOT NULL,
supplier_name   varchar2(50)    not null,
CONSTRAINT FK_DEPARTMAN_COMP
  FOREIGN KEY DEPARTMAN_ID)
  REFERENCES DEPARTMAN(DEPARTMAN_ID)
)
Error at Command Line:22 Column:14
Error report:
SQL Error: ORA-00906: missing left parenthesis
00906. 00000 -  "missing left parenthesis"
*Cause:    
*Action:

HOW I CAN FIX IT? I REALLY NEED HELP IMMEDIATELY

I wanted the script to create the these two tables and how the relationship should be with?

thank you so much!!

@RolandoMySQLDBA i run what you said me :

CREATE TABLE DEPARTMAN
(   DEPARTMAN_ID    NUMBER(*, 20) NOT NULL,
DEPARTMAN_AD    VARCHAR2(40) NOT NULL,
DEPARTMAN_SOYAD VARCHAR2(40) NOT NULL, 
CONSTRAINT DEPARTMAN_PK PRIMARY KEY (DEPARTMAN_ID)
);

CREATE TABLE EMPLOYEE
(   EMPLOYEE_ID EMPLOYEE_ID NUMBER(*, 20) NOT NULL,
EMPLOYEE_AD VARCHAR2(40) NOT NULL,
 PERSONEL_SOYAD VARCHAR2(40) NOT NULL ,
 JOB VARCHAR2(40) NOT NULL ,
EMPLOYEE_BUSINESS_PHONE VARCHAR2(40) NOT NULL ,
 PERSONEL_GSM VARCHAR2(40) ,
SALARY VARCHAR2(40) NOT NULL ,
HIRE DATE NOT NULL , 
E_MAIL VARCHAR2(40) ,
 DEPARTMAN_ID NUMBER(*, 20) NOT NULL,
supplier_name   varchar2(50)    not null,
CONSTRAINT FK_DEPARTMAN_COMP
  FOREIGN KEY DEPARTMAN_ID)
  REFERENCES DEPARTMAN(DEPARTMAN_ID)
);

AND AGAIN ERROR IS:

Error starting at line 8 in command:
CREATE TABLE EMPLOYEE
(   EMPLOYEE_ID EMPLOYEE_ID NUMBER(*, 20) NOT NULL,
EMPLOYEE_AD VARCHAR2(40) NOT NULL,
 PERSONEL_SOYAD VARCHAR2(40) NOT NULL ,
 JOB VARCHAR2(40) NOT NULL ,
EMPLOYEE_BUSINESS_PHONE VARCHAR2(40) NOT NULL ,
 PERSONEL_GSM VARCHAR2(40) ,
SALARY VARCHAR2(40) NOT NULL ,
HIRE DATE NOT NULL , 
E_MAIL VARCHAR2(40) ,
 DEPARTMAN_ID NUMBER(*, 20) NOT NULL,
supplier_name   varchar2(50)    not null,
CONSTRAINT FK_DEPARTMAN_COMP
  FOREIGN KEY DEPARTMAN_ID)
  REFERENCES DEPARTMAN(DEPARTMAN_ID)
)
Error at Command Line:9 Column:28
Error report:
SQL Error: ORA-00907: missing right parenthesis
00907. 00000 -  "missing right parenthesis"
*Cause:    
*Action:

May You write me right script to run for these two table and this rleationship please ?

thank you

share|improve this question

closed as too localized by Mark Storey-Smith, Martin Smith, Nick Chammas, JNK Jun 27 '12 at 2:15

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

6  
You understand that all caps is yelling and it makes people much less likely to help you. Nor does "I really need help immediately" make anyone more likely to help you. And if you can't read an error like missing left paranthesies and find it, then you really need to evaluate if you belong in this profession. –  HLGEM Jun 22 '12 at 22:20
    
FYI, questions around typos in your code aren't normally very good questions. –  JNK Jun 27 '12 at 2:16
add comment

1 Answer 1

Look at these lines :

CREATE TABLE DEPARTMAN
(   DEPARTMAN_ID    NUMBER(*, 20) NOT NULL,
DEPARTMAN_AD    VARCHAR2(40) NOT NULL,
DEPARTMAN_SOYAD VARCHAR2(40) NOT NULL), 
CONSTRAINT DEPARTMAN_PK PRIMARY KEY (DEPARTMAN_ID)
);

You have an extra left parenthesis before the CONSTRAINT. After you remove it, it should look like this:

CREATE TABLE DEPARTMAN
(   DEPARTMAN_ID    NUMBER(*, 20) NOT NULL,
DEPARTMAN_AD    VARCHAR2(40) NOT NULL,
DEPARTMAN_SOYAD VARCHAR2(40) NOT NULL, 
CONSTRAINT DEPARTMAN_PK PRIMARY KEY (DEPARTMAN_ID)
);
share|improve this answer
1  
I WOULD HAVE ANSWERED IN CAPITALS IMMEDIATELY –  Phil Jun 22 '12 at 22:18
2  
@Phil It's Friday. Too tired to yell. –  RolandoMySQLDBA Jun 22 '12 at 22:20
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.