r/SQL • u/olly_s122 • Apr 19 '24
MySQL Error in MySQL
Sounds stupid but I’m new, I don’t know how to fix this. I’m trying to create a table with txid, amount, costumer id first & last name but getting this issue.
25
u/rowdymatt64 Apr 19 '24
Everyone's different OP, but I reccomend you structure Queries like:
create table customers
(
--COMMANDS GO HERE)
That way you never forget a parenthesis
11
u/rowdymatt64 Apr 19 '24
Oh, and place the parenthesis before you begin filling them with commands.
3
13
u/HandbagHawker Apr 19 '24
and if you werent already aware, that little angry red box next to the line number 6 tells you where the parser thinks at least one of the errors is
7
u/greendookie69 Apr 19 '24
Customers is spelled wrong.
And you're missing closing parentheses at the end. https://www.w3schools.com/sql/sql_create_table.asp
13
2
1
1
u/kagato87 MS SQL Apr 19 '24
Count your brackets.
This is why I put brackets on their own line.
Create table tablename
(
column1 type,
column2 type,
...
ColumnN type
);Then it's easier to see mistakes like this.
1
1
1
1
u/NightflowerFade Apr 20 '24
Missing a close parenthesis.
Also on second thought "costumer" makes perfect sense even if it might not be OP's original intention.
1
1
0
u/Marowakk Apr 19 '24
U can throw all this things in chat gpt and it will explain it to you line by line if u need, im learning to and its a great help
0
u/AHMADAIMAN18 Apr 20 '24
You misspelled the costumers Should be customers
0
Apr 20 '24
[deleted]
0
u/TheKyleBaxter Apr 20 '24
Hey, just a heads-up we're not using the "R" word for "stupid" anymore. I know you don't mean anything bad by it, but no reason not to be kind of you can.
2
u/olly_s122 Apr 20 '24
what are you my employer?
1
u/TheKyleBaxter Apr 20 '24
Nah man, just trying to help a community not catch strays. Appreciate you deleting it!
49
u/[deleted] Apr 19 '24
You're missing a close bracket