0

I am pulling my hair out surrounding this (the above error message)

The code I am using is below:

create database SHIRTS_DB;

CREATE TABLE SHIRTS (
SHIRT_ID INT auto_increment
ARTICLE VARCHAR(50)
COLOUR VARCHAR(50)
SHIRT_SIZE VARCHAR(2)
LAST_WORN INT
primary key shirt_id
);

How do I resolve this? I have been looking around and I am still baffled.

Also, can I not add code as I go along the way? it seems when I add new code/new lines, that's when the error message pops up.... It's all fine when it's within a blank SQL script, but as soon as I add more code or edit a code I already inputted, it gives me error 1064

(I am new to this and learning SQL)

Hkachhia
  • 4,463
  • 6
  • 41
  • 76
  • when you say "add code", do you mean add new fields for existing table? – onedevteam.com Nov 16 '22 at 12:35
  • 1
    Hi @richard-peters welcome to SO, i'm prettier sure this is what you are looking for: https://stackoverflow.com/questions/23515347/how-can-i-fix-mysql-error-1064. If this doesn't help you, please edit you question with more context like the full error message from sql – Hollyol Nov 16 '22 at 12:36
  • 1
    Does this answer your question? [How can I fix MySQL error #1064?](https://stackoverflow.com/questions/23515347/how-can-i-fix-mysql-error-1064) – Hollyol Nov 16 '22 at 12:36
  • Typos. The columns definitions must be separated with commas. The primary key expression must be enclosed with parenthesis. Additionally: either add USE command after DB creation and before table creation or specify DB alias in creation code - if not then the table will be created in current (default?) database. – Akina Nov 16 '22 at 12:58

0 Answers0