Oh okey artichoke.
Yep that's how I started this video off.
It's your turn.
So we've covered four different things here for new tools for this mysterious magical toolbox.
We've got distinct as well as ORDER BY and then limit.
And then finally like you're going to put those to use along with some of the stuff you've learned up
until this point with a couple of exercises and there are some clown images here to show you how excited
you should be and they're not at all creepy.
So here's the first thing I need you to do.
Or I'd like you to do.
Please please do it.
Select All story collections.
So some of these books have titles that contain the word stories which tells you that they're are a
collection of stories.
What We Talk About When We Talk About Love Stories really good read by the way where I'm calling from
Selected Stories oblivian stories.
So using what we just saw and that's something I just want to point out for all of these exercises.
There are ways that you could directly select things maybe a little bit easier or you could cheat in
a way but make sure that you do it the way that I specify please.
Using that things you just learned so specifically titles that contain the word stories not exactly
stories but something that contains stories in it.
So that's the first one.
All right.
And then the next one find the longest book in the entire database or in the entire books table.
So this is what you should get back.
Print out the title and the pages The Amazing Adventures of Kavalier and Clay 634 pages of course don't
just select based off of four pages is exactly 6:34 or where the title is The Amazing Adventures of
cavalier.
Anyway please do it the right way so that your queery would always work no matter how many books are
in the table and what they're named and how many pages they have.
It will always get the longest book OK.
Just one.
Then the next problem print summary.
In our case a summary contains the title Dasch the year and print 3.
Only three of the most recent books.
So 2017 2016 and 2014.
So again a summary and it says it says summaries of that.
Remember how to do that.
The title Dasch the year it was released and then only print out the three most recently released books.
All right.
Next Next up is find all the books whose author's last name contains a space character and only David
Foster Wallace.
In our case.
Don't cheat and just say.
Author L name is exactly foster space.
WALLACE But how can you find any author last name that has a space in it.
And then when to do that find the three books with the lowest number and the lowest stock quantity.
So as you can see here you forgot American Gods is 12 where I'm calling from has 12.
What we talk about when we talk about love has 23 and I'd like you to print the title.
The released year and the stock quantity.
So just to reiterate the three lowest stocks.
All right then we have this one.
Print the title and the author last name.
So you've got title author out name sorted by the author's last name.
So this is all of the books by the way so sort by the author last name and then sort by title you get
some of these authors for example Carver Eggers are game and have multiple books.
So if we look at Carver for instance Carver has what we talk about blah blah blah where I'm calling
from what we talk about comes before where I'm calling from alphabetically.
If that makes sense.
Same thing with Eggers a heartbreaking a hologram.
The circle so sort first by the last name of the author and then on top of that the title then we've
got this one just make this happen.
It's kind of difficult to write out exactly what's happening.
The main idea is that we're going to go through every book you're going to print out this string here.
My favorite author is and this is yelling in all caps I won't wake my neighbors.
It's kind of fleet but my favorite author is and then the author's first name capitalized and the author's
last name capitalized and an exclamation point at the end.
And do that for every book sorted alphabetically by the author's last name so you can see Carver comes
first.
Aggers Foster Wallace game and down to Steinback and then McCrery.
Call it yellow up here.
Yes it's a bit of a complicated one but fortunately it's last.
Hopefully you can make this one work.
It's a little bit long.
Good luck.
See in this Lucian video.