Skip to content

Commit

Permalink
sol: lab7/songs
Browse files Browse the repository at this point in the history
  • Loading branch information
jfvillablanca committed Nov 11, 2023
1 parent 025c218 commit b034f33
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lab7/songs/1.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SELECT
name
FROM
songs;
6 changes: 6 additions & 0 deletions lab7/songs/2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SELECT
name
FROM
songs
ORDER BY
tempo;
8 changes: 8 additions & 0 deletions lab7/songs/3.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
SELECT
name
FROM
songs
ORDER BY
duration_ms DESC
LIMIT
5;
8 changes: 8 additions & 0 deletions lab7/songs/4.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
SELECT
name
FROM
songs
WHERE
danceability > 0.75
AND energy > 0.75
AND valence > 0.75;
4 changes: 4 additions & 0 deletions lab7/songs/5.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SELECT
AVG(energy)
FROM
songs;
7 changes: 7 additions & 0 deletions lab7/songs/6.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SELECT
songs.name
FROM
songs
JOIN artists ON artists.id = songs.artist_id
WHERE
artists.name = 'Post Malone';
7 changes: 7 additions & 0 deletions lab7/songs/7.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SELECT
AVG(songs.energy)
FROM
songs
JOIN artists ON songs.artist_id = artists.id
WHERE
artists.name = 'Drake';
6 changes: 6 additions & 0 deletions lab7/songs/8.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SELECT
songs.name
FROM
songs
WHERE
songs.name LIKE '%feat%';
1 change: 1 addition & 0 deletions lab7/songs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://cs50.harvard.edu/x/2023/labs/7/
5 changes: 5 additions & 0 deletions lab7/songs/answers.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
If songs.db contains the top 100 songs of one listener from 2018, how would you characterize their audio aura?
- With a 0.65 energy, 0.48 valence, 0.71 in danceability, and with the top 5 songs and artists that are part of the popular music of 2018, I'd characterize the listener's audio aura as BASIC.

Hypothesize about why the way you’ve calculated this aura might not be very representative of the listener. What better ways of calculating this aura would you propose?
- Maybe we can include the average tempo as a feature of the characterization of a listener but I still find that to be too raw and would probably require more refinement.

0 comments on commit b034f33

Please sign in to comment.