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 trial

Development Tools Database Foundations Reading Data from Databases with SQL Retrieving a Result Set

I'm writing SELECT actors.name FROM movies; and it's not working and I'm not sure why!

Need help understanding why this isn't working.

1 Answer

Hey Becca,

with the actors.name you are telling the program that you are referring to the name column that's in the actors table, but then after that your statement says FROM movies. This cannot work because actors.name don't exist in movies.

The answer here is:

SELECT actors.name FROM actors

... though this statement is a bit redudant. SELECT name FROM actors would've been enough.

You will see later in your studies that the above format ([table-name].[column-name]) is very useful though for when referring to more than one table in a statement.

Hope this helps!