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

PHP

Sam Dobson
Sam Dobson
18,985 Points

Retrieving a Result Set challenge

On the retrieving a result set challenge first question in Database Foundations - Reading Data from Databases with SQL "Write a SELECT statement that retrieves all "movies" with the "year" first and the "title" second"

I have "SELECT movies.year, movies.title FROM movies;" but that doesn't work. Tried a few other combinations, but to no avail. Any idea?

Wilson Usman
Wilson Usman
35,206 Points

Sam,

I think you might find the answer to your question in this post already. I hope this helps.

You might have to re-read the question once again to make sure this is what you're trying to accomplish.

SELECT movies.title, genres.name FROM movies INNER JOIN genres ON movies.genre_id = genres.id;