Cobot training: Working with Pallets and Bin Boxes
SQL: Functions and GROUP BY
Exercise
Today we will use Structured Query Language (SQL) to pull data from a movie database. SQL, like spreadsheets, is an indispensable tool for data analysts.
Demo
COUNT, SUM, AVG, GROUP BY
Constructing SQL Statements
Construct the appropriate SQL statements to satisfy each of the following requests. Use the LaunchBoard SQL Lab to test your statements.
Determine the number of movies released by year. Order by year.
Determine the total number of votes collected (vote_count) for all thriller movies by year. Order by year.
Determine the total revenue for adventure movies by year. Order by descending total revenue.
Determine the average of the vote_average for all comedies by year. Order by descending vote average.
Determine the average profit for adventure movies by year. Remember that profit is calculated as (revenue - budget). Remove revenue and budget values that are < 0. Order by descending profit.