Databases Querying Relational Databases Joining Table Data with SQL Review and Practice

Jessica Schteiden
Jessica Schteiden
3,254 Points

Hey team, I tried this query out on Q3 but it didn't work. Can someone help me understand why it's breaking?

SELECT b.title, p.first_name, p.last_name, p.email, l.loaned_on, l.returned_by, l.returned_on FROM books AS b INNER JOIN loans AS l ON b.id = l.book_id INNER JOIN patrons AS p ON l.patron_id = p.id ORDER BY loaned_on DESC;

2 Answers

KRIS NIKOLAISEN
KRIS NIKOLAISEN
53,552 Points

The error message is no such column returned_by. It is just return_by.