-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from LaunchCodeEducation/a3-9-to-5
Assignment 3: 9 to 5
- Loading branch information
Showing
5 changed files
with
164 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
+++ | ||
pre = "<b>A3: </b>" | ||
title = "9 to 5" | ||
date = 2023-05-25T12:55:09-05:00 | ||
draft = false | ||
weight = 4 | ||
+++ | ||
|
||
## Business Issue and Understanding | ||
|
||
You are working for the Bureau of Labor Statistics with the United States government and have been approached by your boss with an important meeting request. You have been asked by your supervisor to meet with Dolly Parton, whose nonprofit is looking to shed light on the state of employment in the United States. As part of the 9 to 5 project, their research is focused on production and nonsupervisory employees and how those employees fare compared to all employees in the United States. While the data the BLS collects from the CES is publicly available, Dolly Parton and her colleagues need your assistance navigating the thousands of rows in each table in `LaborStatisticsDB`. | ||
|
||
## More on the Dataset | ||
|
||
For this assignment, you will be using the Bureau of Labor Statistics (BLS) Current Employment Survey (CES) results which can be found on [Kaggle](https://www.kaggle.com/datasets/bls/employment) and are already added to `LaborStatisticsDB` for you. | ||
|
||
Here are some things you need to know about this dataset: | ||
|
||
1. The industry table contains an NAICS code. This is different from the industry code. NAICS stands for North American Industry Classification System. | ||
1. Series ID is composed of multiple different codes. CES stands for Current Employment Survey, the name of the survey which collected the data. The industry code as specified by the BLS and the data type code as specified in the datatype table. | ||
|
||
## Getting Started | ||
|
||
Fork this [GitHub repository](https://github.com/LaunchCodeEducation/nine-to-five-assignment) and clone it to your computer. | ||
|
||
## Submitting Your Work | ||
|
||
When you are finished, make sure to push your changes up to GitHub. Copy the link to your GitHub | ||
repository and paste it into the submission box in Canvas for Graded Assignment #3: 9 to 5 and click *Submit*. | ||
|
||
{{% notice blue Note "rocket" %}} | ||
|
||
The following tasks and questions in the textbook for this assignment are also located within the notebook from the above GitHub repository. You must save the answers to the questions within your notebook for grading. | ||
|
||
{{% /notice %}} | ||
|
||
{{% children %}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
+++ | ||
title = "Task 4: Subqueries, Unions, Derived Tables, Oh My!" | ||
date = 2023-05-25T12:55:09-05:00 | ||
draft = false | ||
weight = 4 | ||
+++ | ||
|
||
You can answer the following questions after [Chapter 21: SQL Part 4]({{% relref "../../../sql-part-4/_index.md" %}}). | ||
|
||
{{% notice green Question %}} | ||
|
||
Write a query that returns the `series_id`, `industry_code`, `industry_name`, and `value` from the `january_2017` table but only if that value is greater than the average value for `annual_2016` of `data_type_code` 82. | ||
|
||
{{% /notice %}} | ||
|
||
{{% notice green Question %}} | ||
|
||
Create a union table comparing average weekly earnings of production and nonsupervisory employees between `annual_2016` and `january_2017` using the data type 30. Round to the nearest penny. You should have a column for the average earnings and a column for the year, and the period. | ||
|
||
{{% /notice %}} | ||
|
||
Once you have completed all four tasks, make sure to answer the questions in the "Summarize Your Results" section before going on to [Submitting Your Work]({{% relref "../_index.md#submitting-your-work" %}}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
+++ | ||
title = "Task 1: Database Exploration" | ||
date = 2023-05-25T12:55:09-05:00 | ||
draft = false | ||
weight = 1 | ||
+++ | ||
|
||
To start with, let’s get to know the database further. You should feel comfortable doing this task after [Chapter 18: SQL Part 1]({{% relref "../../../sql-part-1/_index.md" %}}). | ||
|
||
{{% notice green Question %}} | ||
|
||
Make note of each table in the database, the columns within each table, each column’s data type, and how the tables are connected. You can write this down or draw a diagram. Whatever method helps you get an understanding of what is going on with `LaborStatisticsDB`. | ||
|
||
To add a photo, diagram or document to your file, drop the file into the folder that holds the notebook. Use the link button to the right of the `</>` symbol in the gray part of the cell to create a link. The link you are looking for is just the name of the file for your visual. | ||
|
||
{{% /notice %}} | ||
|
||
{{% notice green Question %}} | ||
|
||
What is the datatype for women employees? | ||
|
||
{{% /notice %}} | ||
|
||
{{% notice green Question %}} | ||
|
||
What is the series id for women employees in the commercial banking industry in the financial activities supersector? | ||
|
||
{{% /notice %}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
+++ | ||
title = "Task 3: Join in on the Fun" | ||
date = 2023-05-25T12:55:09-05:00 | ||
draft = false | ||
weight = 3 | ||
+++ | ||
|
||
|
||
Time to start joining! You can choose the type of join you use, just make sure to make a note in your notebook as to why you chose that join! You can answer these questions after [Chapter 20: SQL Part 3]({{% relref "../../../sql-part-3/_index.md" %}}) | ||
|
||
{{% notice green Question %}} | ||
|
||
Join `annual_2016` with series on `series_id`. We only want the data in the `annual_2016` table to be included in the result. | ||
|
||
{{% /notice %}} | ||
|
||
{{% notice green Question %}} | ||
|
||
Join series and datatype on `data_type_code`. | ||
|
||
{{% /notice %}} | ||
|
||
{{% notice green Question %}} | ||
|
||
Join series and industry on `industry_code`. | ||
|
||
{{% /notice %}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
+++ | ||
title = "Task 2: Aggregate Your Friends and Code Some SQL" | ||
date = 2023-05-25T12:55:09-05:00 | ||
draft = false | ||
weight = 2 | ||
+++ | ||
|
||
The following questions you should be able to tackle after [Chapter 19: SQL Part 2]({{% relref "../../../sql-part-2/_index.md" %}}) | ||
|
||
{{% notice green Question %}} | ||
|
||
How many employees were reported in 2016 in all industries? Round to the nearest whole number. | ||
|
||
{{% /notice %}} | ||
|
||
{{% notice green Question %}} | ||
|
||
How many women employees were reported in 2016 in all industries? Round to the nearest whole number. | ||
|
||
{{% /notice %}} | ||
|
||
{{% notice green Question %}} | ||
|
||
How many production/nonsupervisory employees were reported in 2016? Round to the nearest whole number. | ||
|
||
{{% /notice %}} | ||
|
||
{{% notice green Question %}} | ||
|
||
In January 2017, what is the average weekly hours worked by production and nonsupervisory employees across all industries? | ||
|
||
{{% /notice %}} | ||
|
||
{{% notice green Question %}} | ||
|
||
What is the total weekly payroll for production and nonsupervisory employees across all industries in January 2017? Round to the nearest penny, please. | ||
|
||
{{% /notice %}} | ||
|
||
{{% notice green Question %}} | ||
|
||
In January 2017, for which industry was the average weekly hours worked by production and nonsupervisory employees the highest? Which industry was the lowest? | ||
|
||
{{% /notice %}} | ||
|
||
{{% notice green Question %}} | ||
|
||
In January 2021, for which industry was the total weekly payroll for production and nonsupervisory employees the highest? Which industry was the lowest? | ||
|
||
{{% /notice %}} |