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. For each reservation that has a trip date of July 23, 2016, list the customer’s last name, the trip name, and the start location.
6. List the reservation ID, trip ID, and trip date for reservations for a trip in Maine (ME). Use the IN operator in your query.
7. Repeat Exercise 6, but this time use the EXISTS operator in your query.
8. Find the guide last name and guide first name of all guides who can lead a paddling trip. (Note: The query results should include duplicate values.)
9. Repeat Exercise 8 but use aliases for the table names.
10. List the trip IDs and trip names for each pair of trips that have the same start location. (For example, one such pair would be trip ID 2 and trip ID 3, because the start location of both trips is Weathersfield.) The first trip ID listed should be the major sort key, and the second trip ID should be the minor sort key.
11. Find the trip name of all reservations for hiking trips and sort the results by trip name in ascending order.
12. List the number and name of each customer that either lives in the state of New Jersey (NJ), or that currently has a reservation, or both.
13. List the number and name of each customer that lives in the state of New Jersey (NJ) and that currently has a reservation.
14. Find the trip ID and trip name for each trip whose maximum group size is greater than the maximum group size of every trip that has the type Hiking.
15. Find the trip ID and trip name for each trip whose maximum group size is greater than the maximum group size of at least one trip that has the type Biking.
16. Display the trip ID, trip name, and reservation ID for all trips. All trips should be included in the result. For those trips that currently do not have reservations, the reservation ID should be left blank. Order the results by trip ID.
PLEASE LIKE THE ANSWER
1. SELECT reservationID, tripID, customernumber, customerlastname FROM Reservation ORDER BY customerlastname;
2. SELECT reservationID, tripID, NumOfpersons FROM Reservation WHERE customername= "Ryan Goff";
3. SELECT tripName FROM Trip WHERE guide="Miles Abrams";
4. SELECT tripName FROM Trip WHERE Type="Biking" AND guide="Rita Boyers";
5. SELECT customerlastname, tripName, startlocation FROM reservation WHERE TripeDate="July 23, 2016";
6. SELECT reservationID, tripID, tripdate AS a, b, c FROM reservation WHERE (a IN Maine AND b IN Maine AND c IN Maine);
7. SELECT reservationID, tripID, tripdate FROM reservation WHERE EXISTS( SELECT reservationID, tripID, tripdate FROM Maine);
8. SELECT guidelastname, guidefirstname FROM Trip WHERE triptype="paddling trip";
AS PER CHEGG GUIDELINES WHEN STUDENT HAVE NOT MENTIONED HOW MANY QUESTION NEED TO BE ATTEMPTED WE HAVE TO ATTEMPT AT MAX 5 TO 6 QUESTIONS. DO LIKE THE ANSWER IF IT HELPS.
THANKYOU
SQL Homework 1. For each reservation, list the reservation ID, trip ID, customer number, and customer...
14. Write a query that lists the trip id, trip name and state
for all trips in New Hampshire. Run "Explain" against this query.
Now create an index on the state. Re-run your query and the
"Explain" Are there differences in the Explain results? Why or why
not?
Customer Customer Num LastName FirstName Address City State PostalCode Phone Reservation ReservationID TripID Trip Date Num Persons Trip Price Other Fees Customer Num Trip Guide TripID Guide Num LastName Trip Name Start...
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...
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 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...
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 the Fall seasons that is Early Fall, Spring and Late Fall. Sort by State. Use the wildcard for the season. SELECT TripName, State FROM Trip WHERE Season LIKE '%Fall' OR SEA ORDER BY State: Answer 1: LIKE '%Fall' OR SEASON LIKE 'Spring' Answer 2: ORDER BY Partial Question 11 1/2 pts Give the SQL statement to...
Prepare and execute each of the queries listed using the "Adventureworks2012" database in SQL: Server: http://msftdbprodsamples.codeplex.com/releases/view/93587 When all of your queries are complete, cut and paste the SQL Syntax into a word document. In order to see what the column names are, you need to click on the table and then Columns to see the field names. Make sure to include column headings that make sense in the queries (use the as “Field Name” after the field selected). Multi-table Queries...
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...
I need help with certain questions. Please.
18. 4 points
For each Rental, list the Rental ID,
Rental date, customer ID, customer first name, customer last name,
and count of disks rented; sort by Rental ID. Show the Rental date
formatted as ‘mm-dd-yyyy.’ Hint: use a GROUP BY clause.
19. 4 points
List the disk ID, title name, rating,
format description, and fee amount for all copies rented in Rental
3; sort by disk ID. Show the fee amount formatted...
can someone solve these quick
please and thank you!
sql chapter 4
Query #1: List the company name, contact name, contact title and
the phone number for customers who HAVE NOT put in an order. Use an
outer join.
Query #2: Create a listing displaying the employee first name,
last name and the full name (First name space Last Name) of the
person they report to (Supervisor). This is a self-join. If an
employee does not report to anyone then...
Write just one SQL statement per question 1. Display Publisher ID, Publisher Name and Total Number of Books published by each publisher. 2. List Publisher ID, Publisher Name, Title and price of the highest priced book. 3. List Order ID, Customer ID, Order Date, and Number of Items in each order. Order the data by Customer ID in ascending (A – Z) order. 4. Display Title, Category and Profit for each book in the children and computer category. 5. Display...