I have four tables user, shops, offer, merchant in that id is unique and present in all table
shop ------ id shops 1 shop1 1 shop2 1 shop3
user ----- id name 1 abc
merchant --------- id date business 1 2012-6-6 Mall
offer ------ id status 1 true 1 true 1 false
First select id from shop table then match with user to get username, then match with merchant table to get date, business.
Then match with shop table to get shops (count the shops that how much that id have), then match with offer table to get status (count the status=true that how much that id have)