locked
missing right parenthesis error. RRS feed

  • Question

  • I tried creating a table with the name auto and added a constraint "AUTO_INCREMENT" but it is  throwing an error called missing right parenthesis.

    here is the syntax and I don't know how to proceed further in this topic:

    create table auto(id int NOT NULL AUTO_INCREMENT,name varchar(10),mat int,phy int,tot int);

    pls help me......

    Thursday, August 7, 2014 5:23 AM

Answers

  • Hi,

    I understand that you are finding difficult to create the table with the AUTO_INCREMENT constraint.

    Recommend you to try below.

    CREATE TABLE Auto
     (
         ID int NOT NULL AUTO_INCREMENT,
         Name varchar(10) NOT NULL,
         MAT int,
         PHY int,
         TOT int,
         PRIMARY KEY (ID)
     )

    Please find the general syntax

    CREATE TABLE Persons
     (
     ID int NOT NULL AUTO_INCREMENT,
     LastName varchar(255) NOT NULL,
     FirstName varchar(255),
     Address varchar(255),
     City varchar(255),
     PRIMARY KEY (ID)
     )

    Hope this helps.

    Regards,
    Shirisha Paderu.

    • Proposed as answer by Shirisha Paderu Thursday, August 7, 2014 9:03 AM
    • Marked as answer by Sofiya Li Thursday, August 14, 2014 1:38 AM
    Thursday, August 7, 2014 9:02 AM