TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Nilesh Sanyal
NA
187
58.5k
SQL Problem
Aug 4 2013 5:21 AM
Can anyone please solve the following problem......
Consider 3 tables
HOTEL
(
Hotel_No
,Name,Address)
ROOM
(
Room_No
,Hotel_No,Type,Charge)
BOOKING
(
Hotel_No,Guest_No,Date_From
,Date_To,Room_No)
GUEST
(
Guest_No
,Name,Address)
Note
:Underlined fields denote the primary key of the respective table
Queries
1)List the details of all rooms at Taj hotel, including the name of the guest staying in the room, if the room is occupied.
2)What is total income from bookings for the Taj hotel today?
3)List the unoccupied rooms of the Taj hotel
4)What is lost income from unoccupied rooms of Taj hotel?
5)What is lost income from unoccupied rooms at each hotel today?
6)What is most commonly booked room type for each hotel in Delhi?
Reply
Answers (
5
)
Nested Queries
Uses of HAVING Clause