Welcome back.
Now SQL can also have functions and I'm going to show you three of the most popular, most common
ones in this video. Just to check what we have in our table, well we have users.
And if I do SELECT star users, oop. I forgot to use FROM, we have our users. Now let's say we wanted to get
the average score of the users.
We can do that by saying SELECT average and give the column name inside of average let's say score FROM
users table.
So you can see that our function just like in Javascript has the function name
and then the brackets around the column that we want. Lets press enter and look at that average is
84.5.
Very cool.
What other functions do we have.
Let's say we wanted to get the sum of everybody's age.
I can invoke the SUM function and find out that we have an accumulated sum of 132.
And then finally there's also COUNT another useful one.
And if we want to find out how many users we have in our database we can just say COUNT name and we have
four active users with our game.
All right we've got to work on that to increase that number.
Perfect.
There's a few more functions that you can use but these are probably the most common. You can already
imagine
some of the power that comes with these values. I'll see in the next one, bye-bye.