All righty, then.
It's a little enthusiastic.
Well, next up, we're going to talk about some, which is another built in function.
It does that it sounds like I know I say that a lot, but it sums together 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 some.
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 group buy.
And then I'll show you at the end of the video how to use it with group buy.
So 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 6623 and that's all there is.
We could do silly things like some go away, Siri.
All right, we're back.
So we could do something silly, like a select sum released here.
And that's just going to add together all the years in our database.
Let's see.
37,996.
Very important insight we just gained.
So that's all there is to summing things on its own.
Now let's see how we use it in conjunction with Group B.
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 us 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 let's do the same thing worth 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, we need to do l name first and then f name.
Just like that.
And you can see.
Looks like Dave Eggers has the most 1293.
Raymond Carver 702.
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 release 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.
So that's some like I 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 with this, but I have a whole I have a database that has sales
data for every week for one of the one of my projects that I have going on.
And I just wanted to figure out exactly in a given year how many sales are 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 some.
And I actually did a select some with a group buy because I grouped by year because I have sales going
back I think 2016, 15 and 14.
So I only wanted 2016 for my tax season.
Anyways, if you're still there.
Thanks for making it through that.
I know taxes are not the most interesting subject, but yeah, some can be useful sometimes.
Oh boy.
I'm going to end it now.
That was just bad.