mySQL Newbie
Member
- Joined
- Sep 11, 2009
- Messages
- 52
- Reaction score
- 0
- Points
- 6
Umm. i'm new here, how can i reply to you.
Another O'Reilly example problems. I have a database called database1. I use it then i create a table called proj_id. Now O'Reilly Head First SQL wants me to copy and paste their example.
I entered :
ALTER TABLE project_list
CHANGE COLUMN number proj_id INT NOT NULL AUTO_INCREMENT,
ADD PRIMARY KEY ('proj_id');
THEY (HEAD FIRST SQL) said it should works.
But when i entered it in mySQL command prompt it didn't work.
It say ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that sorresponds to your MySQL server version for the right systax to use near ' ' proj_id')' at line 3.
Can anyone help me, i'm still on Chapter 4, and i don't have a clue. I can program C++ (still intermediate). Help ?
By the way, the table is
CREATE TABLE project_list (number int(11), description VARCHAR(50), contract VARCHAR(10));
Thank you Bryan A, this book really make my blood temper rise.
I don't know how to reply to you, so i just add a detail here.
I want to rate you but it said i must be level 2.
Thanks again. You are right, it is a backticks, but O'reilly type it as single quote.
They also gives me false information, they say DEC (3,2) is 3 digits before decimal signs and 2 digits after decimal signs.
When in REALITY it means 3 total digits and 2 digits after the decimal sign.
Beware of false information. This is the second typo that from Head First SQL that gives me a headache.
Well, onward to Chapter 5.
Another O'Reilly example problems. I have a database called database1. I use it then i create a table called proj_id. Now O'Reilly Head First SQL wants me to copy and paste their example.
I entered :
ALTER TABLE project_list
CHANGE COLUMN number proj_id INT NOT NULL AUTO_INCREMENT,
ADD PRIMARY KEY ('proj_id');
THEY (HEAD FIRST SQL) said it should works.
But when i entered it in mySQL command prompt it didn't work.
It say ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that sorresponds to your MySQL server version for the right systax to use near ' ' proj_id')' at line 3.
Can anyone help me, i'm still on Chapter 4, and i don't have a clue. I can program C++ (still intermediate). Help ?
By the way, the table is
CREATE TABLE project_list (number int(11), description VARCHAR(50), contract VARCHAR(10));
Thank you Bryan A, this book really make my blood temper rise.
I don't know how to reply to you, so i just add a detail here.
I want to rate you but it said i must be level 2.
Thanks again. You are right, it is a backticks, but O'reilly type it as single quote.
They also gives me false information, they say DEC (3,2) is 3 digits before decimal signs and 2 digits after decimal signs.
When in REALITY it means 3 total digits and 2 digits after the decimal sign.
Beware of false information. This is the second typo that from Head First SQL that gives me a headache.
Well, onward to Chapter 5.