So my assignment question is to "Get a list of all books withdrawn by people with the initials 'B.W.'. Show a column for the first name, last name, initials, and the title of the book". I am trying to join these 3 tables as it is the only way to get this information, but Im having a hard time only displaying names with initials B.W. I get a syntax error saying:
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'JOIN withdrawals
When I remove my 'WHERE' statement (all of the second line), my syntax error goes away. How do I make this work?
Below is my code:
SELECT first_name, last_name, title FROM members
WHERE first_name LIKE 'B%' AND last_name LIKE 'W%'
JOIN withdrawals
ON members.member_id = withdrawals.member_id
JOIN books
ON withdrawals.book_id = books.book_id