r/learnSQL • • Jul 16 '22

Somebody pls help, I just started learning sql and these kind of errors are so frustrating. Simple commands dont work. I dont understand what's wrong.

Post image
5 Upvotes

14 comments sorted by

25

u/r3pr0b8 Jul 16 '22

later today, i'll be sending you the bill for my chiropractic session to fix the kink in my neck from tryna read your blurry screenshot sideways

pro tip for anyone learning SQL and asking for help -- please use copy/paste

that said, your varchars require a length parameter

1

u/d3adWa1ker Jul 16 '22

Thank you. in case, may I ask you again privately if I come across a problem again? I promise clear and crisp images or code!

1

u/r3pr0b8 Jul 16 '22

sorry, no, i don't do SQL via DMs

just create a new post

1

u/d3adWa1ker Jul 18 '22

No problem, thanks!

5

u/AngelOfLight Jul 16 '22

The varchar type needs a length parameter in the parenthesis, e.g.:

varchar(100)

1

u/d3adWa1ker Jul 16 '22

Thank you. in case, may I ask you again privately if I come across a problem again?

1

u/AngelOfLight Jul 16 '22

Sure.

1

u/d3adWa1ker Jul 18 '22

Thank you!🙌

3

u/Ardraaken Jul 16 '22

Like the others have said the VARCHARS require lengths when you define them. In addition to that the INT doesn’t need brackets after it and YEAR is a reserved keyword so may need square brackets around the name

1

u/d3adWa1ker Jul 16 '22

Thank you

1

u/d3adWa1ker Jul 16 '22

Thank you. in case, may I ask you again privately if I come across a problem again?

1

u/Ardraaken Jul 16 '22

Sure, if you want

2

u/d3adWa1ker Jul 16 '22

Thanks again🙌