Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Databases

INSERT INTO CONCERTS VALUES (10, ‘2018-03-22’, ‘Vancouver’, ‘BC’, ‘BC Place’, ‘Canada’); produces error

Error: unrecognized token: "22’" Why? my code is the same as in the video - https://teamtreehouse.com/library/altering-tables-2

This is regarding altering tables. I have run into so many problems with this course where I follow EXACTLY what the instructor says and it does not work.

What am I doing wrong?

Thanks for your help - I searched prior questions and could not find anything about this error. I also looked on line and could not find an answer I understood.

I think I see part of the problem. The data type for ID in the CONCERTS table is INTEGER when it should be SMALLINT. I don't know how that happened and don't know how to change it. I guess I will be doing more research, but would appreciate any help I could get. SQL Lite is not very friendly and I don't know why anybody would use it.

1 Answer

I figured it out. For some reason, the single quotes around the values weren't actually single quotes, but were - I don't know how to describe this - right side up and upside down single quotes, if that makes any sense. I have seen this before and don't know how it happens. I changed them to single quotes and it worked. BTW, the video says this query is in the Teacher's notes for this video, but it's not.