Question: This assignment has two parts. Part One involves populating the database, and Part Two will require you to answer questions using SQL Queries. Part 1
This assignment has two parts. Part One involves populating the database, and Part Two will require you to answer questions using SQL Queries.
Part Populating the Database
Now that you have created the database, you must populate it The Park has provided you with data for each table.
CAMPGRD
CAMPID
CAMPNAME
CAMPSITES
Pine Grove Retreat
Eagle's Nest Camp
STYPE
STYPEID
STYPEDESC
STYPEELEC
RV SITE PRIMITIVE
TENT SITE
TENT SITE PRIMITIVE
CAMSITE
SITEID
SITENAME
STYPEID
CAMPID
SITEFRING
SITEGRILL
ENC
ENC
PGR
PG
PG
PGR
ENC
PGR
PGR
PGR
CUSTOMER
CUSID
CUSFNAME
CUSLNAME
CUSEMAIL
CUSPHONE
CUSTAG
CUSTAGST
John
Smith
john@example.com
ABC
CA
Jane
Johnson
jane@example.com
GHE
TX
Alex
Williams
alex@example.com
AFG
FL
Emma
Brown
emma@example.com
KUG
NY
Chris
Jones
chris@example.com
OIU
TX
Olivia
Garcia
olivia@example.com
LKK
IL
Ryan
Miller
ryan@example.com
LOY
TX
Sophia
Davis
sophia@example.com
POO
OK
Liam
Martinez
liam@example.com
CRT
OK
RESERVE
RESID
CUSID
SITEID
RESARRIV
RESDEPART
When inserting these values, make sure you format the dates correctly yyyymmdd
Write insert statements to populate the tables. Work one table at a time and make sure you test each table when you have finished to ensure the data is in there correctly.
Part Queries
Answer the following questions using an SQL query. Copy your output for each into a Word document and attach the document to this assignment to turn it in
List all campgrounds and their corresponding number of campsites, ordered by the number of campsites in descending order.
Display all campgrounds that have campsites with both electricity STYPEELEC and fire rings.
Find all customers who have made a reservation, displaying their full name, email, and the number of reservations they have made.
Find all campsites that provide both a fire ring and grill, along with their campground name.
Retrieve reservations that overlap a specific date range to and display the customer name, reservation ID and reservation dates.
Display all customers who have not made any reservations.
List each campground and the total number of sites with electricity STYPEELEC greater than available at each one.
List all reservations for campsites in campgrounds with more than campsites, including the campground name, campsite name, and reservation dates.
List all site types and the average number of days reserved per site type.
Retrieve the total number of reservations made per campsite and sort the results by the highest number of reservations
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
