Question

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-5Y Trip X Reservation X GuideNum - LastName # AM01 Abrams + BR01 Boyers + DH01 Devon + GZ01 Gregory + KS01 Kiley + KS02 KellyBRE Click to Add Trip X Reservation X Customer X Trip Guides X Guide x ReservationID - Tripid TripDate NumPersons - Trip PricClick to Add + + + + 25 + + 8 LO + co + 6 + + + + + + + Trip X Reservation X Customer x Trip Guides X Guide X TriplD TripNameTripGuides X Guide x Trip X Reservation X Customer X TriplD - GuideNum - Click to Add 19 DH01 20 SLO1 21 AM01 22 UGO1 23 DH01

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

Answer)
SQL statement for listing the reservation details along with First and Last name :

select Customer.FirstName, Customer.LastName, Reservation.ReservationID, Reservation.TripID, Reservation.TripDate
from Customer left outer join Reservation
on Customer.CustomerNum = Reservation.CustomerNum;

Here we are using left outer join such that the Reservation details will get printed null if they are not there for the customers.

**Please Hit Like if you appreciate my answer. For further doubts on the question or answer please drop a comment, I'll be happy to help. Thanks for posting.**

Add a comment
Know the answer?
Add Answer to:
Need SQL statement: List the First and Last name of All Customers and whether or not...
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
  • 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)...

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

  • SQL - create statement for query For each patient, display his or her last name, first...

    SQL - create statement for query For each patient, display his or her last name, first name, and the name of his or her doctor. For each pediatrics patient, display his or her ID and his or her doctor's ID and name. For each doctor, display the name and the name of the doctor's supervisor in alphabetic order of supervisor's name. Include column aliases for clarity. Note: Check for accuracy. For each doctor in one of the two areas entered...

  • Answer using SQL statements 1)All information about rental with longest rental period. Rental period in days...

    Answer using SQL statements 1)All information about rental with longest rental period. Rental period in days must appear. 2)How much money earned from rental by car manufacturer’s country every year. 3)Show 20% of our best customers by total income. 4)Show customers who used our rental 2 or more times and customer’s average money spending less than average rental price; 5)Show customer count by each state (for state show 2 letters abbreviation). Results sort by customer count descending order then by...

  • I need the SQL code to accomplish the following: Provide a list of orders that were...

    I need the SQL code to accomplish the following: Provide a list of orders that were created in January 2013.   Be sure to show the order number, date, employee name who took the order, and customer name who created the order. For all of the orders for 17” monitors in 2013, provide a list that shows the order number, date, and the quantity. here is the database CREATE DATABASE OrderEntryBMIS325 GO USE OrderEntryBMIS325 GO CREATE TABLE Customer ( CustNo CHAR(8),...

  • The Language Is SQL The language is SQL 13- List full details of agents with first...

    The Language Is SQL The language is SQL 13- List full details of agents with first names having exactly three or four letters sorted by the state attribute. 14- List the first name, the last name, the address, the city, the state, the branch number, and the email of agents working in the branch 8005 and having email addresses from yahoo.com. 15-List the first name, the last name, the address, the city, the state, the branch number, and the email...

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