Lesson 18: Summing all values using the SUM Function.
By Alan Hylands — 1 minute read
The SUM function allows you to do a summary calculation on a particular column in your data table. No wildcards here, we MUST specify the individual column we want to summarise.
The easiest way to think about the SUM function is to use it to add up all of the values in a particular column. If we want to find the total number of international caps for our football players, our SQL query would look like this:
SELECTSUM(IntlCaps) FROM footballers;
It's not all about the price tag when it comes to making these movies. Not unless you are a studio executive looking to see how big of a cheque you are going to have to write to get one made.
Let's pretend you are Marvel's accountant for a second. Get the total budget for all four Avengers movies (and remember these budget figures are in MILLIONS of US dollars).