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

Jorgen Rasmussen
Jorgen Rasmussen
3,367 Points

Loans,books and patrons question

Here I need to Select all the columns with reference to the tables they come from. Next I need to list a FROM table which I have chosen as the books table. Then I use 2 LEFT OUTER JOINs to that I don’t lose any information, that might happen by just looking at the intersection of the datasets with INNER JOIN. But as multiple people check out the same title I am not sure if I can simplify my answer beyond what I get with the following code: SELECT books.title, patrons.first_name, patrons.last_name, patrons.email, loans.loaned_on, loans.return_by, loans.returned_on FROM books LEFT OUTER JOIN loans ON books.id = loans.book_id LEFT OUTER JOIN patrons ON loans.patron_id = patrons.id; What are your thoughts on this code and if anything is missing? Thanks for your time

What is your goal with that?