All righty then it's a little enthusiastic.
Well next up we're going to talk about summer which is another built in function.
It doesn't it sounds like I know I say that a lot but it's some to gather data.
It adds things together.
Very exciting.
It actually is pretty useful.
You can do things like I don't know some together all the profits all the sales that you've made or
your entire payroll for a given month.
Let's say you can find some important information using.
For instance you might want to sum all the pages in our entire database.
So this is following the same pattern as the last couple of videos have.
We're going to show you how to use this function on its own without good.
And then I'll show you at the end of the video how to use it with Group.
So OK.
Some All the pages in the entire database.
It's pretty simple.
It's just a select some pages.
From books and it tells us six thousand six hundred twenty three.
And that's all there is.
We could do silly things like some go way Siri.
All right we're back so we could do something silly like a select some released year and that's just
going to add together all the years in our database.
Let's see thirty seven thousand nine hundred ninety six.
Very important insight we just gained.
OK.
So that's all there is to something things on it don't.
Now let's see how we use it in conjunction with GROUP BY.
It works the same way as what we've seen before.
Basically we group things together by whatever let's say author or I don't know year and then we select
what we want and we can use some to help a select so select all the pages or some all the pages each
author has written.
Let's see who which author cumulative cumulatively has written the most number of pages.
So we'll start with a select and those two are the same thing with the with author F. name author L.
name.
And then we'll some pages.
So we'll do that from books and then we need our all important group by author F. name author.
Actually you need to do l name first and then FDM just like that.
And you can see looks like Dave Eggers has the most 1293.
Raymond Carver 1:53 John Steinbeck only has one book so it's only 181 pages and that's pretty much it.
To some at this point we could of course do the same thing with let's say adding the released year for
their books.
Also a very insightful piece of information that we need but we can see people who have multiple books
like Raymond Carver.
There's multiple years added together Yep that's pretty much it.
OK so that's some I guess said.
You may end up using it if you're.
I don't know.
Dealing with sales data or payroll any sort of information where you're summarizing things.
Actually I just used it recently when I was compiling my taxes.
Probably going to bore you to death of this but I have a whole I have a database that has sales data
for every week for one of my projects I have going on and I just wanted to figure out exactly in a given
year how many cells or not how many but how many dollars I had sold in that entire year and just add
all those values together.
I didn't want to manually enter them into a calculator so it was just a matter of using Select sum and
actually did a select some with a group by because I grouped by year because of sales going back.
I think 2016 15 and 14.
So I only want in 2016 for my tax season anyways.
If you're still there.
Thanks for making it through that.
And our taxes are not the most interesting subject.
But yeah some can be useful sometimes.
And now that was just bad.