this is the nav!
Workspace
Abhishek Raj Pandey/

# Duplicate of DataCamp Live Training - Analyzing NASA Planetary Exploration Budgets in SQL (student)

0
Beta

## .mfe-app-workspace-kj242g{position:absolute;top:-8px;}.mfe-app-workspace-11ezf91{display:inline-block;}.mfe-app-workspace-11ezf91:hover .Anchor__copyLink{visibility:visible;}Analyzing NASA Planetary Exploration Budgets in SQL

For much of the last 60 years, NASA has been at the forefront of exploring our solar system. In this live training, we'll see how much money they spent to do this.

For expensive science projects, not least those funded with public money, the price of conducting research is a huge consideration, so budgeting is important.

Here, we'll use a cleaned up version of the public dataset provided by the The Planetary Society.

### Task 1: What is the total cost of all planetary missions over all time?

A good first step in any budgetary analysis is to determine how much money has been spent in total.

For this, we need the `mission_budgets` table. Each row represents the cost in a fiscal year, of one aspect of a project for one mission. There are 5 columns:

• `mission`: The name of the mission.
• `fiscal_year`: The year, for accounting purposes.
• `cost_type`: Fine-grained aspect of the project, e.g., "Spacecraft".
• `cost_group`: Broader aspect of the project, e.g., "Development/Implementation".
• `cost_MUSD`: Cost in million US dollars.

#### Instructions

• Calculate the total cost of all missions over all time as `total_cost_MUSD`.
Unknown integration
DataFrameavailable as
df
variable
```.mfe-app-workspace-11z5vno{font-family:JetBrainsMonoNL,Menlo,Monaco,'Courier New',monospace;font-size:13px;line-height:20px;}```-- Calculate the total cost of all missions over all time
``````
This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.

Due to inflation, costs in the 1960s are not directly equivalent to those in the 2020s. We need to adjust for inflation in order to get a cost in current currency.

Correction factors are available in the `inflation` table. Each row represents an inflation adjustment for a time period relative to today. ther are two columns.

• `fiscal_year`: The year, for accounting purposes. Note that in 1976, inflation was especially high, so two values are provided. "1976" represents the start of the year, and "1976TQ" represents the third quarter onwards.
• `inflation_adjustment`: Multiply currency values from the past time by this number to get current currency values.

#### Instructions

• Join the `mission_budgets` table to the `inflation` table on the fiscal year.
• Calculate the total cost of all missions over all time, adjusted for inflation as `adjusted_total_cost_MUSD`.
Unknown integration
DataFrameavailable as
df
variable
``````-- Calculate the total cost of all missions over all time, adjusted for inflation
``````
This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.

### Task 3: Which was the most expensive mission?

The biggest, grandest missions make headlines, but at some point, someone always asks questions about how much things cost, and the biggest budgets are the first place people look for cost savings. Knowing which is the most expensive project is an essential task for anyone responsible for a budget.

#### Instructions

• Group the budgets by mission, and calculate the total cost for each mission.
• Get the mission with the highest total cost.
Unknown integration
DataFrameavailable as
df
variable
``````-- Get the mission with the highest total cost
``````
This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.

• AI Chat
• Code