So let's see the answers here.
Feel free to skip forward if you feel like you got them right.
So the first one, right, the SQL that selects the following we only want the cat IDs, 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 SQL 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.
So let's talk about the solution to this one here.
We need to use both the 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, comma, 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 see 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 a slightly different where clause.
So we'll start with the first part.
We want to select cat ID in age.
So that's a select cat ID comma age from cat where and we want where cat ID is the same as age.
So we've been doing things like we're age equals two or we could do where cat ID equals one, but we
can also just do where cat ID equals age.
Those are both going to be numbers and my SQL.
Sorry, my SQL is smart enough to figure that out.
So it's going to compare cat ID and age and see where they're equal.
As you can see, we get what we want cat ID in age and they're equal.
So let's go back and revise this a bit and do a select star.
Just so you can see exactly what we're working with.
We have egg in Jackson, where age is for ID is for age seven and ID is seven.
So in addition to having some practice there, we also learned that you can compare columns and the
values rather than just picking an exact value like four or ten.
We can compare two different columns and select based off of when they're equal to another.
All right.