-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: remove coverage, fix typos, and update solutions
- Loading branch information
Showing
7 changed files
with
47 additions
and
67 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
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
This file was deleted.
Oops, something went wrong.
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
27 changes: 27 additions & 0 deletions
27
docs/challenging-sql-problems/solutions/bronze/temperature-anomaly-detection--snowflake.sql
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 @@ | ||
```sql | ||
with temperatures as ( | ||
select | ||
site_id, | ||
reading_datetime, | ||
temperature, | ||
sum(temperature) over ( | ||
partition by site_id | ||
order by reading_datetime rows between 2 preceding and 2 following | ||
) as sum_temps | ||
from readings | ||
qualify 5 = count(*) over ( | ||
partition by site_id | ||
order by reading_datetime rows between 2 preceding and 2 following | ||
) | ||
) | ||
select | ||
* exclude (sum_temps), | ||
round((sum_temps - temperature) / 4, 4) as average_temperature, | ||
round(100 * (temperature - average_temperature) / temperature, 4) as percentage_increase | ||
from temperatures | ||
where percentage_increase > 10 | ||
order by | ||
site_id, | ||
reading_datetime | ||
``` |
35 changes: 11 additions & 24 deletions
35
docs/challenging-sql-problems/solutions/bronze/temperature-anomaly-detection--sql-server.sql
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
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