SELECT S.cost
FROM(
(
SELECT shoppingserviceid ,cost,bsid
FROM service JOIN shopping_service
ON service.serviceid = shopping_service.serviceid
) S JOIN provided_service
ON provided_service.shoppingserviceid = S.shoppingserviceid
) P JOIN provide_service_detail
ON provide_service_detail.providedserviceid = P.providedserviceid
SELECT *
FROM service
JOIN shopping_service
ON service.serviceid = shopping_service.serviceid
JOIN provided_service
ON provided_service.shoppingserviceid = shopping_service.shoppingserviceid
JOIN provide_service_detail
ON provide_service_detail.providedserviceid = provided_service.providedserviceid
SELECT S.cost
FROM (select * from ((SELECT shoppingserviceid, cost, bsid FROM service JOIN shopping_service ON service.serviceid = shopping_service.serviceid) S JOIN
provided_service ON provided_service.shoppingserviceid = S.shoppingserviceid)) P
JOIN provide_service_detail
ON provide_service_detail.providedserviceid = P.providedserviceid