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 1 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
CAMP_ID
CAMP_NAME
CAMP_SITES
2
Pine Grove Retreat
74
3
Eagle's Nest Camp
19
STYPE
STYPE_ID
STYPE_DESC
STYPE_ELEC
2
RV SITE PRIMITIVE
0
3
TENT SITE
1
4
TENT SITE PRIMITIVE
0
CAMSITE
SITE_ID
SITE_NAME
STYPE_ID
CAMP_ID
SITE_FRING
SITE_GRILL
2
ENC-1
2
3
0
1
3
ENC-2
2
3
1
0
4
PGR_1
1
2
0
0
5
PG-2
3
1
1
0
6
PG-3
4
1
1
1
7
PGR-2
2
2
0
0
8
ENC-3
1
3
0
0
9
PGR-3
2
2
1
0
10
PGR-4
4
2
1
1
11
PGR-5
4
2
0
1
CUSTOMER
CUS_ID
CUS_FNAME
CUS_LNAME
CUS_EMAIL
CUS_PHONE
CUS_TAG
CUS_TAGST
1
John
Smith
john@example.com
555-0110
ABC001
CA
2
Jane
Johnson
jane@example.com
555-0111
GHE2841
TX
3
Alex
Williams
alex@example.com
555-0112
AFG111
FL
4
Emma
Brown
emma@example.com
555-0113
KUG874
NY
5
Chris
Jones
chris@example.com
555-0114
OIU1258
TX
6
Olivia
Garcia
olivia@example.com
555-0115
LKK885
IL
7
Ryan
Miller
ryan@example.com
555-0116
LOY1744
TX
8
Sophia
Davis
sophia@example.com
555-0117
POO552
OK
9
Liam
Martinez
liam@example.com
555-0118
CRT258
OK
RESERVE
RES_ID
CUS_ID
SITE_ID
RES_ARRIV
RES_DEPART
1
5
8
9/4/2024
12/12/2024
2
8
5
6/22/2024
7/9/2024
3
4
10
8/27/2024
11/25/2024
4
4
2
7/25/2024
11/17/2024
5
5
2
9/10/2024
9/23/2024
6
6
9
2/11/2024
12/10/2024
7
9
5
10/29/2024
12/3/2024
8
9
4
1/8/2024
3/23/2024
9
4
8
1/17/2024
3/8/2024
10
6
7
5/17/2024
5/30/2024
When inserting these values, make sure you format the dates correctly (yyyy-mm-dd).
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 2- 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 (STYPE_ELEC >0) 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 (2024-08-01 to 2024-08-10) 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 (STYPE_ELEC greater than 0) available at each one.
List all reservations for campsites in campgrounds with more than 10 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!