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
SELECT purchase_id, DATE(purchase_date, '7 days') | |
FROM purchases; | |
SELECT STRFTIME('%H', purchase_date) | |
FROM purchases; | |
SELECT date, (CAST(high AS 'REAL') + | |
CAST(low as 'REAL')) / 2.0 AS 'average' | |
FROM weather | |
; |
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
SELECT | |
artist, | |
week, | |
streams_millions, | |
streams_millions - LAG(streams_millions, 1, streams_millions) OVER ( | |
PARTITION BY artist | |
ORDER BY week | |
) AS 'streams_millions_change', | |
chart_position, | |
LAG(chart_position, 1, chart_position) OVER ( |
NewerOlder