Someone posted a comment but I think deleted it but they were absolutely correct. In answers.txt it asks you: Spotify Wrapped is a feature presenting Spotify users’ 100 most played songs from the past year. In 2021, Spotify Wrapped calculated an “Audio Aura” for each user, a “reading of [their] two most prominent moods as dictated by [their] top songs and artists of the year.” Suppose Spotify determines an audio aura by looking at the average energy, valence, and danceability of a person’s top 100 songs from the past year. In answers.txt, reflect on the following questions: If songs.db contains the top 100 songs of one listener from 2018, how would you characterize their audio aura? 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? Be sure to submit answers.txt along with each of your .sql files! So Answers.txt should contain answers to these two questions. For some help you might imagine things like this: Discussing audio aura we could look at things like Energy, Danceability, Tempo, and even valence. High Energy means possibly more positive High Valence Might be uplifting High Danceability Might be the same low score in these might indicate the opposite. HOWEVER, we'd be limited to only the top 100 and that may not indicate the true range or nature of listening and since music changes over time we may not have enough time to see things rise and fall. ADDITIONALLY, and perhaps the biggest thing is personal interpretation. Just because a song is low valence, energy, and danceability, does not mean that the user is not uplifted by such a song.
@@RealisticResponse Thank you. can I ask you a small thing please. It is about CS50 course. if I won't finish final project before the end of this year, what will happen?
Question 3 is really throwing me off because the way we coded it in this video gives us the right answers but shows the longest song first. Is there a way to reverse this order and still have the top 5 longest songs? The question is the top 5 longest songs in descending order. I would assume that we would need to code it to show the top 5 longest songs, shortest to longest on a table.
i am having an issue where all that happens when I run the query is the terminal shows --> and I can't clear it or back up to the original terminal sqlite prompt..... help :')
Hey! are you having trouble exiting out of the sql prompt to get back to the terminal? if so, you should type exit or quit and that should get you out of sql
@RealisticResponse none of those commands would work because it was expecting an arguement. I had to reopen a terminal and cd back into the file to restart sql to get rid of the "--->"
@@dt_does4998 i swear I've had this issue before. Shutting down the terminal and reopening is one way but I'm trying to remember if I solved it another way.... I'll have to get back to you if I remember
For Question 7, I have done it this way: SELECT AVG(energy) FROM songs ...> WHERE EXISTS ( ...> SELECT * ...> FROM artists ...> WHERE name = 'Drake' ...> ); +-------------+ | AVG(energy) | +-------------+ | 0.65906 | +-------------+ Is this wrong? My output is different to the solution.
Close; the EXISTS clause should be used to check if there are any songs by Drake, and it needs to correlate the subquery with the main query to filter only those songs. SELECT AVG(energy) AS average_energy FROM songs s WHERE EXISTS ( SELECT 1 FROM artists a WHERE a.name = 'Drake' AND a.artist_id = s.artist_id ); For a shorter version you could do this: SELECT AVG(s.energy) AS average_energy FROM songs s JOIN artists a ON s.artist_id = a.artist_id WHERE a.name = 'Drake';
If these queries return the same value then yours is working but if adding exists (as it should be) changes the return then the one with the exists function should be accurate.
hey there. This error message is far to vague for me to help. If you're executing the sql commands properly in sqlite3 then you shouldn't be having this error. BUT - if you're certain things are right you might rm the program and then re-do your wget because i suppose it's possible that the .db file was somehow corrupted.
For this one, there are several queries you CAN write on one line given that you put the right operators between tasks. It just isn't on one line because it's typically considered 'cleaner' code to do multiple line. Preference is yours.
Someone posted a comment but I think deleted it but they were absolutely correct. In answers.txt it asks you:
Spotify Wrapped is a feature presenting Spotify users’ 100 most played songs from the past year. In 2021, Spotify Wrapped calculated an “Audio Aura” for each user, a “reading of [their] two most prominent moods as dictated by [their] top songs and artists of the year.” Suppose Spotify determines an audio aura by looking at the average energy, valence, and danceability of a person’s top 100 songs from the past year. In answers.txt, reflect on the following questions:
If songs.db contains the top 100 songs of one listener from 2018, how would you characterize their audio aura?
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?
Be sure to submit answers.txt along with each of your .sql files!
So Answers.txt should contain answers to these two questions. For some help you might imagine things like this:
Discussing audio aura we could look at things like Energy, Danceability, Tempo, and even valence.
High Energy means possibly more positive
High Valence Might be uplifting
High Danceability Might be the same
low score in these might indicate the opposite.
HOWEVER, we'd be limited to only the top 100 and that may not indicate the true range or nature of listening and since music changes over time we may not have enough time to see things rise and fall. ADDITIONALLY, and perhaps the biggest thing is personal interpretation. Just because a song is low valence, energy, and danceability, does not mean that the user is not uplifted by such a song.
Bro are these the answers for answer.txt?
@@Nonsense855 users were having trouble understanding how to answer .txt so i wanted to give an example.
@@RealisticResponse yeah and that was so help full for me. Thank you so much
@memories728 my pleasure keep up the good work. Sounds like you're doing great!
@@RealisticResponse Thank you. can I ask you a small thing please. It is about CS50 course. if I won't finish final project before the end of this year, what will happen?
Thank you Mr. Devin.
Thanks for your support! Appreciate you! Keep up the good work!
15:11 My name is not "awesome" lol. However, thanks for the help and great video!
lol noted! but appreciate you all the same! Keep up the good work!
Thank you for explaining in depth!
Thank you for your support! Keep up the great work and happy to help on your journey!
How do i upload all 8 files sql files. I do one at a time and it gives error. Also doesnt let me upload all at once.
Thank you sir.
thanks coach
Rolling right along - you're likely done by now. If so, great work, if not - keep up the good work!
Question 3 is really throwing me off because the way we coded it in this video gives us the right answers but shows the longest song first. Is there a way to reverse this order and still have the top 5 longest songs? The question is the top 5 longest songs in descending order. I would assume that we would need to code it to show the top 5 longest songs, shortest to longest on a table.
You could
ORDER BY DESC
I'm on my phone but I assume that would help?
i am having an issue where all that happens when I run the query is the terminal shows --> and I can't clear it or back up to the original terminal sqlite prompt..... help :')
Hey! are you having trouble exiting out of the sql prompt to get back to the terminal? if so, you should type exit or quit and that should get you out of sql
@RealisticResponse none of those commands would work because it was expecting an arguement. I had to reopen a terminal and cd back into the file to restart sql to get rid of the "--->"
@@dt_does4998 i swear I've had this issue before. Shutting down the terminal and reopening is one way but I'm trying to remember if I solved it another way.... I'll have to get back to you if I remember
try ctrl+c
Can you please help me understand exactly what's needed for the answers.txt file . It's been 3 weeks now I'm trying to find the answers
Absolutely. Did you read my pinned comment? It explains that
Wow thanks now I have the idea whats expected
@@bhekidaweti8703 glad to hear it! Keep up the good work!
Thank you i unerstnad this lab better
Happy to help! Week 7 you're almost done keep up the good work!
For Question 7, I have done it this way:
SELECT AVG(energy) FROM songs
...> WHERE EXISTS (
...> SELECT *
...> FROM artists
...> WHERE name = 'Drake'
...> );
+-------------+
| AVG(energy) |
+-------------+
| 0.65906 |
+-------------+
Is this wrong? My output is different to the solution.
Close; the EXISTS clause should be used to check if there are any songs by Drake, and it needs to correlate the subquery with the main query to filter only those songs.
SELECT AVG(energy) AS average_energy
FROM songs s
WHERE EXISTS (
SELECT 1
FROM artists a
WHERE a.name = 'Drake'
AND a.artist_id = s.artist_id
);
For a shorter version you could do this:
SELECT AVG(s.energy) AS average_energy
FROM songs s
JOIN artists a ON s.artist_id = a.artist_id
WHERE a.name = 'Drake';
If these queries return the same value then yours is working but if adding exists (as it should be) changes the return then the one with the exists function should be accurate.
This one was the easiest I did it on my own, came here only for the answer.txt
HAHAH! think i even messed that part up but i added the pinned comment so i hope it helped! SQL is a fun one for many learners.
I am getting an error while checking ,
Not an executable object: 'SELECT 1'
hey there. This error message is far to vague for me to help. If you're executing the sql commands properly in sqlite3 then you shouldn't be having this error. BUT - if you're certain things are right you might rm the program and then re-do your wget because i suppose it's possible that the .db file was somehow corrupted.
Why not write the whole query in one line?
For this one, there are several queries you CAN write on one line given that you put the right operators between tasks. It just isn't on one line because it's typically considered 'cleaner' code to do multiple line. Preference is yours.
i came here for answer.txt i didnt understood what we have to do in there
See pinned comment :)
same here
@@vyvy3130 See pinned comment - hope that helps!