Question

Use Workbench/Command Line to create the commands that will run the following queries/problem scenarios. Use MySQL...

Use Workbench/Command Line to create the commands that will run the
following queries/problem scenarios.
Use MySQL and the Colonial Adventure Tours database to complete the following
exercises.
1. List the last name of each guide that does not live in Massachusetts (MA).
2. List the trip name of each trip that has the type Biking.
3. List the trip name of each trip that has the season Summer.
4. List the trip name of each trip that has the type Hiking and that has a distance longer
than 10 miles.
5. List the customer number, customer last name, and customer first name of each
customer that lives in New Jersey (NJ), New York (NY) or Pennsylvania (PA). Use the
IN operator in your command.
6. Repeat Exercise 5 and sort the records by state in descending order and then by
customer last name in ascending order.
7. How many trips are in the states of Maine (ME) or Massachusetts (MA)?
8. How many trips originate in each state?
9. How many reservations include a trip price that is greater than $20 but less than
$75?
10. How many trips of each type are there?

Homework Answers

Answer #1

Solution

1)
SELECT LAST_NAME FROM GUIDE
WHERE STATE <> 'MA';

2)
SELECT TRIP_NAME FROM TRIP
WHERE TYPE='Biking';

3)
SELECT TRIP_NAME FROM TRIP
WHERE SEASON='Summer';

4)
SELECT TRIP_NAME FROM TRIP
WHERE TYPE='Hiking' AND DISTANCE > 10;

5)
SELECT CUSTOMER_NUM, LAST_NAME, FIRST_NAME FROM CUSTOMER
WHERE STATE IN('NJ','NY','PA');

6)
SELECT CUSTOMER_NUM, LAST_NAME, FIRST_NAME FROM CUSTOMER
WHERE STATE IN('NJ','NY','PA')
ORDER BY STATE DESC,LAST_NAME ASC;

7)
SELECT COUNT(*) FROM TRIP
WHERE STATE IN('ME','MA');

8)
SELECT STATE, COUNT(TRIP_ID) FROM TRIP
GROUP BY STATE
ORDER BY STATE;

9)
SELECT COUNT(*) FROM RESERVATION
WHERE TRIP_PRICE>20 AND TRIP_PRICE<75;

10)
SELECT TYPE, COUNT(TRIP_ID) FROM TRIP
GROUP BY TYPE
ORDER BY TYPE;

---

answered all the questions

if you have any doubt, please mention it, love to help

all the best

please upvote

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Item 6 In the case below, the original source material is given along with a sample...
Item 6 In the case below, the original source material is given along with a sample of student work. Determine the type of plagiarism by clicking the appropriate radio button. Original Source Material Student Version The study of learning derives from essentially two sources. Because learning involves the acquisition of knowledge, the first concerns the nature of knowledge and how we come to know things.... The second source in which modern learning theory is rooted concerns the nature and representation...
Item 1 In the case below, the original source material is given along with a sample...
Item 1 In the case below, the original source material is given along with a sample of student work. Determine the type of plagiarism by clicking the appropriate radio button. Original Source Material Student Version But what are reasonable outcomes of the influence of global processes on education?While the question of how global processes influence all aspects of education (and who controls these forces) is multidimensional and not completely testable, there appear to be some theories of globalization as it...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how the firms resources incompetencies support the given pressures regarding costs and local responsiveness. Describe entry modes have they usually used, and whether they are appropriate for the given strategy. Any key issues in their global strategy? casestudy: Atlanta, June 17, 2014. Sea of Delta employees and their families swarmed between food trucks, amusement park booths, and entertainment venues that were scattered throughout what would...