This is short project completed to ask 3 questions from the global spotify weekly charts. Several steps need to be completed, including creating a database, inserting a csv file and creating queries to answer questions.
Before conducting any of these steps the data must be looked at for clarity and make a plan for cleaning if needed.
create table spotify
( Pos numeric,
Pos_movement VARCHAR(50),
Artist varchar(50),
Title VARCHAR(100),
Weeks integer,
Peak integer,
Peakx integer,
Streams bigint,
Streams_movement bigint,
Total bigint)
select title, weeks from spotify
order by weeks desc
limit 3
Answer
The above SQL query calculated the percentage change from two columns, the original value of streams is not included, only the movement. So I calcuated the change by subtracting the streams-movement from the streams.
Adding the ‘as Percent_Change’ created a new column to see the values, however, this column was not added into the original table.