1

The goal is to write several SQL queries that will answer questions over the database used...

Question

The goal is to write several SQL queries that will answer questions over the database used...

The goal is to 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 California’s 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)

The database tables have the following semantics:

• PEAK gives information about the mountain peaks that the SPCC is interested in. 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.

• 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 question.

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

The easiest way to get started with this assignment is to use an online SQLite tool. For example, https://sqliteonline.com/. In this tool, you can load the database and perform your queries.

Here is the data base file to upload to the website

https://files.fm/u/pbfqg3rd

Answers

Hi,

This can be solved by firstly calculating the count of number of trips for both men and women and then taking the average of that value.

SELECT AVG(CNT) FROM(
SELECT SELECT SEX,COUNT(*) AS CNT FROM CLIMBER C
INNER JOIN PARTICIPATED P
ON C.NAME=P.NAME
INNER JOIN CLIMBED CL
ON P.TRIP_ID=CL.TRIP_ID
GROUP BY SEX);


Similar Solved Questions

1 answers
In September 2007, 26-year-old Kerrie Wooltorton ingested a lethal dose of antifreeze. Although her intent was...
In September 2007, 26-year-old Kerrie Wooltorton ingested a lethal dose of antifreeze. Although her intent was to commit suicide, she called an ambulance and was rushed to the hospital. In the previous 12-month period, Wooltorton had attempted suicide several times by ingesting antifreeze but still ...
1 answers
What are the changes that occur in the brain as a result of puberty specifically in...
what are the changes that occur in the brain as a result of puberty specifically in the: limbic system, pre-frontal cortex, amygdala, dopamine, and biorhythms?...
1 answers
Presented is the adjusted trial balance of Scott Butler Corporation at December 31, 2020. Debit Credit...
Presented is the adjusted trial balance of Scott Butler Corporation at December 31, 2020. Debit Credit Cash $    197,000 Trading Debt Securities (fair value, $153,000) 145,000 Fair Value Adjustment – Trading Debt Securities 8,000 Accounts Rece...
1 answers
Book Show Me How Calculator Adjustment for prepaid expense Instructions Chart of Accounts Journal Instructions The...
Book Show Me How Calculator Adjustment for prepaid expense Instructions Chart of Accounts Journal Instructions The prepaid insurance account had a beginning balance of $11,500 and was debited for $18,000 of premiums paid during the year, Journalize the adjusting entry required at the end of the year...
1 answers
Problem 5-8 Yield to Maturity and Call with Semiannual Payments Thatcher Corporation's bonds will mature in...
Problem 5-8 Yield to Maturity and Call with Semiannual Payments Thatcher Corporation's bonds will mature in 15 years. The bonds have a face value of $1,000 and an 7.5% coupon rate, paid semiannually. The price of the bonds is $900. The bonds are callable in 5 years at a call price of $1,050. Rou...
1 answers
Consider a sample of i.i.d. random variables X1,..., X and assume their common density is given...
Consider a sample of i.i.d. random variables X1,..., X and assume their common density is given by fo(a) = exp (3) 1(220), where 8 >0 is an unknown parameter Maximum Likelihood Estimator Compute the maximum likelihood estimator Ô of 0. (Enter barX_n for Xn and bar(X_n^2) for X.)...
1 answers
You bought a house for $270,000, paying $50,000 down and taking out a loan for the...
You bought a house for $270,000, paying $50,000 down and taking out a loan for the balance, at a fixed 3.5% annual rate for 30 years. What will be your monthly mortgage payment (to the nearest dollar)? A) $735 B) $898 C) $988 D) $1,176...
1 answers
Express the strength of a solution both as a ratio and as a percentage if 2...
Express the strength of a solution both as a ratio and as a percentage if 2 L of the solution contains 400 mg of solute....
1 answers
Rendezvous, Inc. has 10,000 shares of 5%, $100 par value, noncumulative preferred stock and 20,000 shares...
Rendezvous, Inc. has 10,000 shares of 5%, $100 par value, noncumulative preferred stock and 20,000 shares of $1 par value common stock outstanding at December 31, 2020. There were no dividends declared in 2019. The board of directors declares and pays a $110,000 dividend in 2020. What is the amount ...
1 answers
0 (0) Thu 10:23 AM Nabil El Achraoul Q O Do Homework - Zouheir El Achraoui...
0 (0) Thu 10:23 AM Nabil El Achraoul Q O Do Homework - Zouheir El Achraoui mathxl.com/Student/PlayerHomework.aspx?homeworkld=553423251&questionid=1&flushed-fals... FINC 235 Financial Management DFC Homework: Chapter 5 Homework Part 1 Save Score: 0 of 1 pt 2 of 5 (0 complete) HW Score: 0%, 0 ...
1 answers
Please show working. Thanks A window glass has dimensions, 1.18 m high, 2.19 m wide and...
Please show working. Thanks A window glass has dimensions, 1.18 m high, 2.19 m wide and 1.448 cm thick, with a thermal conductivity of 0.81 Wm^-10C^-1. The outside-surface temperature is 32 degreeC and the inside-surface temperature is 24 degreeC Calculate the rate of heat transfer, in watts, throug...
1 answers
Juan invests 30,000 at an annual rate of 2%. How many years (approximately the closest) will...
Juan invests 30,000 at an annual rate of 2%. How many years (approximately the closest) will be spent to double his investment if the interest is compounded monthly, then continuously ?; Compare results....
1 answers
26. After a ship arrives in a simulation model, you want to determine the type of...
26. After a ship arrives in a simulation model, you want to determine the type of ship based on a discrete probability distribution. The probability mass function and cumulative distribution function are given in the table below. px)Fx) 0.180 .180 Panamax Max PostPanamaxI0.247 Post Panamax II 427 0....
1 answers
Can someone help pleass... thank u Stubborn Grandma Mimi -- Part 1: Mimi's Decline The mountain...
can someone help pleass... thank u Stubborn Grandma Mimi -- Part 1: Mimi's Decline The mountain wind rattled the window of the small cabin as Drew sifted through the papers covering the kitchen table, looking for his physiology notes. Instead of his blue notebook, a pink sheet of paper fr...
1 answers
Least squares to fit a straight line Pre-lab A-3 Least Squares Fit to a Straight Line...
least squares to fit a straight line Pre-lab A-3 Least Squares Fit to a Straight Line Read lab A-3: Least squares fit to a straight line. A set of data is given in the following table and plotted on the right: x(s) y (m) Lab 3 exercise 27 Use the graph on the right to calculate the slope and the ...
1 answers
Write a C programming code for the following prompt. please use stucture concept and test if...
write a C programming code for the following prompt. please use stucture concept and test if the code works perfectly. Project Description: In this project, you will write a program to calculate the roots of a quadratic equation. Structure concepts will be used in this project. Your program will ...

-- 0.011097--