Course Solutions Uncategorized (Solved) : Combine 2 Queries Produce Something Like Query 1 Select Hotelcountry Timeyear Timemonth Co Q28206134 . . . .

(Solved) : Combine 2 Queries Produce Something Like Query 1 Select Hotelcountry Timeyear Timemonth Co Q28206134 . . . .

 

How do I combine these 2 queries to produce something likethis

country year month checkedout booked Total (checkout+booked Afghanistan 2007 Afghanistan 2014 Afghanistan 2014 Albania 2010 Angola 2001 Argentina 2003 6 2 7

QUERY 1

SELECT hotel.country, time.year, time.month,COUNT(booking.room_id) as booked

FROM booking

LEFT JOIN room on room.room_id = booking.room_id

LEFT JOIN hotel on room.hotel_id = hotel.hotel_id

LEFT JOIN time on booking.time_id = time.time_id

GROUP BY hotel.country, time.year, time.month

ORDER by hotel.country, time.year, time.month

QUERY 2

SELECT hotel.country, time.year, time.month,COUNT(checkout.room_id) as checkedout

FROM checkout

LEFT JOIN room on room.room_id = checkout.room_id

LEFT JOIN hotel on room.hotel_id = hotel.hotel_id

LEFT JOIN time on checkout.time_id = time.time_id

GROUP BY hotel.country, time.year, time.month

ORDER BY hotel.country,

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : Hello Need Help C Assignment Requires Modification Given Code Include Include Include Usin Q35750106 . . . .(Solved) : Hello Need Help C Assignment Requires Modification Given Code Include Include Include Usin Q35750106 . . . .

<p>Hello, I need help with a C++ assignment. It requiresmodification of the given code:</p><p>#include <iostream><br/>#include <fstream><br/>#include <cstdlib></p><p>using namespace std;</p><p>enum Kind<br/>{<br/>    business, maintenance, other, box, tank, flat,otherFreight, chair, sleeper, otherPassenger<br/>};</p><p>const string

(Answered) : Intergrated, Inc. is the largest manufacturer of yard equipment in the Midwest which include these four outstanding employees, amo(Answered) : Intergrated, Inc. is the largest manufacturer of yard equipment in the Midwest which include these four outstanding employees, amo

Intergrated, Inc. is the largest manufacturer of yard equipment in the Midwest which include these four outstanding employees, among many other employees. Ingrid works in internal audit, Fred works in