Find Jobs
Hire Freelancers

SQL Questions, Select Statement and Table creation

$30-175 USD

Completed
Posted almost 21 years ago

$30-175 USD

Paid on delivery
Hotel Schema Hotel(hotelNo, hotelName, city) Room(roomNo, hotelNo, type, price) Booking(hotelNo, guestNo, dateFrom, dateTo, roomNo) Guest(guestNo, guestName, guestAddress) Simple Queries 5.7 List full details of all levels SELECT* FROM hotel; 5.8 List full details of all hotels in London SELECT hotelNo, hotelName FROM city; OR SELECT* FROM hotel WHERE city=’London’; 5.9 List the names and address of all guests living in London, alphabetically ordered by name. SELECT guestName, guestAddress FROM Guest WHERE London ORDERED BY guestName ASC; 5.10 List all double or family rooms with a price below $40.00 per night in ascending order of price. SELECT type, price FROM room WHERE type=’double’ OR ‘family’ AND price < 40 ORDER by price; 5.11 List the booking for which no dateTo has been specific SELECT booking FROM date to WHERE Aggregate Functions 5.12 How many hotels are there? SELECT COUNT (*) As my count FROM hotel; 5.13 What is the average price of a room SELECT room AVG (price) FROM Room Group by Price; 5.14 What is the total revenue per night from all double rooms? SELECT count (*) FROM room WHERE type=’double room’ 5.15 How many different guest have made booking for august SELECT Count (*) AS ‘different guests’ FROM booking WHERE date to = ‘August’ Subqueries and Joins 5.16 List the price and type of all rooms at the Grosvenor hotel SELECT room WHERE hotel=’Grosvenor Hotel’ ALL (SELECT room =’type’ AND ‘price’ 5.17 List all guests currently staying at the Grosvenor Hotel SELECT guestNo, guestName, guestAddress FROM Guest WHERE hotel ALL (SELECT hotel FROM Guest WHERE hotel=’Grosvenor’ 5.18 What is the total income from bookings for the Grosvenor Hotel today. SELECT hotelNo, guestNo, dateFrom, dateTo, roomNo (SELECT AVG (income) FROM booking 6.8 Create the Room, Booking, and Guests tables using the integrity enhancement features of SQL with the following constraints. (a) Type must be one of Single, Double, or Family (b) Price must be between $10.00 and $100.00 (c) RoomNo must be between 1 and 100 (d) DateFrom and dateTo must be greater than today’s date (e) The same room cannot be double-booked (f) The same guest cannot have overlapping bookings. ## Deliverables 1) The first assignment have to do with using SQL SELECT statement...Are the answers, I provided correct..If not, can you show me the correct statement and where the mistakes occured 2) Second Questions type has to do with creating a tables(6.8), I have no clue ## Platform Windows
Project ID: 2951520

About the project

34 proposals
Remote project
Active 21 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
See private message.
$12 USD in 1 day
4.9 (10 reviews)
3.8
3.8
34 freelancers are bidding on average $62 USD for this job
User Avatar
See private message.
$12.75 USD in 1 day
4.7 (208 reviews)
6.8
6.8
User Avatar
See private message.
$123.25 USD in 1 day
5.0 (33 reviews)
6.1
6.1
User Avatar
See private message.
$21.25 USD in 1 day
4.9 (215 reviews)
5.9
5.9
User Avatar
See private message.
$42.50 USD in 1 day
4.9 (67 reviews)
6.0
6.0
User Avatar
See private message.
$21.25 USD in 1 day
5.0 (41 reviews)
5.4
5.4
User Avatar
See private message.
$18.70 USD in 1 day
4.9 (150 reviews)
5.6
5.6
User Avatar
See private message.
$8.50 USD in 1 day
5.0 (89 reviews)
5.7
5.7
User Avatar
See private message.
$85 USD in 1 day
4.9 (14 reviews)
5.0
5.0
User Avatar
See private message.
$127.50 USD in 1 day
4.9 (12 reviews)
4.8
4.8
User Avatar
See private message.
$148.75 USD in 1 day
4.9 (19 reviews)
5.0
5.0
User Avatar
See private message.
$68 USD in 1 day
4.6 (34 reviews)
5.3
5.3
User Avatar
See private message.
$42.50 USD in 1 day
5.0 (16 reviews)
4.6
4.6
User Avatar
See private message.
$34 USD in 1 day
4.9 (13 reviews)
4.8
4.8
User Avatar
See private message.
$85 USD in 1 day
4.9 (31 reviews)
4.8
4.8
User Avatar
See private message.
$63.75 USD in 1 day
5.0 (27 reviews)
4.3
4.3
User Avatar
See private message.
$25.50 USD in 1 day
5.0 (27 reviews)
4.1
4.1
User Avatar
See private message.
$127.50 USD in 1 day
4.1 (52 reviews)
5.0
5.0
User Avatar
See private message.
$34 USD in 1 day
4.8 (34 reviews)
4.4
4.4
User Avatar
See private message.
$34 USD in 1 day
5.0 (5 reviews)
2.6
2.6
User Avatar
See private message.
$42.50 USD in 1 day
5.0 (14 reviews)
2.4
2.4

About the client

Flag of UNITED STATES
United States
5.0
12
Member since Jul 8, 2003

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.