Question: Set operation query questions (5 points per question) a. List the number and name of each customer that lives in the state of New Jersey
Set operation query questions (5 points per question) a. List the number and name of each customer that lives in the state of New Jersey (NJ), or that currently has a reservation, or both. b. List the trip IDs and trip names for each pair of trips that have the same start location. Each pair should be listed side by side, such as trip1_trip_id, trip1_trip_name, trip2_trip2_id, trip2_trip_name, start location. Sort your results by first trips trip id and then by second trips trip id. c. Display the trip ID, trip name, and reservation ID for all trips. For those trips that currently do not have reservation, the reservation ID should be left blank. Order the results by trip ID. d. Use except to find the customers from Massachusetts (MA) but didnt participate in a hiking trip.
Tables:





\( \begin{aligned} \text { SELECT } & \text { TOP (1000) [CUSTOMER_NUM] } \\ & ,[\text { LAST_NAME ] } \\ & ,[\text { FIRST_NAME] } \\ & ,[\text { ADDRESS ] } \\ & ,[\text { CITY ] } \\ & ,[\text { STATE ] } \\ & ,[\text { POSTAL_CODE ] } \\ & ,[\text { PHONE ] } \\ \text { FROM } & {[\text { COLONIAL] }][\mathrm{dbo}] \cdot[\text { CUSTOMER ] }}\end{aligned} \) \( \begin{aligned} \text { [SELECT } & \text { TOP (1000) [GUIDE_NUM] } \\ & ,[\text { LAST_NAME] } \\ & ,[\text { FIRST_NAME ] } \\ & ,[\text { ADDRESS] } \\ & {[\text { CITY] }} \\ & ,[\text { STATE }] \\ & ,\left[P O S T A L \_C O D E ight] \\ & ,[\text { PHONE_NUM] } \\ & ,[\text { HIRE_DATE ] } \\ \text { FROM } & {[\text { COLONIAL }] \cdot[\mathrm{dbo}] \cdot[\text { GUIDE }] }\end{aligned} \) \( \begin{aligned} \text { SELECT } & \text { TOP_(1000) [RESERVATION_ID] } \\ & ,[\text { TRIP_ID] } \\ & ,[\text { TRIP_DATE ] } \\ & ,[\text { NUM_PERSONS }] \\ & {[\text { TRIP_PRICE ] }} \\ & ,[\text { OTHER_FEES ] } \\ & ,[\text { CUSTOMER_NUM ] } \\ \text { FROM } & {[\text { COLONIAL] }][\mathrm{dbo}] \cdot[\text { RESERVATION }] }\end{aligned} \) \( \begin{aligned} \text { SELECT } & \text { TOP (1000) [TRIP_ID] } \\ & ,\left[G U I D E \_N U M ight] \\ & {[\text { [ASSIGN_DATE] }} \\ \text { FROM } & {[\text { COLONIAL] }[\text { dbo ] [TRIP_GUIDES ] }}\end{aligned} \) \( \begin{aligned} \text { SSELECT } & \text { TOP }(1000)[\text { TRIP_ID] } \\ & ,[\text { TRIP_NAME] } \\ & ,[\text { START_LOCATION] } \\ & ,[\text { STATE] } \\ & ,[\text { DISTANCE] } \\ & ,[\text { MAX_GRP_SIZE ] } \\ & {[\text { TYPE }] } \\ & ,[\text { SEASON] } \\ \text { FROM } & {[\text { COLONIAL] }][\text { dbo }] \cdot[\text { TRIP }] }\end{aligned} \) Results Messages Query executed successfully
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
