Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

create table Clients ( client_nr int (10), client_name varchar (40), client_orgName varchar (50), client_type varchar(50), client_contactNo varchar (15), client_town varchar(20), client_state varchar(20), primary key (client_nr)

create table Clients (

client_nr int (10), client_name varchar (40), client_orgName varchar (50), client_type varchar(50), client_contactNo varchar (15), client_town varchar(20), client_state varchar(20), primary key (client_nr) );

create table Accommodation ( accommodation_nr int (10), accommodation_name varchar (50), accomodation_type varchar (40), accommodation_rating varchar(10), room_size varchar(30), number_of_room int (2), room_occupacy int (40), bed_type varchar(30), bed_quantiy int(2), bathroom_quantity int(2), room_price float(5,2), primary key (accommodation_nr) );

create table Staff ( staff_nr int (10), staff_name varchar (20), staff_contact varchar(15), staff_contractDetails varchar (20), primary key (staff_nr) );

create table Equipment ( equipment_nr int(10), equipment_type varchar(20), equipment_desc varchar(100), equipment_price float(5,2), primary key (equipment_nr) );

create table Center ( center_nr int (10), center_name varchar(20), center_town varchar(20), center_state varchar(20), primary key (center_nr) );

create table Indoor ( indoor_nr int (10), indoor_type varchar (40), indoor_price float(5,2), equipment_nr int(10), center_nr int (10), primary key (indoor_nr), foreign key (equipment_nr) references Equipment(equipment_nr), foreign key (center_nr) references Center(center_nr) );

create table Outdoor ( outdoor_nr int (10), outdoor_type varchar (40), outdoor_price float(5,2), equipment_nr int(10), staff_nr int (10), center_nr int (10), primary key (outdoor_nr), foreign key (staff_nr) references Staff (staff_nr), foreign key (equipment_nr) references Equipment(equipment_nr), foreign key (center_nr) references Center(center_nr) );

create table Payment ( payment_nr int (10), payment_date date, payment_status varchar(50), primary key (payment_nr) );

create table Booking ( booking_nr int (10), client_nr int (10), center_nr int(10), center_qty int(10), number_of_people int (100), booking_date date, booking_sdate date, accommodation_nr int (10), accommodation_qty int(10), addtiotional_requirement varchar(100), payment_nr int(10), primary key (booking_nr), foreign key (client_nr) references Clients (client_nr), foreign key (center_nr) references Center(center_nr), foreign key (accommodation_nr) references Accommodation (accommodation_nr), foreign key (payment_nr) references Payment(payment_nr) );

SQL Queries:

a. Retrieve the information schools that request facilities services more than 3 times in the same month and year.

b. Provide a list of school that have the most service transaction (service transaction means they have booked many facilities / services using this system) by state or Town.

c. Provide a list of business clients, school and Youth group - representative (name & contact numbers).

d. Compute raw income made for the year 2016.

e. Compute an increase of 5% on booking charges for all the facilities. Upon having the increased price now compute the raw income that would be been achieved in 2016 using the new price.

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

Datacasting How To Stream Databases Over The Internet

Authors: Jessica Keyes

1st Edition

007034678X, 978-0070346789

More Books

Students also viewed these Databases questions