You can achieve that in single query but you need to have some foreign key in other tables. Here check the code below.
SELECT b.*, ba.*, bs.* FROM tbl_books as b
FULL OUTER JOIN tbl_books_author as ba ON ba.book_id=b.id
FULL OUTER JOIN tbl_books_subject as bs ON bs.book_id=b.id
WHERE b.title LIKE 'law' OR ba.author LIKE 'law' OR bs.subject LIKE 'law' LIMIT 0, 30;
look at the query deeply you can see I have used tbl_books.id to make joins which should be in other tables to identify that particular records.
Hope this helped you.
4
solved SQL SELECT query not working – unable to find error [closed]