Question: SQL outer join and nested query. a) Select the guest names and prices of the rooms they booked, if any. b) Select the guest names

SQL outer join and nested query.

a) Select the guest names and prices of the rooms they booked, if any.

b) Select the guest names and the overall prices of the rooms they booked, if any.

c) Create a new table staff with the attributes (staffNo,staffName,email,address,salary) and specify that staffNo is the primary key and staffName must be not null.

d) Insert some values into staff table as follows:

SQL outer join and nested query. a) Select the guest names and

e) Show all staff names and guest names.

f) Select the name of someone who is both a staff and a guest using the intersect keywords. Is there some issue with this?

g) Select those staffs who are not guests.

h) Select all rooms with a price below half of the more expensive room.

i) Select all the guest names who have booked a room with a price above average.

j) Select the guest names who have booked more than 3 rooms.

New Query Results Messages staffNo address 1114567 Super Man Splder Man Dron Man 8012456 New Query Results Messages staffNo address 1114567 Super Man Splder Man Dron Man 8012456

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!