Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For my SQL class, I have to write SQL queries for a premade database composed of GUIDE, TRIP, CUSTOMER, and RESERVATION tables. I have been

For my SQL class, I have to write SQL queries for a premade database composed of GUIDE, TRIP, CUSTOMER, and RESERVATION tables.

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

I have been unable to form working queries for a number of the instructions, I need help writing the queries, I understand how they work but I'm doing something wrong in format.

Complete the following SQL statements using the Colonial Adventures Tours tables: a. List the trip name of each trip that has the season Summer. b. List the customer number, first name, and last name of each customer that lives in NJ, NY, or PA. Use an OR operator to create this SQL command. c. Repeat the same query for customers in NJ, NY, or PA using the IN operator. d. Write the SQL statement that tells how many trips are in the state of New Hampshire or Massachusetts. e. List the first and last names of all of the guides that were hired before 12/31/2013. f. List the reservation IDs for reservations for at least 4 people. g. List the name and distance of all trips that have MOUNT or MT in their name and have a distance greater than 5 miles. h. Write the SQL statement that tells how many reservations Colonial currently has where the total amount due (trip price and other fees) is less than $60. i. Display each season in which trips are offered. Each season should only be listed once. j. Write a query to display the average distance and average maximum group size by state. For example, it would return that the average distance of a trip in CT is 11 and the average max group size is 6.5

GUIDE GUIDE NUM LAST_NAME FIRST_NAME AMO1 BR01 ADDRESS 54 Quest Ave. 140 Oakton Rd. Jaffrey 25 Old Ranch Rd. Sunderland MA 0 7 Moose llead Rd. Dummer 943 Oakton Rd. Jaffrey 9 Congaree Ave 24 Shenandoah Rd Springfield | MA | 01101 12 Ileather Rd. 15 Riverton Rd. Co 342 Pineview St STATE POSTAL_CODE PHONE NUM HIRE DATIE 617-555-6032632012 3/4/2012 V8/2012 11/4/2012 4/8/2013 603-555-0003 10/2013 781-555-2323| 9/14/2015 2/2014 9/5/2014 2/2/2015 CITY Miles Rita larley Abrams Boyers Devon Gregory Zach Kiley Kelly Williamsbur MA 01096 NII NII NII NII 03452 01375 03588 03452 03580 603-555-2134 781-555-7767 603-555-8765 603-555-1230 GZO1 KS01 Susan Sam Ray Ilal Lori Glory Fraconia MRO1 RII01 SLO1 UG01 Rowan Stevens Unser Mount DesertME Coventry Danbury 04660 05825 06810 207-555-9009 802-555-3339 203-555-8534 VT CT

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions