Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask DBMS Expert


Home >> DBMS

Background

You will be working with a set of tables for a hotel.

To access these tables in sql create the following synonyms:

SQL> CREATE SYNONYM GUEST FOR VBRUNO.GUEST; SQL> CREATE SYNONYM BOOKING FOR VBRUNO.BOOKING; SQL> CREATE SYNONYM ROOM FOR VBRUNO.ROOM;

Queries

You are to prepare 13 SQL query statements that will provide answers to the following 13 requests for information.

1. List all bookings (using only date_in) during June 2015 of guests that are between 30 and 50 years old. Show the full name, sex, room number and age.

2. Show the number of bookings, for each month of the 2015 calendar year.

3. Management want to know the usage of the hotel based on floors. Write a query that will show how may bookings have been made for each floor.

4. For rooms that have a linked room, show details of the room and the linked room together (hint: self join).

5. Give a breakdown of how many bookings each sex has made in the hotel - ie. How many bookings have been made by males and how many bookings were made by females.

6. List the details of rooms which have been booked more than 20 times.

7. Display the names of guests that have stayed at the hotel more than 10 times.

8. Display details of the room(s) with the most bedrooms in the hotel.

9. Display guests (if there are any) that have never made a booking.

10. The hotel wishes to analyse the origin of it's guests. Write a view that displays a summary of the number of guests that live in each distinct postcode.

11. Using the view in question 10, show the postcode that has the most guests.

12. Display a summary of the number of individual bookings made for each room. If there are any rooms that have never been booked, they should be included and shown with a count of zero.

13. Create your own query. It must include a nested query. Submit the following:
• question your query is answering
• the SQL query
• The mark for this question will depend on the complexity of the query.
• Higher marks will be given for queries that are more complex and/or innovative.
• If you do not provide a description of what question the query is answering, you will get zero for this query.

Table descriptions for the "hotel" database


GUEST


 

Name                  Type

--------------------- ------------

GUEST_NO              CHAR(8)

SURNAME               VARCHAR2(30)

GIVEN                 VARCHAR2(30)

DOB                   DATE

SEX                   CHAR(1)

HOME_PHONE            VARCHAR2(20)

WORK_PHONE            VARCHAR2(20)

FAX                   VARCHAR2(20)

ADDRESS               VARCHAR2(40)

SUBURB                VARCHAR2(40)

STATE                 VARCHAR2(40)

POSTCODE              NUMBER(4)


ROOM

 

 

Name                  Type

--------------------- ------------

ROOM_NO               CHAR(10)

FLOOR_NO              NUMBER(2)

SPA_BATH              CHAR(1)

NUM_BEDS              NUMBER(1)

PRICE                 NUMBER(10,2)

LINKED_ROOM_NO        CHAR(10)


BOOKING

 

 

Name                  Type

--------------------- -----------

BOOKING_NO            CHAR(10)

GUEST_NO              CHAR(8)

ROOM_NO               CHAR(10)

DATE_IN               DATE

DATE_OUT              DATE

DBMS, Programming

  • Category:- DBMS
  • Reference No.:- M91576512
  • Price:- $60

Priced at Now at $60, Verified Solution

Have any Question?


Related Questions in DBMS

Question create an erd for the following scenario once you

Question: Create an ERD for the following scenario. Once you submit you will get access to the correct way to create the ERD. Please watch the video and correct any errors in your submission and resubmit. A small company ...

You can work on this assignment individually or in a group

You can work on this assignment individually or in a group of 2. If you are working in a group please establish a group in Assignment 2 Group on Canvas In this assignment you are asked to explore the use of neural networ ...

Suppose that we have a table of house prices and a table of

Suppose that we have a table of house prices and a table of zip codes: • hprices(hid (PK),address,bedrooms,price,zipcode) • zipcodes(zipcode (PK),state) Write a SQL query that finds the average, maximum, and minimum pric ...

Sql query assignment -for this assignment you are to write

SQL Query Assignment - For this assignment you are to write your answers in a word document. This assignment is in three parts: Part A (reporting queries), Part B (query performance), Part C (query design). For this assi ...

A schools office of the registrar maintains data about the

A School's office of the registrar maintains data about the following entities: a) courses (including course number, title, credits, syllabus and prerequisites), b) course offerings (including course number, year, semest ...

Sqlquery 1 how many products have standard price less than

SQL Query 1. How many products have standard price less than 1000? Query 2: Display all attributes for products made of "Cherry" from Product table w/o referring to column names. Query 3: Display all product names having ...

Question lab 1 creating a database designthis assignment

Question: Lab 1: Creating a Database Design This assignment contains two (2) Sections: Database Design Diagram and Design Summary. You must submit both sections as separate files in order to complete this assignment. Not ...

Data model development and implementationpurpose of the

Data model development and implementation Purpose of the assessment (with ULO Mapping) The purpose of this assignment is to develop data models and map Database System into a standard development environment to gain unde ...

Database design and development assignment -assessment task

Database Design and Development Assignment - Assessment task - 1. Normalization a) Map the ERD, from the sample solution, into a set of relations in at least Third Normal Form (3NF). You must ensure that your relations m ...

Sql assignmentin these exercises youll enter and run your

SQL Assignment In these exercises, you'll enter and run your own SELECT statements. You will use the MyGuitarShop database for these queries. If you do not already have the MyGuitarShop database, the SQL script and the i ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As