Question

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 name, last name and date of trip. List the reservations alphabetically by customer’s last name.
2. List the trip name of each of Glory Unser’s trips.
3. Create a list of all customers taking a trip on July 23, 2016. Include the customer’s first name, last name and the start location.
4. List the reservation ID, trip ID, and trip date for reservations for trips in ME. Run the query once using the IN operator and write the query and run it again using the EXISTS operator. Be sure and provide both screenshots.
5. List the first and last name of all guides that lead biking trips. Query results should have duplicate values.
6. Repeat the query from #5 without duplicates and sort the list by guide’s last name.
7. List the first name and last name of all customers that have reservations for a trip being led by Zach Gregory.

8. List the first name, last name, phone number of all customers that either live in NJ or have a current reservation.
9. List the first name, last name, phone number of all customers that either live in NJ and have a current reservation.
10. List the name of all trips and the trip date from the reservations. Trips that do not have reservations associated with them should also be in the list but trip date will be blank. (HINT: different kind of join to get records that do not have matches in the second table!)

CUSTOMER CUSTOMER_NUM LAST_NAME FIRST_NAME ADDRESS CITY STATE POSTAL_CODE PHONE Northfold 03053 01101 06108 01854 14590 9 Old Mill Rd 2332 South St. Apt 3 Springfield 132 Main St. #1 164A South Bend Rd. Lowell 345 Lower Ave 156 Scholar St 76 Cross Rd 32 Sheep Stop St 10 Greenfield St 65 Granite St 373 Highland Ave 1282 Ocean Walk 7 Cherry Blossom St. Weymouth 18 Ark Ledge Ln 24 Stump Rd 10 Old Main St 132 South St. Apt 27 Manchester LondonderryNH Liam Arnold Sujata 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 Kasuma Goff McLean Morontoia Marchand East HartfordCT MA NY RI Kvl Wolcot Johnston Bath ose 03740 16412 04963 14592 02143 08226 02188 05148 04912 05444 Quinn SC Jean Luc Martha L1 Caron rs ones Vaccari Rom NY 112 Somerville Adam Ocean City Murakami Londonderry VT Athens Cambridge Clement Gernowski Bretton-BorakSiam Hefferson Barnett Busa Peterson Brown 121 rlau rrv Karen Becca 06824 06074 14411 06066 CT Fairfield South Windsor CT Albion Vernon 124 12 Foster St Brianne 154 Central St

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

As any of the tables doesn't have GUIDE_NUM as foreign key, it is not possible to retrive the information that is asked in bold question.The table TRIP should contain GUIDE_NUM as one of its fields.

Add a comment
Know the answer?
Add Answer to:
I am working on multi-table queries for my SQL class using a premade database, which I...
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
  • 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...

  • 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....

  • 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...

  • Partial Question 10 1/2 pts Give the SQL statement to list the trip name and state...

    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...

  • 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)...

  • SQL Queries – in this assignment you will be asked to create several SQL queries relating...

    SQL Queries – in this assignment you will be asked to create several SQL queries relating to the Sakila database that we installed in class. You may freely use DBeaver to create these queries, but I will expect your solution to show me the SQL code to answer or complete the tasks below. Write a query that produces the last name, first name, address, district, and phone number for every customer in the customer table. (You don’t need to include...

  • Please generate the queries in SQL given the following: Problem: Analyzing Santa’s Bike Service (20%) The...

    Please generate the queries in SQL given the following: Problem: Analyzing Santa’s Bike Service (20%) The Santa Bike Service provides rental bicycles in San Francisco. It distributes these bikes through several completely automated stations, each with a number of bike docks for securely parking a rental bike. Users can rent these bicycles by visiting Santa’s website, choosing their preferred station for pick-up, and paying for their rental. The website will generate a reservation code for their use. They can head...

  • Prepare and execute each of the queries listed using the "Adventureworks2012" database in SQL: Server: http://msftdbprodsamples.codeplex.com/releases/view/93587...

    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...

  • Using the database: Write SQL queries for each of the questions below. 1. Find the media...

    Using the database: Write SQL queries for each of the questions below. 1. Find the media type which has 100 or more tracks. Print the name of such media type. Number of rows returned in the result = 3 A) Find the playlists which have one or more tracks that have never been purchased in California (CA). Print the Id, and the name of such playlists. Number of rows returned in the result = 18 B) Find the customers who...

  • Hi, I'm trying to do my homework for my SQL Server class I keep getting stuck on the questions 1-...

    Hi, I'm trying to do my homework for my SQL Server class I keep getting stuck on the questions 1-5  I found out like how the format need to be I'm just stuck on implanting the code in. Auntie B's Antic ERD CUSTOMER OWNER PEOPLE PeoplelD CustomerSince CHARITY Peopleld FirstName LastName Address City State Zip Phone CellPhone EMail PeopleType CharityID Name Address City State WORKERS PeoplelD HireDate TermDate SSN ip Phone ContactID ORDERS OrderlD OrderDate CustomerlD EmployeelD DONATION DonationID DonationDate...

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