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.

Development Tools

Brian Schmitz
Brian Schmitz
11,167 Points

Why 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.

Brian Schmitz
Brian Schmitz
11,167 Points

Actually I'm on version 5.7

5 Answers

Brian Schmitz
Brian Schmitz
11,167 Points

Yeah that is good to be there, no issue there.

Hi 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
Brian Schmitz
11,167 Points

Sprry 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

OK 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;?

Thank 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.