Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialBrian Schmitz
11,167 PointsWhy am I getting an error for the following:
when I try to pull up the treehouse_movies database as follows:
SELECT * FROM actors; or movies;
I get an error that says "Error formatting SQL query, empty string given as an argument for ! character"
I'm using SQL version 5.6.21. I followed the download instructions in the video.
5 Answers
Tobiasz Gala
Full Stack JavaScript Techdegree Student 23,529 PointsSemicolon in the middle of sql query?
Brian Schmitz
11,167 PointsYeah that is good to be there, no issue there.
Jeff Busch
19,287 PointsHi Brian,
I'm no SQL expert but I haven't seen or in an SQL statement before. Anyhow, you actually have two statements there. A semicolon tells SQL that the statement has ended. So SQL SELECTs all FROM the actors table and the sees the statement or movies; and doesn't know what to do. Also, make sure you are using the database, USE treehouse_movie_db;.
Jeff
Brian Schmitz
11,167 PointsSprry for the confusion - I don't actually have the statement like that I was just saying that when I select the movies or actors tables I am getting the same error.
My code is : SELECT * FROM movies;
That is causing the error
Jeff Busch
19,287 PointsOK Brian,
I have to ask. Is this a code challenge? Did you create the database? Also, before performing the query did you enter the command USE treehouse_movie_db;?
Eduardo Poco
1,303 PointsThank you Jeff for your help, in fact in the movie it isn't told to write "USE treehouse_movie_db;" and that was the problem.
Brian Schmitz
11,167 PointsBrian Schmitz
11,167 PointsActually I'm on version 5.7