#restaurant photos
select restaurants .id,restaurants.name, restaurants_pictures.item, restaurants_pictures .cached_item_url as item_url from restaurants 
JOIN restaurants_pictures on restaurants.id = restaurants_pictures .restaurant_id where restaurants.name is not null


#restaurant package list

AYCE

SELECT  hh_package_restaurant_packages.restaurant_id, hh_package_restaurant_packages.package_id, hh_package_restaurant_packages.package_type, 
hh_package_package_ayce_translations.name FROM hh_package_restaurant_packages
join hh_package_package_ayces on hh_package_restaurant_packages.package_id = hh_package_package_ayces.id
JOIN hh_package_package_ayce_translations on hh_package_package_ayces.id = hh_package_package_ayce_translations.hh_package_package_ayce_id
where hh_package_restaurant_packages.package_type ="HhPackage::Package::Ayce"
GROUP  by package_id

PP

SELECT  hh_package_restaurant_packages.restaurant_id, hh_package_restaurant_packages.package_id, hh_package_restaurant_packages.package_type, 
hh_package_package_party_pack_translations.name FROM hh_package_restaurant_packages
join hh_package_package_party_packs  on hh_package_restaurant_packages.package_id = hh_package_package_party_packs.id
JOIN hh_package_package_party_pack_translations  on hh_package_package_party_packs.id = hh_package_package_party_pack_translations.hh_package_package_party_pack_id 
where hh_package_restaurant_packages.package_type ="HhPackage::Package::PartyPack"
GROUP  by package_id

XP


SELECT  hh_package_restaurant_packages.restaurant_id, hh_package_restaurant_packages.package_id, hh_package_restaurant_packages.package_type, 
hh_package_package_xperience_translations.name FROM hh_package_restaurant_packages
join hh_package_package_xperiences on hh_package_restaurant_packages.package_id = hh_package_package_xperiences .id
JOIN hh_package_package_xperience_translations   on hh_package_package_xperiences .id = hh_package_package_xperience_translations .hh_package_package_xperience_id  
where hh_package_restaurant_packages.package_type ="HhPackage::Package::XPerience"
GROUP  by package_id


# restaurant package types
select restaurants.id, restaurant_translations.name, hh_package_restaurant_packages .package_type, 
hh_package_restaurant_packages .package_id from restaurants 
JOIN hh_package_restaurant_packages on hh_package_restaurant_packages.restaurant_id =  restaurants.id
JOIN restaurant_translations on restaurant_translations.restaurant_id = restaurants.id 


# restaurant package's price list
SELECT * from hh_package_pricings 


# restaurant's location
SELECT restaurants.name, restaurants.lat,restaurants.lng, cities.name as city_name  from restaurants join cities on restaurants.city_id = cities.id


# restaurant's review score
select restaurants.id, restaurant_translations.name, restaurants_review_stats.total, 
restaurants_review_stats.average, restaurants_review_stats.one_star,
restaurants_review_stats.two_star, restaurants_review_stats.three_star,
restaurants_review_stats.four_star, restaurants_review_stats.five_star,
restaurants_review_stats.overall_food, restaurants_review_stats.overall_ambience, 
restaurants_review_stats.overall_service, restaurants_review_stats.overall_value
from restaurants 
join restaurants_review_stats on restaurants_review_stats.restaurant_id = restaurants.id 
JOIN restaurant_translations on restaurant_translations.restaurant_id = restaurants.id


# restaurant's rating score
select restaurants.id, restaurant_translations.name, google_reviews.rating from restaurants 
join google_reviews on google_reviews.restaurant_id = restaurants.id
JOIN restaurant_translations on restaurant_translations.restaurant_id  = restaurants.id
GROUP  by restaurants.id