The index containing the Olympic event data is now populated with, at least what we currently consider to be, clean data. It’s in good shape to begin some analysis and in these exercises we’ll start to use queries and aggregations.
We’ll begin here by writing a few aggregations and scripted fields with some simple searches.
Write a single query to find the name of all Gymnastics events. There are less than 100 Gymnastics event types.
Write a single query to find the average weight for male and female competitors in Gymnastics events.
Write a single query to find the year that each of the 590 unique events first appeared in the Olympic Games, and which events were introduced most recently.
Write a query to return only the following fields for the 50 tallest athletes in the 2016 Rio de Janeiro Games:
The weight and height fields are in metric. Weight is in
kg and height is in
cm. Add a scripted field called
weightLbs to the previous query to return the weight in lbs. The formula for this is:
Weight * 2.2
Add a scripted field called
bmi to the previous query to return the BMI for each athlete, calculated using the following formula:
Weight / (Height in m squared)