Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I NEED the SQL commands ASAP. THANK YOU. Click to Add All Access Obje... 0 Search. Tables BE Customer A FEE Guide Customer X CustomerNum

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

I NEED the SQL commands ASAP.

THANK YOU.

Click to Add All Access Obje... 0 Search. Tables BE Customer A FEE Guide Customer X CustomerNum - # 101 + 102 # 103 + 104 # 105 + 106 # 107 + 108 + 109 BEE Reservation Trip Trip Guides + 110 LastName FirstName - Address City - State - ZipCode Northfold Liam 1985 Highway 17 N. Londonderry NH 03053 Ocean Arnold 2332 South St. Apt 3 Springfield MA 01101 Kasuma Sujata 132 Main St. #1 East Hartford 06108 Goff Ryan 164A South Bend Rd. Lowell MA 01854 McLean Kyle 345 Lower Ave. Wolcott NY 14590 Morontoia Joseph 156 Scholar St. Johnston RI 02919 Marchand Quinn 76 Cross Rd. Bath NH 03740 Rulf Uschi 32 Sheep Stop St. Edinboro PA 16412 Caron Jean Luc 10 Greenfield St. Rome ME 04963 Bers Martha 65 Granite St. York NY 14592 Jones Laura 373 Highland Ave. Somerville MA 02143 Vaccari Adam 1282 Ocean Walk Ocean City NJ 08226 Murakami Iris 7 Cherry Blossom St. Weymouth MA 02188 Chau Clement 18 Ark Ledge Ln. Londonderry VT 05148 Gernowski Sadie 24 Stump Rd. Athens ME 04912 Bretton-Borak Siam 10 Old Main St. Cambridge VT 05444 Hefferson Orlagh 132 South St. Apt 27 Manchester NH 03101 Barnett Larry 25 Stag Rd. Fairfield 06824 Busa Karen 12 Foster St. South Windsor CT 06074 Peterson Becca 51 Fredrick St. Albion NY 14411 Brown Brianne 154 Central St. Vernon 06066 Phone 603-555-7563 413-555-3212 860-555-0703 781-555-8423 585-555-5321 401-555-4848 603-555-0456 814-555-5521 207-555-9643 585-555-0111 857-555-6258 609-555-5231 617-555-6665 802-555-3096 207-555-4507 802-555-3443 603-555-3476 860-555-9876 857-555-5532 585-555-0900 860-555-3234 + 112 + 115 + 116 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 * All Access Obje... 0 3 Guide X GuideNum , + AM01 LastName earch... Tables + BR01 EES Customer + DH01 Guide + GZ01 Reservation + KS01 Abrams Boyers Devon Gregory Kiley Kelly Marston Rowan Stevens Unser FirstName Miles Rita Harley Zach Susan Sam Ray Hal Lori Glory Address City State - ZipCode 54 Quest Ave. Williamsburg MA 01096 140 Oakton Rd. Jaffrey NH 03452 25 Old Ranch Rd. Sunderland MA 01375 7 Moose Head Rd. Dummer NH 03588 943 Oakton Rd. Jaffrey NH 03452 9 Congaree Ave. Fraconia NH 03580 24 Shenandoah Rd. Springfield MA 01101 12 Heather Rd. Mount Desert ME 04660 15 Riverton Rd. Coventry VT 05825 342 Pineview St. Danbury 06810 PhoneNum - 617-555-6032 603-555-2134 781-555-7767 603-555-8765 603-555-1230 603-555-0003 781-555-2323 207-555-9009 802-555-3339 203-555-8534 Hire Date Click to Add 6/3/2012 3/4/2012 1/8/2017 11/4/2013 4/8/2016 6/10/2016 9/14/2015 6/2/2014 9/5/2014 2/2/2017 HE Trip + KSO2 + MR01 H Trip Guides + RHO1 + SLO1 + UG01 Views Clipboard All Access Obje... o Search... Tables Es Customer FEE Guide FET Reservation FEE Trip 3 TripGuides $25.00 Sort & Filter Records Find Text Formatting Reservation X ReservationID - TriplD - TripDate - NumPersons - TripPrice - OtherFees - CustomerNum - Click to Add 1800001 40 3/26/2018 2 $55.00 $0.00 101 1800002 21 6/8/2018 2 $95.00 $0.00 101 1800003 28 9/12/2018 1 $35.00 $0.00 103 $ 1800004 26 10/16/2018 4 $45.00 $15.00 104 1800005 39 6/25/2018 5 $55.00 $0.00 105 1800006 32 6/18/2018 1 $80.00 $20.00 106 1800007 22 7/9/2018 8 $75.00 $10.00 107 1800008 28 9/12/2018 2 $35.00 $0.00 108 1800009 38 9/11/2018 2 $90.00 $40.00 109 1800010 2 5/14/2018 3 $0.00 102 1800011 3 9/15/2018 3 $25.00 $0.00 102 1800012 1 6/12/2018 4 $15.00 $0.00 115 1800013 8 7/9/2018 1 $20.00 $5.00 116 1800014 12 10/1/2018 2 $40.00 $5.00 119 1800015 10 7/23/2018 1 $20.00 $0.00 120 1800016 11 7/23/2018 6 $75.00 $15.00 121 1800017 39 6/18/2018 3 $20.00 $5.00 122 1800018 38 9/18/2018 4 $85.00 $15.00 126 1800019 25 8/29/2018 2 $110.00 $25.00 124 1800020 28 8/27/2018 2 $35.00 $10.00 124 1800021 32 6/11/2018 3 $90.00 $20.00 112 1800022 21 6/8/2018 1 $95.00 $25.00 119 1800024 38 9/11/2018 1 $70.00 $30.00 121 1800025 38 9/11/2018 2 $70.00 $45.00 125 1800026 12 10/1/2018 2 $40.00 $0.00 126 1800029 4 9/19/2018 4 $105.00 $25.00 120 1800030 15 7/25/2018 6 $60.00 $15.00 104 All Access Obje... Click to Add Search... Tables + + Customer 3 + Guide Reservation EE Late Spring FEE Trip + HE Trip Guides + + BE Trip TriplD Trip Name StartLocation 1 Arethusa Falls Harts Location 2 Mt Ascutney - North Peak Weathersfield 3 Mt Ascutney - West Peak Weathersfield 4 Bradbury Mountain Ride Lewiston-Auburn 5 Baldpate Mountain North Newry 6 Blueberry Mountain Batchelders Grant 7 Bloomfield - Maidstone Bloomfield 8 Black Pond Lincoln 9 Big Rock Cave Tamworth 10 Mt. Cardigan - Firescrew Orange 11 Chocorua Lake Tour Tamworth 12 Cadillac Mountain Ride Bar Harbor 13 Cadillac Mountain Bar Harbor 14 Cannon Mtn Franconia 15 Crawford Path Presidentials Hike Crawford Notch 16 Cherry Pond Whitefield 17 Huguenot Head Hike Bar Harbor 18 Low Bald Spot Hike Pinkam Notch 19 Mason's Farm North Stratford 20 Lake Mephremagog Tour Newport 21 Long Pond Rutland 22 Long Pond Tour Greenville 23 Lower Pond Tour Poland 24 Mt Adams Randolph 25 Mount Battie Ride Camden 26 Mount Cardigan Hike Cardigan 27 Mt. Chocorua Albany 28 Mount Garfield Hike Woodstock 29 Metacomet-Monadnock Trail Hike Pelham State - Distance - MaxGrpSize - Type Season NH 5 10 Hiking Summer VT 5 6 Hiking Late Spring VT 6 10 Hiking Early Fall ME 25 8 Biking Early Fall ME 6 10 Hiking ME 8 8 Hiking Early Fall CT 10 6 Paddling Late Spring NH 8 12 Hiking Summer NH 6 10 Hiking Summer NH 7 8 Hiking Summer NH 12 15 Paddling Summer ME 8 16 Biking Early Fall ME 7 8 Hiking Late Spring NH 6 6 Hiking Early Fall NH 16 4 Hiking Summer NH 6 6 16 Hiking Spring ME 5 10 Hiking Early Fall NH 8 6 Hiking Early Fall 12 7 Paddling Late Spring VT 8 15 Paddling Late Spring MA 8 12 Hiking Summer ME 12 10 Paddling Summer ME 8 15 Paddling Late Spring NH 9 6 Hiking Summer ME 20 8 Biking Early Fall NH 4 16 Hiking Late Fall NH 6 10 Hiking NH 5 10 Hiking Early Fall MA 10 12 Hiking Late Spring + + + Spring + Views Records Find Clipboard All Access Obje... 0 Search Tables Customer Click to Add Guide Reservation Trip TripGuides Sort & Filter TripGuides X TriplD GuideNum GZ01 1 RH01 2 AM01 2 SL01 3 SL01 4 BR01 4 GZ01 5 KS01 5 UG01 6 RH01 7 SLO1 8 BRO1 9 BR01 10 GZ01 11 DH01 11 KS01 11 UG01 12 BR01 13 RH01 14 KSO2 15 GZ01 16 KSO2 17 RH01 18 KSO2 19 DH01 20 SLO1 21 AM01 22 UGO1 23 DH01 23 SL01 24 BRO1 25 BR01 26 GZ01 27 GZ01 28 BR01 29 DH01 30 AM01 31 SL01 32 KS01 33 UGO1 Record: * 1 of 48 No Filter Search Write the SQL queries to answer following questions. You can test your query in Access or MySQL. Type the queries below every question and submit the word document. 1. List the name of each trip that has the max group size less than 10 and that has a distance less than 15 miles. 2. List the name of each trip that has the type Biking or that is located in state MA 3. List states along with how many trips for each state and what are these trip's average distance. 4. Show the total distance of Hiking trips in each state, order them in descending order. 5. How many reservations include a trip in ME with a price that is greater than $20 but less than $50? 6. List the trip name, the guide's first name and the guide's last name for all trips that originate in CT. Sort the results by guide's last name within trip name. 7. The total price of a trip is calculated by adding the trip price plus other fees and multiplying the result by the number of persons included in the reservation. List the reservation ID, trip name, customer's last name, first name, and total price for all reservations where the number of persons is less than 3. 8. Create a new table named Hiking that includes all columns in the Reservation table where the trip type is Hiking 9. Change the otherfees to 15 dollars on all reservation with 2 persons in Hiking table 10. List the name and distance of the trips whose distance is greater than the average distance of all trips (when you design the query, you don't know the average distance in advance, the average should also be calculated in your query) Hint: use subquery Click to Add All Access Obje... 0 Search. Tables BE Customer A FEE Guide Customer X CustomerNum - # 101 + 102 # 103 + 104 # 105 + 106 # 107 + 108 + 109 BEE Reservation Trip Trip Guides + 110 LastName FirstName - Address City - State - ZipCode Northfold Liam 1985 Highway 17 N. Londonderry NH 03053 Ocean Arnold 2332 South St. Apt 3 Springfield MA 01101 Kasuma Sujata 132 Main St. #1 East Hartford 06108 Goff Ryan 164A South Bend Rd. Lowell MA 01854 McLean Kyle 345 Lower Ave. Wolcott NY 14590 Morontoia Joseph 156 Scholar St. Johnston RI 02919 Marchand Quinn 76 Cross Rd. Bath NH 03740 Rulf Uschi 32 Sheep Stop St. Edinboro PA 16412 Caron Jean Luc 10 Greenfield St. Rome ME 04963 Bers Martha 65 Granite St. York NY 14592 Jones Laura 373 Highland Ave. Somerville MA 02143 Vaccari Adam 1282 Ocean Walk Ocean City NJ 08226 Murakami Iris 7 Cherry Blossom St. Weymouth MA 02188 Chau Clement 18 Ark Ledge Ln. Londonderry VT 05148 Gernowski Sadie 24 Stump Rd. Athens ME 04912 Bretton-Borak Siam 10 Old Main St. Cambridge VT 05444 Hefferson Orlagh 132 South St. Apt 27 Manchester NH 03101 Barnett Larry 25 Stag Rd. Fairfield 06824 Busa Karen 12 Foster St. South Windsor CT 06074 Peterson Becca 51 Fredrick St. Albion NY 14411 Brown Brianne 154 Central St. Vernon 06066 Phone 603-555-7563 413-555-3212 860-555-0703 781-555-8423 585-555-5321 401-555-4848 603-555-0456 814-555-5521 207-555-9643 585-555-0111 857-555-6258 609-555-5231 617-555-6665 802-555-3096 207-555-4507 802-555-3443 603-555-3476 860-555-9876 857-555-5532 585-555-0900 860-555-3234 + 112 + 115 + 116 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 * All Access Obje... 0 3 Guide X GuideNum , + AM01 LastName earch... Tables + BR01 EES Customer + DH01 Guide + GZ01 Reservation + KS01 Abrams Boyers Devon Gregory Kiley Kelly Marston Rowan Stevens Unser FirstName Miles Rita Harley Zach Susan Sam Ray Hal Lori Glory Address City State - ZipCode 54 Quest Ave. Williamsburg MA 01096 140 Oakton Rd. Jaffrey NH 03452 25 Old Ranch Rd. Sunderland MA 01375 7 Moose Head Rd. Dummer NH 03588 943 Oakton Rd. Jaffrey NH 03452 9 Congaree Ave. Fraconia NH 03580 24 Shenandoah Rd. Springfield MA 01101 12 Heather Rd. Mount Desert ME 04660 15 Riverton Rd. Coventry VT 05825 342 Pineview St. Danbury 06810 PhoneNum - 617-555-6032 603-555-2134 781-555-7767 603-555-8765 603-555-1230 603-555-0003 781-555-2323 207-555-9009 802-555-3339 203-555-8534 Hire Date Click to Add 6/3/2012 3/4/2012 1/8/2017 11/4/2013 4/8/2016 6/10/2016 9/14/2015 6/2/2014 9/5/2014 2/2/2017 HE Trip + KSO2 + MR01 H Trip Guides + RHO1 + SLO1 + UG01 Views Clipboard All Access Obje... o Search... Tables Es Customer FEE Guide FET Reservation FEE Trip 3 TripGuides $25.00 Sort & Filter Records Find Text Formatting Reservation X ReservationID - TriplD - TripDate - NumPersons - TripPrice - OtherFees - CustomerNum - Click to Add 1800001 40 3/26/2018 2 $55.00 $0.00 101 1800002 21 6/8/2018 2 $95.00 $0.00 101 1800003 28 9/12/2018 1 $35.00 $0.00 103 $ 1800004 26 10/16/2018 4 $45.00 $15.00 104 1800005 39 6/25/2018 5 $55.00 $0.00 105 1800006 32 6/18/2018 1 $80.00 $20.00 106 1800007 22 7/9/2018 8 $75.00 $10.00 107 1800008 28 9/12/2018 2 $35.00 $0.00 108 1800009 38 9/11/2018 2 $90.00 $40.00 109 1800010 2 5/14/2018 3 $0.00 102 1800011 3 9/15/2018 3 $25.00 $0.00 102 1800012 1 6/12/2018 4 $15.00 $0.00 115 1800013 8 7/9/2018 1 $20.00 $5.00 116 1800014 12 10/1/2018 2 $40.00 $5.00 119 1800015 10 7/23/2018 1 $20.00 $0.00 120 1800016 11 7/23/2018 6 $75.00 $15.00 121 1800017 39 6/18/2018 3 $20.00 $5.00 122 1800018 38 9/18/2018 4 $85.00 $15.00 126 1800019 25 8/29/2018 2 $110.00 $25.00 124 1800020 28 8/27/2018 2 $35.00 $10.00 124 1800021 32 6/11/2018 3 $90.00 $20.00 112 1800022 21 6/8/2018 1 $95.00 $25.00 119 1800024 38 9/11/2018 1 $70.00 $30.00 121 1800025 38 9/11/2018 2 $70.00 $45.00 125 1800026 12 10/1/2018 2 $40.00 $0.00 126 1800029 4 9/19/2018 4 $105.00 $25.00 120 1800030 15 7/25/2018 6 $60.00 $15.00 104 All Access Obje... Click to Add Search... Tables + + Customer 3 + Guide Reservation EE Late Spring FEE Trip + HE Trip Guides + + BE Trip TriplD Trip Name StartLocation 1 Arethusa Falls Harts Location 2 Mt Ascutney - North Peak Weathersfield 3 Mt Ascutney - West Peak Weathersfield 4 Bradbury Mountain Ride Lewiston-Auburn 5 Baldpate Mountain North Newry 6 Blueberry Mountain Batchelders Grant 7 Bloomfield - Maidstone Bloomfield 8 Black Pond Lincoln 9 Big Rock Cave Tamworth 10 Mt. Cardigan - Firescrew Orange 11 Chocorua Lake Tour Tamworth 12 Cadillac Mountain Ride Bar Harbor 13 Cadillac Mountain Bar Harbor 14 Cannon Mtn Franconia 15 Crawford Path Presidentials Hike Crawford Notch 16 Cherry Pond Whitefield 17 Huguenot Head Hike Bar Harbor 18 Low Bald Spot Hike Pinkam Notch 19 Mason's Farm North Stratford 20 Lake Mephremagog Tour Newport 21 Long Pond Rutland 22 Long Pond Tour Greenville 23 Lower Pond Tour Poland 24 Mt Adams Randolph 25 Mount Battie Ride Camden 26 Mount Cardigan Hike Cardigan 27 Mt. Chocorua Albany 28 Mount Garfield Hike Woodstock 29 Metacomet-Monadnock Trail Hike Pelham State - Distance - MaxGrpSize - Type Season NH 5 10 Hiking Summer VT 5 6 Hiking Late Spring VT 6 10 Hiking Early Fall ME 25 8 Biking Early Fall ME 6 10 Hiking ME 8 8 Hiking Early Fall CT 10 6 Paddling Late Spring NH 8 12 Hiking Summer NH 6 10 Hiking Summer NH 7 8 Hiking Summer NH 12 15 Paddling Summer ME 8 16 Biking Early Fall ME 7 8 Hiking Late Spring NH 6 6 Hiking Early Fall NH 16 4 Hiking Summer NH 6 6 16 Hiking Spring ME 5 10 Hiking Early Fall NH 8 6 Hiking Early Fall 12 7 Paddling Late Spring VT 8 15 Paddling Late Spring MA 8 12 Hiking Summer ME 12 10 Paddling Summer ME 8 15 Paddling Late Spring NH 9 6 Hiking Summer ME 20 8 Biking Early Fall NH 4 16 Hiking Late Fall NH 6 10 Hiking NH 5 10 Hiking Early Fall MA 10 12 Hiking Late Spring + + + Spring + Views Records Find Clipboard All Access Obje... 0 Search Tables Customer Click to Add Guide Reservation Trip TripGuides Sort & Filter TripGuides X TriplD GuideNum GZ01 1 RH01 2 AM01 2 SL01 3 SL01 4 BR01 4 GZ01 5 KS01 5 UG01 6 RH01 7 SLO1 8 BRO1 9 BR01 10 GZ01 11 DH01 11 KS01 11 UG01 12 BR01 13 RH01 14 KSO2 15 GZ01 16 KSO2 17 RH01 18 KSO2 19 DH01 20 SLO1 21 AM01 22 UGO1 23 DH01 23 SL01 24 BRO1 25 BR01 26 GZ01 27 GZ01 28 BR01 29 DH01 30 AM01 31 SL01 32 KS01 33 UGO1 Record: * 1 of 48 No Filter Search Write the SQL queries to answer following questions. You can test your query in Access or MySQL. Type the queries below every question and submit the word document. 1. List the name of each trip that has the max group size less than 10 and that has a distance less than 15 miles. 2. List the name of each trip that has the type Biking or that is located in state MA 3. List states along with how many trips for each state and what are these trip's average distance. 4. Show the total distance of Hiking trips in each state, order them in descending order. 5. How many reservations include a trip in ME with a price that is greater than $20 but less than $50? 6. List the trip name, the guide's first name and the guide's last name for all trips that originate in CT. Sort the results by guide's last name within trip name. 7. The total price of a trip is calculated by adding the trip price plus other fees and multiplying the result by the number of persons included in the reservation. List the reservation ID, trip name, customer's last name, first name, and total price for all reservations where the number of persons is less than 3. 8. Create a new table named Hiking that includes all columns in the Reservation table where the trip type is Hiking 9. Change the otherfees to 15 dollars on all reservation with 2 persons in Hiking table 10. List the name and distance of the trips whose distance is greater than the average distance of all trips (when you design the query, you don't know the average distance in advance, the average should also be calculated in your query) Hint: use subquery

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What about leadership lessons from particularly good or bad bosses?

Answered: 1 week ago