hello, everybody
i have a problem , i have table , it contoin column ORDER ID, customer ID, amount, DATE.
a problem when i type or create this table, i make a mistake i dont know where is my mistake when i type in mySQL database BY using ( MYSQL console),


thanks

Whats the error ?

What command did you try to execute? Copy and paste exactly what is on your command line, and the resulting screen.

my table is called Orders, it have four column , first col is ORDER ID, second col customer ID, third column is AMOUNT n last colum is DATE,
so ma problem i dont know where i make a mistake,
i was typing that
mysq>

create table orders(
order id INT NOT NULL AUTO_INCREMENT,,
customer id INT NOT NULL,
amount DECIMAL(4,2) NOT NULL,
date DATE NOT NULL,
);

can you help where is a my mistake.

THANKS,

table is called Orders, it have four column , first col is ORDER ID, second col customer ID, third column is AMOUNT n last colum is DATE,
so ma problem i dont know where i make a mistake,
i was typing that
mysq>

create table orders(
order id INT NOT NULL AUTO_INCREMENT,,
customer id INT NOT NULL,
amount DECIMAL(4,2) NOT NULL,
date DATE NOT NULL,
);

can you help where is a my mistake.

THANKS,

There are so many errors.
1. order id should be order_id
2. same with customer id.
3. You have 2 , in order id line
Try this.

CREATE TABLE orders (
order_id INT NOT NULL AUTO_INCREMENT ,
customer_id INT NOT NULL ,
amount DECIMAL( 4, 2 ) NOT NULL ,
date DATE NOT NULL ,
PRIMARY KEY (order_id)
) ENGINE = InnoDB

Why are you posting the same question so many times ?

Threads merged

Do not flood the forum by posting the same question more than once (ie in multiple forums).

There may be a problem with that field named 'DATE', as that is a reserved word. It will always have to be quoted in every query. Perhaps better to rename it 'OrderDate' or something that makes sense.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.