
In this article, you'll understand the various roles of a Spotify data scientist. If you are one of those technology enthusiasts who wish to work for Spotify as a data scientist, then read this blog till the end. Among those roles, the role of the data scientist is grabbing the attention of today's digitally enthusiastic generation. Being in the tech domain, the company offers multiple roles. Almost everyone is aware of the esteemed music streaming platform and its extensive reach all across the globe. Though COUNT(*) works in this instance because all rows in the table are unique, specifying the artist column helps with readability and processing time: SELECT artist, COUNT(artist) AS count_20yrs FROM billboard_top_100_year_end WHERE DATE_PART('year', CURRENT_DATE) - YEAR <= 20 GROUP BY artist ORDER BY COUNT(artist) DESCĪs we can see below, the output here is the same as the previous, unrefined code, though this modification ensures the results will remain accurate as time passes.Spotify is one of the most eminent names in the technology domain. Finally, best practices include specifying the column name instead of the asterisk(*) wherever possible. To find results from the last 20 years, we subtract the value in the year column from the current year using the - operator and only display the row if the result is <= 20. Our output should only include data from the last 20 years of billboard history, so we’ll isolate the current year in the query using DATE_PART() and CURRENT_DATE: DATE_PART(‘YEAR’, CURRENT_DATE)

the query should work as expected as time moves forward. The goal of writing an effective query is to ensure that the code is “future-proof”, i.e. Now that the query has an accurate solution, it is time to refine the WHERE clause for better applicability. Screenshot from StrataScratch Refining the Query
