0

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

4
Contributors
8
Replies
9
Views
9 Years
Discussion Span
Last Post by trudge
0

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

0

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,

0

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,

0

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
0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.