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) : 6 Charge Q Located 0 0 Creates Electric Field X V Given Z2 Y2 3 2 K Constant Calculate Wor Q32967692 . . . .(Solved) : 6 Charge Q Located 0 0 Creates Electric Field X V Given Z2 Y2 3 2 K Constant Calculate Wor Q32967692 . . . .

<br/><img src="https://media.cheggcdn.com/media%2Fb91%2Fb9192145-3706-41ef-af04-7c53b4b4d346%2Fimage.png" alt="6. A charge q located at (0,0) creates an electric field at (x, v) given by z2 +y2)3/2 where K is a constant. Calculate the work required to

(Solved) : Assignment Going Maintaining File Students Registered Courses Learn Concepts Structures Po Q30546862 . . . .(Solved) : Assignment Going Maintaining File Students Registered Courses Learn Concepts Structures Po Q30546862 . . . .

<br/><img src="https://media.cheggcdn.com/media%2Fdc6%2Fdc6fe5d0-8042-47c4-9284-a15d03cac20d%2Fimage" alt="Through this assignment, you are going to be maintaining a file of all students and their registered courses to learn the concepts of structures, pointers to structures, dynamic