senewimala1988

Well-known member
  • Dec 5, 2007
    7,794
    2,643
    113
    Kadawatha, Sri Lanka
    Mata table ekak MySQL valin create karanna one to enter Name ,Address,Contact No,Total Price.Meka thama mama type kala coding eka.Eth ekata error ekak enava..Eka hari gassala denavada???PLEASE!!!!!

    create table Customer_Details(Name varchar(25),Address varchar(50),Contact_No int(10),Total_Price int(15));
     

    senewimala1988

    Well-known member
  • Dec 5, 2007
    7,794
    2,643
    113
    Kadawatha, Sri Lanka
    This is da error
    ERROR 1064:You have an error in your SQL syntax.Chace the manual that corresponds to your MySQL server version for rhe syntax to use near ' create table Customer_Details(Name varchar(30),Address varchar(
     

    picsms

    Member
    May 10, 2008
    148
    0
    0
    Try this

    senewimala1988 said:
    This is da error
    ERROR 1064:You have an error in your SQL syntax.Chace the manual that corresponds to your MySQL server version for rhe syntax to use near ' create table Customer_Details(Name varchar(30),Address varchar(

    Hey Bos

    I had Creadted in my local server and get the script for you. smal advice when ur creating Tables in any DBMS you should keep a Primarykey
    i had created with primary key if u want keep other wise delet it

    here the MySql Query

    CREATE TABLE `Customer_Details` (
    `Name` VARCHAR( 25 ) NOT NULL ,
    `Address` VARCHAR( 50 ) NOT NULL ,
    `Contact_No` INT( 10 ) NOT NULL ,
    `Total_Price` INT( 15 ) NOT NULL ,
    `Coustomer_Id` INT( 4 ) NOT NULL AUTO_INCREMENT ,
    PRIMARY KEY ( `Coustomer_Id` )
    ) ENGINE = MYISAM

    If you dont want with Primary Key Delet the line in Red in coming query

    CREATE TABLE `Customer_Details` (
    `Name` VARCHAR( 25 ) NOT NULL ,
    `Address` VARCHAR( 50 ) NOT NULL ,
    `Contact_No` INT( 10 ) NOT NULL ,
    `Total_Price` INT( 15 ) NOT NULL ,
    `Coustomer_Id` INT( 4 ) NOT NULL AUTO_INCREMENT ,
    PRIMARY KEY ( `Coustomer_Id` )

    ) ENGINE = MYISAM

    Note:-
    Without Primary key creating a table is not profissional k. just my opinion

    K bos i think you got anser for ur question.

    Enjoy