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

Databases SQL Basics Getting Data from a Database Review & Practice with SQL Playgrounds

Dmitry Sidorenko
Dmitry Sidorenko
1,692 Points

Hi! What would be a query in reviews table to show correlated movie_title from movie table instead of movie_id?

So basically, is it possible to draw column values from another table that is tied by id? And if it is, how should query look like?

2 Answers

SELECT title, review FROM reviews INNER JOIN movies ON reviews.movie_id = movies.id

Wait. What? You want to take Id data from similarly named Id, that exist in different tables? So the columns might not be correlated at all. Why do you have duplicates? There is no search that I'm aware of. I guess this would make sense if you needed uh like most popular in trending. I don't exactly understand why I need to link this Id to give a new value. Are you trying to ask can the computer read for us? It seems like you want to reinvent one table, but you can't. Hmmm... So maybe you're just trying to gather everything we can. That's what we think inner join is for, like a tack. So you think I can extend my access for output statements across multiple tables, more easily this way. Like uh yeah I think so.