Skip to content

djeong95/SQL_learning

Repository files navigation

SQL Learning

The SQL learning materials utilized in this repository have been sourced from Data With Danny, an online website for mastering SQL basics and applying them in various case studies.

While there is a multitude of online resources available to learn SQL fundamentals, many of them fall short of offering case studies that delve into real business requirements and demonstrate how SQL can fulfill these data needs for corporations.

Below are summaries of what I learned and the type of analytical questions I answered via case studies.

Data Exploration

  • Order By
  • Counts and Distinct Valves
  • Identify Duplicate Records
  • Summary Statistics
  • Distribution Functions
  • Health Analytics Mini Case Study

Marketing Analytics Case Study

  • Joins (LEFT, INNER, LEFT-SEMI JOIN, ANTI-JOIN)
  • Window functions (ROW_NUMBER(), RANK(), DENSE_RANK(), PERCENT_RANK(), CUME_DIST()) LAG & LEAD & COALESCE
  • RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
    • RANGE, ROWS, GROUPS
  • Recursive CTEs

People Analytics Case Study

Here are the types of questions and complexity that we will address in our case study:

Current Analysis

  1. What is the full name of the employee with the highest salary?
  2. How many current employees have the equal longest time in their current positions?
  3. Which department has the highest number of current employees?
  4. What is the largest difference between minimimum and maximum salary values for all current employees?
  5. How many male employees are above the average salary value for the Production department?
  6. Which title has the highest average salary for male employees?
  7. Which department has the highest average salary for female employees?
  8. Which department has the most female employees?
  9. What is the gender ratio in the department which has the highest average male salary and what is the average male salary value for that department?
  10. HR Analytica want to change the average salary increase percentage value to 2 decimal places - what will the new value be for males for the company level dashboard?

Employee Churn

HR Analytica want to perform an employee churn analysis and wants you to help them answer the following questions using your generated views:

  1. How many employees have left the company?
  2. What percentage of churn employees were male?
  3. Which title had the most churn?
  4. Which department had the most churn?
  5. Which year had the most churn?
  6. What was the average salary for each employee who has left the company?
  7. What was the median total company tenure for each churn employee just bfore they left?
  8. On average, how many different titles did each churn employee hold?
  9. What was the average last pay increase for churn employees?
  10. What proportion of churn employees had a pay decrease event in their last 5 events?
  11. How many current employees have the equal longest overall time in their current positions (not in years)?

Management Analysis

The HR Analytica team also want to perform a management analysis and need answers for these questions:

  1. How many managers are there currently in the company?
  2. How many employees have ever been a manager?
  3. On average - how long did it take for an employee to first become a manager from their the date they were originally hired?
  4. What was the most common titles that managers had just before before they became a manager?
  5. On average - how much more do current managers make on average compared to all other employees?

Case Study #1 - Danny's Diner

TBD

Case Study #2 - Pizza Runner

TBD

Case Study #3 - Foodie-Fi

TBD

Case Study #4 - Data Bank

TBD

Case Study #5 - Data Mart

TBD

Case Study #6 - Clique Bait

TBD

Case Study #7 - Balanced Tree

TBD

Case Study #8 - Fresh Segments

TBD

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published