11 , write a query that display the names of of guest who have stayed at the Bar
ID: 3888793 • Letter: 1
Question
11 , write a query that display the names of of guest who have stayed at the Bar Harbor Hotel. Use this query in another query to display a list of names of guests who have not stayed at the Bar Harbor Hotel. You can using the except operator or by using a nested query in the where clause with the not in operator. Your first query should produce a table with the following columns and headers: Guests who have stayed at Bar Harbor Hotel Your second query should produce a table with the following columns and headers Guests who have not stayed at Bar Harbor HotelExplanation / Answer
select fname||' '||lname as "Guest who have stayed in Bar Harbour Hotel"
from guest g, hotel h, bookings b
where g.gig = b.gid
and b.hid = h.hid
and h.hotelname = 'Bar Harbour Hotel;
Second Query:
select fname||' '||lname as "Guest who have stayed in Bar Harbour Hotel"
from guest g, hotel h, bookings b
where g.gig = b.gid
and b.hid = h.hid
and h.hotelname <> 'Bar Harbour Hotel;
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.