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 SQL Calculating, Aggregating and Other Functions Grouping, Joining and Cleaning Up

imported sql into XAMPP and did query -> found rows, but here get error message about OUTER JOIN

Hi, here you can see my query.

SELECT movies.title, IFNULL(AVG(score), 0) as average FROM reviews LEFT JOIN movies ON movies.id = reviews.movie_id GROUP BY reviews.movie_id HAVING average < 2.

I did not find anything about OUTER JOIN. It seems to be old.

1 Answer

INNER JOIN and OUTER JOIN are still supported as shown in the MySQL documentation. But, the MySQL documentation also says that you can optimize your code by using LEFT JOIN and RIGHT JOIN instead.

So, I would not say that OUTER JOIN is outdated, but I think you made a good catch on the issue. Personally, I quickly grasp the concept of INNER and OUTER JOIN, but will have to really look at how to use LEFT and RIGHT with WHERE clauses to get the same result.