Next up, we've got two very simple string functions upper and lower.
They help us change the casing of a string so upper will make a string uppercase instead of Hello world,
we get Hello world.
And instead of I don't know how you would say this out loud.
Hello world, we get Hello world lowercase, right?
It's just upper versus lower.
That's really all that there is.
There are a couple of aliases or shorter versions, so upper is also callable as you case and lower
is callable as they show this somewhere on here L case.
So I'll prove that real quick.
Let's do select upper.
Hello.
And we get.
Hello.
If I do, you case.
I get the same result.
Now, if I have some uppercase string or some upper and lowercase string like that and I do lower,
the whole thing is lowercase and same thing.
No surprise.
Hopefully if I do LX case, we get the lowercase version.
Same thing.
So why don't we try a simple example, but select?
Let's see, what are the columns we have?
Let's do select star from books.
And let's take the book title.
So select and let's uppercase the title upper title from books.
And there we are.
Now, here's a quick little bonus exercise.
I want you and I'll do it as well to write a query that generates a column where the results look like
this.
I'll just type it out here.
I want it to look like I love the namesake.
Exclamation point, exclamation point, exclamation point.
So I want you to take the word I love and space and always put it in front of the uppercase title and
then at the end do a space with more exclamation points.
So let's try writing that query.
I'll just do it over here for now.
In Workbench.
I keep getting confused between these, but it doesn't matter.
We've got different options.
SQL doesn't matter.
It doesn't care where you write it.
So select and I'm going to concatenate what am I concatenating?
I'm going to start with I love into space and let me use single quotes because I've been harping on
how that's important, or at least a good practice, even if I break that rule subconsciously, because
every other programming language I write wants you to use double quotes.
So I apologize for that.
Anyway, you can cut, I love.
And then instead of just the title, we want upper title, and then after that we want a space.
Three exclamation points.
And this one's simple enough on a single line.
Let's see if it works.
Unknown.
Oh, my gosh.
How am I forgetting from books?
It's the only mistake we have to say where it's coming from.
Of course, what we're selecting from.
And now we get.
I love the namesake.
I love Norse mythology, I love white noise, I love considered the lobster and so on.
All right.
So just a little more practice combining these operations, combining these string functions together.
I know it's all stupid right now.
These are silly things, but eventually we're going to learn how to do things like find the maximum
of a list of values so we could find the longest book in here in terms of pages or in terms of character
length in the title.
But we've got to start somewhere.
This is our first little bit of adding on to basic selections.
We can manipulate the results using these string functions, even if they're very basic and they don't
seem that useful, they are very important to know.