So let's see the answers here.
Feel free to skip forward if you feel like you got them right.
So the first one write the sequel that selects the following.
We only want the cat ladies but we want all of the results.
All the cats so that will be.
Select cat ID from cats.
So we want all cats but only the cat Id returned.
And that's what we get.
Next up write the sequel query that selects the following name and breed for all cats.
So it's similar to the last one except we want name and breed from all cats.
There we go.
Name and breed.
OK so let's talk about the solution to this one here.
We need to use both these select expression and the WHERE clause we want to select name and age from
cats where breed equals tabby.
So let's do that.
Select name Khama age from cats where breed equals tabby.
Just like that.
And we get Ringo who's four and Misty who is 13 and that's exactly what we wanted to see.
Now the final one is a little trickier as I mentioned we didn't know exactly how to do this but hopefully
you were able to figure it out because it's exactly the same syntax but we're just checking slightly
different.
Where clause.
So we'll start with the first part.
We want to select cat ID and age so that's a select cat ID comma age from cats where and we want where
cat ID is the same as age.
So we've been doing things like where age equals to or we could do were cat ID equals one but we can
also just do or cat D equals age because we're both going to be numbers.
And my sequel I'm sorry my as well is smart enough to figure that out.
So it's going to compare cat idea and age and see where they're equal as you can see we get what we
want.
Cat ID and age and they're equal.
So let's go back and revise this a bit and do a show like Star
just so you can see exactly what we're working with.
We have egg in Jackson.
We're ages for ideas for ages seven and idea seven.
OK.
So in addition to having some practice there we also learned that you can compare columns and the values
rather than just picking at an exact value like four or 10.
We can compare two different columns and select based off of when they're equal to another.
All right.