Sounds like you might be looking for a "pivot query" solution. Something like:
Select M.BookId, M.booktitle,
sum(case when d.status=1 then 1 else 0 end) as TotalIn,
sum(case when d.status=2 then 1 else 0 end) as TotalOut,
sum(case when d.status=3 then 1 else 0 end) as TotalLost,
sum(case when d.status=4 then 1 else 0 end) as TotalDamaged,
sum(case when d.status=5 then 1 else 0 end) as TotalRemoved
from [master Book table] M
inner join [details Book table] D
on M.bookID = D.BookId
Group by M.BookId, M.booktitle
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?