30 | | SELECT B.Title, B.Author, B.Language, B.ImageURL, U.Username, U.City, U.Neighborhood, L.Condition, G.Genre |
31 | | FROM Book B JOIN Library L ON B.BookId=L.BookId |
32 | | JOIN USER U ON L.UserId=U.UserId |
33 | | JOIN GENRE G ON B.BookId=G.BookId |
34 | | WHERE LOWER(B.Title) LIKE ('%search%') OR LOWER(B.Author) LIKE ('%search%') OR LOWER(G.Genre) LIKE ('%search%') |
35 | | |
| 30 | select b.title, b.author, b.language, b.imageurl, l.condition, u.username, u.city, u.neighborhood, g.genre |
| 31 | from book b join library l on b.bookid=l.bookid |
| 32 | join appuser u on l.userid=u.userid |
| 33 | left join genre g on g.bookid=b.bookid |
| 34 | where lower(b.title) like ('%search%') |
| 35 | order by u.city, u.neighborhood; |