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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
  • 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:

    • Column names:

      DEPARTMAN_ID
      DEPARTMAN_AD
      NUMBERS_OF_EMPLOYEES
      MANAGER_NAME
      LOCATION
      

      NOTE: for this table is DEPARTMAN_ID a primary key.

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)
);

But the error is this;

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 can I 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)
);

But the error is again the same. May You write me right script to run for these two table and this relationship 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

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

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