Someone please tell me the SQL query to get the result….
Thanks!

From the above two tables, I want to get the Photo, Name, Id of max(id) from Table-A for each category_id for which the parent_id in Table-B is 1 i.e.
1005 E Byte Apple 3
1002 B Byte Banana 5
1007 G Byte Orange 6
1011 K Byte Mango 7
Try the below;