SQL Quiz Data Olympics
SQL Quiz Data Olympics
QUESTION 1
Dataset_Name: Employee
Q. FIND EMPLOYEES IN THE SALES DEPARTMENT WHO REACHED A TARGET OF MORE THAN
150. OUTPUT THE FIRST NAMES OF EMPLOYEES. SORT RECORDS BY THE FIRST NAME IN
DESCENDING ORDER.
Q. Write a SQL code to find the average number of spells cast by each house, and list the
wizards who have cast more spells than the average for their respective houses. Display the
wizard's name, house, and the total number of spells cast.
Q. Write a SQL query to calculate the cumulative box office collection for each movie,
ordered by release date
Q. Write a SQL query to find the top 3 movies with the highest average ratings, considering only
the latest rating from each user
Q. Write a SQL query to find the salary changes for each actor over time, including the previous
and current salary, and the percentage change.
Q. Write a SQL query to calculate the 30-day moving average of play counts for each song,
ordered by play date.
Q. Write a SQL query to rank actors based on their total screen time contribution across all
movies
Dataset_Name: Money_Heist_Sample
write a sql code to Retrieve the total bonus amount awarded to each
robber in the team. Show the robber's name and the total bonus amount received.
Robbery_Targets Loot_Amounts
Q. Write a SQL code to find the average loot amount for each robbery target and compare it
with the overall average loot amount. Display the target name, the average loot amount for the
target, and whether it is above or below the overall average loot amount.