From efb38ef47abb70ba622b67b16d41fdd13a34926d Mon Sep 17 00:00:00 2001 From: bot50 Date: Wed, 27 Mar 2024 11:01:57 +0000 Subject: [PATCH] kukemuna-cs50/problems/2024/x/songs@20240327T110157.414361375Z --- 1.sql | 2 ++ 2.sql | 3 +++ 3.sql | 4 ++++ 4.sql | 3 +++ 5.sql | 2 ++ 6.sql | 8 ++++++++ 7.sql | 4 ++++ 8.sql | 3 +++ answers.txt | 5 +++++ 9 files changed, 34 insertions(+) create mode 100644 1.sql create mode 100644 2.sql create mode 100644 3.sql create mode 100644 4.sql create mode 100644 5.sql create mode 100644 6.sql create mode 100644 7.sql create mode 100644 8.sql create mode 100644 answers.txt diff --git a/1.sql b/1.sql new file mode 100644 index 0000000..c1e8cdc --- /dev/null +++ b/1.sql @@ -0,0 +1,2 @@ +SELECT name +FROM songs; diff --git a/2.sql b/2.sql new file mode 100644 index 0000000..dc30a69 --- /dev/null +++ b/2.sql @@ -0,0 +1,3 @@ +SELECT name +FROM songs +ORDER BY tempo; diff --git a/3.sql b/3.sql new file mode 100644 index 0000000..43a909c --- /dev/null +++ b/3.sql @@ -0,0 +1,4 @@ +SELECT name +FROM songs +ORDER BY duration_ms DESC +LIMIT 5; diff --git a/4.sql b/4.sql new file mode 100644 index 0000000..8d22b97 --- /dev/null +++ b/4.sql @@ -0,0 +1,3 @@ +SELECT name +FROM songs +WHERE danceability > 0.75 AND energy > 0.75 AND valence > 0.75; diff --git a/5.sql b/5.sql new file mode 100644 index 0000000..27e7560 --- /dev/null +++ b/5.sql @@ -0,0 +1,2 @@ +SELECT AVG(energy) +FROM songs; diff --git a/6.sql b/6.sql new file mode 100644 index 0000000..9ebc7df --- /dev/null +++ b/6.sql @@ -0,0 +1,8 @@ +SELECT name +FROM songs +WHERE artist_id = +( + SELECT id + FROM artists + WHERE name = 'Post Malone' +); diff --git a/7.sql b/7.sql new file mode 100644 index 0000000..620d413 --- /dev/null +++ b/7.sql @@ -0,0 +1,4 @@ +SELECT AVG(energy) +FROM songs +JOIN artists ON songs.artist_id = artists.id +WHERE artists.name = 'Drake'; diff --git a/8.sql b/8.sql new file mode 100644 index 0000000..973f84d --- /dev/null +++ b/8.sql @@ -0,0 +1,3 @@ +SELECT name +FROM songs +WHERE name LIKE '%feat.%'; diff --git a/answers.txt b/answers.txt new file mode 100644 index 0000000..cf19a4f --- /dev/null +++ b/answers.txt @@ -0,0 +1,5 @@ +¤ As per "https://newsroom.spotify.com/2021-12-01/learn-more-about-the-audio-aura-in-your-spotify-2021-wrapped-with-aura-reader-mystic-michaela/", givern person's "aura" seems to be either "orage" +or "purple" based on above average (middle of the scale) energy and danceability together with high tempo. + +¤ With a list of predefined "auras" with their description and drawn graphs of parameters from songs.db one can approximate a possible "aura". But this problem is way too abstract (for me) to +comprehend, thus I cannot propose any alorithm to calculate said "aura".