Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7708883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:43:35+00:00 2026-06-01T00:43:35+00:00

This is what I try to execute: CREATE TABLE order ( o_id INTEGER not

  • 0

This is what I try to execute:

CREATE TABLE "order" (
    "o_id" INTEGER not null primary key,
    "c_id" INTEGER,
    PRIMARY KEY (o_id),
    FOREIGN KEY (c_id) REFERENCES customer(c_id)
);

Get this error when I execute the above SQL command:

Error code -1, SQL state 42Z93: Constraints ‘SQL120326130633321’ and
‘SQL120326130633320’ have the same set of columns, which is not
allowed.

Before the above SQL command I executed this:

CREATE TABLE "customer" (
    "c_id" INTEGER not null primary key,
    "c_first" VARCHAR(30),
    "c_last" VARCHAR(30)
);

EDIT(solution):

I think I fixed it.

First, I had to remove the PRIMARY KEY(o_id) since it basically repeated what I have typed on line 2 of SQL command o_id INTEGER not null primary key so it complained I tried to create primary key for the same column twice.

Second, after that was fixed another error surfaced telling me that CUSTOMER table couldn’t be found. Perhaps the problem was that I used the commas(“…”) around the table name ‘customer’ when CREATE TABLE was trying to execute.

I deleted ‘customer’ table and recreated it without using any quotations in the SQL command.

Afterwards I executed the ‘CREATE TABLE’ for ‘orders’ and it worked.

Strange difference is that when I used the quotations around the customer table name in SQL, at first, its name appeared all lower case in the Databases Explorer of Netbeans. But when I omitted the quotes the table names became all uppercase – even thier column names.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T00:43:36+00:00Added an answer on June 1, 2026 at 12:43 am

    You are adding the primary key constraint twice. You only need it once, in one place or the other depending on DB vendor.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

CREATE TABLE PERMISSIONS( ID BIGINT NOT NULL PRIMARY KEY, NAME VARCHAR(255) NOT NULL, UNIQUE(ID)
I have this code to create new sql table when i execute this its
I have a table created using Python + Sqlite3 c.execute('CREATE TABLE IF NOT EXISTS
I got this code.. ..... try: task_db.cursor.execute('DROP TABLE IF EXISTS `tasks`') print Affected: %d
When I try to execute this statement in Oracle SQL Developer 2.1 a dialog
Okay, I'm getting this error when I try to execute this procedure. The thing
When I try to execute the SQL statment below in Oracle SQL Developer: CREATE
In PHP, I create and execute SQL queries like the following. INSERT INTO Table
According to the sqlite3 documentation , creating a table where the primary key is
I have this sequence of queries: begin execute immediate 'drop table mytable1'; exception when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.