Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write several SQL queries that will answer questions over the database used by the imaginary Sierra Peak Climbing Club (SPCC), an organization whose members climb

Write several SQL queries that will answer questions over the database used by the imaginary Sierra Peak Climbing Club (SPCC), an organization whose members climb the mountain peaks of Californias Sierra Nevada mountain range. The database maintained by the SPCC has four tables:

PEAK (NAME, ELEV, DIFF, MAP, REGION)

CLIMBER (NAME, SEX)

PARTICIPATED (TRIP_ID, NAME)

CLIMBED (TRIP_ID, PEAK, WHEN_CLIMBED)

This table lists the name of each peak, its elevation, its difficulty level for climbers (on a scale of 1 to 5), the map that it is located on, and the region of the Sierra Nevada that it is located in. The database tables have the following semantics:

PEAK gives information about the mountain peaks that the SPCC is interested in.

CLIMBER lists the SPCC membership, and gives their name and gender.

PARTICPATED gives the set of climbers who participated in each of the various SPCC-sponsored climbing trips. The number of participants in each trip varies.

CLIMBED tells which peaks were climbed on each of the SPCC-sponsored climbing trips, along with the date that each peak was climbed.

write SQL queries that answer the following questions, sorted in general on order of difficulty from easiest to most difficult.

For following questions, you must also provide the extended relational algebra expression tree as part of the answer:

- How many peaks remain unclimbed in each region?

- On which trips did the total elevation gained by all participants exceed 500,000 feet?

- Compute the average number of peaks scaled by the men in the club and by the women in the club.

- Which people have climbed every single peak that Maria has climbed?

- Which region has had the highest fraction of its peaks climbed, and what is that fraction?

- Which pair of climbers have climbed the most peaks together, and how many peaks is that?

- Who has climbed more than 20 peaks in some 60 day span?

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

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions

Question

7. How might you go about testing these assumptions?

Answered: 1 week ago

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago