Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Inference Control In Statistical Databases From Theory To Practice Lncs 2316

Authors: Josep Domingo-Ferrer

2002nd Edition

3540436146, 978-3540436140

More Books

Students also viewed these Databases questions

Question

Example. Evaluate 5n+7 lim 7-00 3n-5

Answered: 1 week ago

Question

Strong analytical, communication, and problem-solving skills

Answered: 1 week ago