Question

Partial Question 10 1/2 pts Give the SQL statement to list the trip name and state for each trip that occurs during one of th

Partial Question 12 1/3 pts Give the SQL statement to display the number of reservations that include a trip with a price tha

Guide GuideNum Last Name FirstName Address City State Postal Code PhoneNum Hire Date Miles AM01 BRO1 DH01 GZO1 KS01 KSO2 MR01

Trip StartLocation State Distance MaxGrpSize 1 2 Early Fall Early Fall Early Fall 6 7 9 10 11 12 13 14 15 16 17 18 19 20 21 2

Num Persons 2 2 1 4 un 1 8 2 2 3 3 Reservation ReservationID TriplD 1600001 40 1600002 21 1600003 28 1600004 26 1600005 39 16

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:

-- When there is no wildcard operator, no need to use LIKE operator

-- For season spring

SELECT TripName, State FROM Trip

WHERE Season LIKE '%Fall' OR Season = 'Spring'

ORDER BY State;

-- It is advised to use primary column i.e. TripId rather than TripName

-- Use column name alias for resulted column

-- Use IN operator

SELECT COUNT(TripId) AS NumberOfTrips FROM Trip WHERE State IN('VT','CT');

-- It is advised to use primary column i.e. ReservationID rather

-- Use column name alias for resulted column

-- Use >= and <= properly, you just mentioned >.

SELECT COUNT(ReservationID) AS NumberOfReservations FROM Reservation WHERE TripPrice >= 20 AND TripPrice <=50;

-- or Use Between operator

SELECT COUNT(ReservationID) AS NumberOfReservations FROM Reservation WHERE TripPrice BETWEEN 20 AND 50;

When there is no wildcard operator, no need to use LIKE operator -- For season spring SELECT TripName, State FROM Trip WHERE

******************************************************************************

Feel free to rate the answer and comment your questions, if you have any.

Please upvote the answer and appreciate our time.

Happy Studying!!!

******************************************************************************

Add a comment
Know the answer?
Add Answer to:
Partial Question 10 1/2 pts Give the SQL statement to list the trip name and state...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Need SQL statement: List the First and Last name of All Customers and whether or not...

    Need SQL statement: List the First and Last name of All Customers and whether or not they have a reservation. (Hint: the results should show the customer information even if they don’t have a reservation.) All Access Obje... 0« - Search... Tables Customer PostalCode 03053 01101 Phone - Click to Add 603-555-7563 413-555-3212 860-555-0703 781-555-8423 585-555-5321 401-555-4848 06108 01854 Guide Reservation 14590 02919 03740 Trip Trip Guides Queries Reservation Query 603-555-0456 814-555-5521 16412 A 04963 BE Trip Trip X X...

  • USE colonial; CREATE TABLE CUSTOMER (CUSTOMER_NUM CHAR(4) PRIMARY KEY, LAST_NAME CHAR(30) NOT NULL, FIRST_NAME CHAR (30),...

    USE colonial; CREATE TABLE CUSTOMER (CUSTOMER_NUM CHAR(4) PRIMARY KEY, LAST_NAME CHAR(30) NOT NULL, FIRST_NAME CHAR (30), ADDRESS CHAR(35), CITY CHAR(35), STATE CHAR(2), POSTAL_CODE CHAR(5), PHONE CHAR(12) ); CREATE TABLE RESERVATION (RESERVATION_ID CHAR(7) PRIMARY KEY, TRIP_ID DECIMAL(3,0), TRIP_DATE DATE, NUM_PERSONS DECIMAL(3,0), TRIP_PRICE DECIMAL(6,2), OTHER_FEES DECIMAL(6,2), CUSTOMER_NUM CHAR(4) ); CREATE TABLE TRIP (TRIP_ID DECIMAL(3,0) PRIMARY KEY, TRIP_NAME CHAR(75), START_LOCATION CHAR(50), STATE CHAR(2), DISTANCE DECIMAL(4,0), MAX_GRP_SIZE DECIMAL(4,0), TYPE CHAR(20), SEASON CHAR(20) ); CREATE TABLE TRIP_GUIDES (TRIP_ID DECIMAL(3,0), GUIDE_NUM CHAR(4), PRIMARY KEY (TRIP_ID, GUIDE_NUM)...

  • I need the SQL statements for these questions: 6. List the reservation IDs for reservations that...

    I need the SQL statements for these questions: 6. List the reservation IDs for reservations that are for a paddling trip. (Hint: Use a subquery.) 7. What is the longest distance for a biking trip? 8. For each trip in the RESERVATION table that has more than one reservation, group by trip ID and sum the trip price. (Hint: Use the COUNT function and a HAVING clause.) 9. How many current reservations does Colonial Adventure Tours have and what is...

  • A guide to SQL 9th edition Colonial Adventure Tours chapter 3 page 90-92 Odd numbered exercises...

    A guide to SQL 9th edition Colonial Adventure Tours chapter 3 page 90-92 Odd numbered exercises only figure 3-39(Guide, trip, customer, reservation and Trip_Guides) figure 1-5 chapter 1: 7. Review me on TUI UTILIVUDIJ types used to create the ITEM table in Figure 3-34. Suggest alternate data types for the DESCRIPTION, ON HAND. and STOREHOUSE fields and explain your recommendation Colonial Adventure Tours Use SQL to complete the following exercises 1. Create a table named ADVENTURE TRIP. The table has...

  • I am working on multi-table queries for my SQL class using a premade database, which I...

    I am working on multi-table queries for my SQL class using a premade database, which I have included screenshots of. I received assistance and was able to complete a good number of the queries but the bolded ones seem absolutely impossible to do?? How do I write a query for the bolded questions?? I've scoured my textbook and notes and cannot get anything I try to successfully produce results. 1. List all current reservations with the trip ID, customer’s first...

  • SQL Homework 1. For each reservation, list the reservation ID, trip ID, customer number, and customer...

    SQL Homework 1. For each reservation, list the reservation ID, trip ID, customer number, and customer last name. Order the results by customer last name. 2. For each reservation for customer Ryan Goff, list the reservation ID, trip ID, and number of persons. 3. List the trip name of each trip that has Miles Abrams as a guide. 4. List the trip name of each trip that has the type Biking and that has Rita Boyers as a guide. 5....

  • Use only a single SQL statement for each of the following questions 1 Give a listing of all the ssns,first names and the class descriptions of all the classes the students are taking. If there a...

    Use only a single SQL statement for each of the following questions 1 Give a listing of all the ssns,first names and the class descriptions of all the classes the students are taking. If there are no class _descriptions display 'No description is available yet'. (USE NVL) 2 Give a listing of only the lname and the class_code for students who are taking 'Introduction to C programming'. (Inner join) 3 Give a lising of all the class_descriptions and the number...

  • please answer these queries. 1. List the artist name of the artists who do not have...

    please answer these queries. 1. List the artist name of the artists who do not have a webaddress and their leadsource is “Directmail” 2. List the names of members in the artist called 'Today'. 3. Report the total runtime in minutes FOR EACH album in the Titles table. 4.List the firstname, lastname of members who are represented by the salesperson “Lisa Williams” 5.List EACH salesperson’s firstname along with the number of Members that EACH SalesPerson represents. DROP TABLES IF EXISTS...

  • are Each question is worth 10 points. apply 1. List the book code and book title...

    are Each question is worth 10 points. apply 1. List the book code and book title of each book that has the type HOR 2. List the book code and book title of each book that has the type HOR or is published by the publisher with the publisher code SC 3. List the book code and book title of each book that has the type MYS and a price of less than $20 4. List the book code, book...

  • Saved Question 1 (20 points) List the names of responsible parties along with the artist name...

    Saved Question 1 (20 points) List the names of responsible parties along with the artist name of the artist they are responsible for. select artists.artistname, mem Question 2 (20 points) List each artist name and a count of the number of members assigned to that artist AV Question 3 (20 points) List each title from the Title table along with the name of the studio where it was recorded, the name of the artist, and the number of tracks on...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT