Skip to content

Commit fa83d56

Browse files
committed
Upload 174
1 parent b704025 commit fa83d56

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- markdownlint-disable MD041 -->
22
[![eevveerryyddaayy release](https://img.shields.io/badge/eevveerryyddaayy-v1.3.0-blue.svg)](https://github.com/ggeerraarrdd/eevveerryyddaayy/)
3-
[![Solved](https://img.shields.io/badge/solved-173-green.svg)](#index)
3+
[![Solved](https://img.shields.io/badge/solved-174-green.svg)](#index)
44
<!-- markdownlint-enable MD041 -->
55

66
# SQL Everyday
@@ -207,6 +207,7 @@ Because this project necessitated a framework to enable consistent daily practic
207207
| 171 | [Total Traveled Distance](https://leetcode.com/problems/total-traveled-distance/description/) | [Solution](solutions/171_total_traveled_distance.md) | LeetCode | Easy | |
208208
| 172 | [Create a Session Bar Chart](https://leetcode.com/problems/create-a-session-bar-chart/description/) | [Solution](solutions/172_create_a_session_bar_chart.md) | LeetCode | Easy | Histogram bins w/ `UNION`, `CASE` |
209209
| 173 | [Customers Who Bought Products A and B but Not C](https://leetcode.com/problems/customers-who-bought-products-a-and-b-but-not-c/description/) | [Solution](solutions/173_customers_who_bought_products_a_and_b_but_not_c.md) | LeetCode | Medium | `STRING_AGG` |
210+
| 174 | [Highest Salaries Difference](https://leetcode.com/problems/highest-salaries-difference/description/) | [Solution](solutions/174_highest_salaries_difference.md) | LeetCode | Easy | |
210211
<!-- Index End - WARNING: Do not delete or modify this markdown comment. -->
211212
<!--- cSpell:enable --->
212213

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# SQL Everyday \#174
2+
3+
## Highest Salaries Difference
4+
5+
Site: LeetCode\
6+
Difficulty per Site: Easy
7+
8+
## Problem
9+
10+
Write a solution to calculate the difference between the *highest* salaries in the *marketing* and *engineering* `department`. Output the absolute difference in salaries. [[Full Description](https://leetcode.com/problems/highest-salaries-difference/description/)]
11+
12+
## Submitted Solution
13+
14+
```sql
15+
-- Submitted Solution
16+
WITH cte AS (
17+
SELECT
18+
MAX(salary) FILTER (WHERE department = 'Engineering') AS engineering_sal
19+
,MAX(salary) FILTER (WHERE department = 'Marketing') AS marketing_sal
20+
FROM Salaries
21+
)
22+
SELECT
23+
ABS(engineering_sal - marketing_sal) AS salary_difference
24+
FROM
25+
```
26+
27+
## Site Solution
28+
29+
```sql
30+
-- LeetCode Solution
31+
-- None
32+
```
33+
34+
## Notes
35+
36+
TBD
37+
38+
## NB
39+
40+
TBD
41+
42+
Go to [Index](../?tab=readme-ov-file#index)\
43+
Go to [Overview](../?tab=readme-ov-file)

0 commit comments

Comments
 (0)