text stringlengths 1 81 | start float64 0 10.1k | duration float64 0 24.9 |
|---|---|---|
equals to less than and greater than. | 1,604.27 | 2.76 |
It tends to be that the
exclamation point equals | 1,607.03 | 2.22 |
is the more common operator in this
case, but they do the very same thing. | 1,609.25 | 6.18 |
Now, one more keyword I could
use here that's worth mentioning | 1,615.43 | 3.83 |
is this keyword called NOT. | 1,619.26 | 2.31 |
So here, I was able to use
exclamation point equals or the less | 1,621.57 | 4.38 |
than or greater than
sign to say not equals. | 1,625.95 | 2.34 |
But I could also negate
a condition using NOT. | 1,628.29 | 3.78 |
So let's try using this one
in our SQLite terminal too. | 1,632.07 | 4.08 |
I'll go back over here. | 1,636.15 | 1.35 |
And I'll bring back my SQLite terminal. | 1,637.5 | 3.69 |
I'll say let's do not this
operator here, but instead use NOT. | 1,641.19 | 6.33 |
So I might, in front of WHERE, say
WHERE NOT "format" equals "hardcover." | 1,647.52 | 8.22 |
So I have a condition,
"format" equals "hardcover," | 1,655.74 | 2.76 |
but now I'm going to negate
it, take the opposite of it | 1,658.5 | 3.18 |
and get back the very
same results here too. | 1,661.68 | 4.92 |
OK. | 1,666.6 | 1.46 |
So to the question earlier, how
we can combine these conditionals. | 1,668.06 | 3.99 |
So let's try that here in just a minute. | 1,672.05 | 2.95 |
So let's say I wanted
to find the books that | 1,675 | 3.77 |
were not just written in 2022 or 2023
alone, but all the books together. | 1,678.77 | 6.6 |
Well for this, I could use a
few other SQL keywords that | 1,685.37 | 2.67 |
might be a little familiar to you too. | 1,688.04 | 3.49 |
Let's try looking at
some of these over here. | 1,691.53 | 3.03 |
So here, we have these called AND,
OR, and these parentheses here too. | 1,694.56 | 6.02 |
So using AND and OR, I
can change conditionals. | 1,700.58 | 4.65 |
I can put them together to make a
more complex conditional, a compound | 1,705.23 | 3.6 |
condition. | 1,708.83 | 1.05 |
And I could also use these
parentheses to symbolize | 1,709.88 | 2.88 |
that this condition
should come first and then | 1,712.76 | 2.43 |
some condition should
come afterwards as well. | 1,715.19 | 2.5 |
So let's try these in SQLite as well. | 1,717.69 | 3.09 |
I'll go back to my computer. | 1,720.78 | 1.53 |
And again, our goal is to find
not just books in 2022 or 2023, | 1,722.31 | 4.91 |
but books that work across
those years as well. | 1,727.22 | 3.88 |
So I'll, in this case say, SELECT-- | 1,731.1 | 2.12 |
let's go for a "title" and
"author" from my "longlist" table. | 1,733.22 | 6.37 |
Now, I'll say WHERE the
"year" is 2022, as we did | 1,739.59 | 5.52 |
before, OR perhaps the "year" is 2023. | 1,745.11 | 5.25 |
And notice how my query is kind
of wrapping around my terminal. | 1,750.36 | 3.87 |
I could leave it like this, or
if I backspace just a little bit, | 1,754.23 | 4.96 |
I could hit Enter. | 1,759.19 | 2.13 |
And now I'm on a new line
to continue my query. | 1,761.32 | 3.85 |
So here, I'll say OR "year" is 2023. | 1,765.17 | 5.21 |
And now my query is done. | 1,770.38 | 1.96 |
So I'll hit Semicolon. | 1,772.34 | 1.34 |
And I should see those books published
in or nominated in 2022 or 2023. | 1,773.68 | 8.88 |
Let's try a few more here. | 1,782.56 | 2.02 |
Let's try using our parentheses as well. | 1,784.58 | 2.21 |
Maybe I want not just
these books but also | 1,786.79 | 2.79 |
those that are formatted
in a hardcover format. | 1,789.58 | 2.71 |
So I'll say-- | 1,792.29 | 1.31 |
I'll clear my terminal, Control-L
again, and SELECT "title" as well as, | 1,793.6 | 6.59 |
let's say, "format" from
my "longlist" table. | 1,800.19 | 5.52 |
And now, I'll hit my new
line to extend my query | 1,805.71 | 3.33 |
without wrapping it on my terminal. | 1,809.04 | 1.95 |
I'll hit Enter. | 1,810.99 | 0.99 |
And I'll say WHERE the "year"
is 2022 OR the "year" is 2023. | 1,811.98 | 8.46 |
That's one condition. | 1,820.44 | 1.77 |
And I can denote that with a
single set of parentheses here. | 1,822.21 | 3.96 |
I also want it to be true that
the "format" is not "hardcover." | 1,826.17 | 7.48 |
So now, I'm adding
another condition in here. | 1,833.65 | 3 |
Now, I'll say Semicolon, hit Enter. | 1,836.65 | 2.4 |
And I'll get back only those books
that are published in the paperback | 1,839.05 | 4.05 |
format in 2022 and 2023. | 1,843.1 | 6.09 |
OK. | 1,849.19 | 1.23 |
So let me pause again and ask if
there are any questions so far | 1,850.42 | 3.42 |
in how we've been using WHERE and
SELECT and other conditions as well. | 1,853.84 | 7.12 |
SPEAKER: I would like
to know about the-- | 1,860.96 | 4.16 |
we can have a list of the top
titles available in the database. | 1,865.12 | 4.92 |
Like you have mentioned, the title,
author, where we can know about that. | 1,870.04 | 5.34 |
What are the titles available in
the database using command below? | 1,875.38 | 4.038 |
CARTER ZENKE: Yeah. | 1,879.418 | 0.792 |
So here I've been using these column
names called "title" and "author." | 1,880.21 | 3.21 |
And I think your question is, how
would I know that I have these columns? | 1,883.42 | 3.25 |
Well, as we'll see in
future times together, | 1,886.67 | 2.85 |
I'll be able to actually look at
the schema of my database, what | 1,889.52 | 3.08 |
columns are inside of it. | 1,892.6 | 1.29 |
For now, just take it
on my own word that I | 1,893.89 | 3.39 |
knew what was inside the database
before I actually started querying it. | 1,897.28 | 3.15 |
We'll see later on how
you can take a database | 1,900.43 | 1.95 |
and understand the columns
you have there too. | 1,902.38 | 2.25 |
A good question. | 1,904.63 | 1.21 |
Let's jump into some more queries then. | 1,905.84 | 2.24 |
I'll go back to my computer. | 1,908.08 | 1.53 |
And let's see what else we
could do with these conditions. | 1,909.61 | 3.97 |
Well, not only could I try
to make compound conditions, | 1,913.58 | 3.8 |
I could also try to find, let's
say, which data is missing. | 1,917.38 | 5.1 |
So I know in this table, I
have not just authors of books, | 1,922.48 | 4.38 |
but translators of those books. | 1,926.86 | 2.76 |
Often, books for the
International Booker Prize | 1,929.62 | 2.04 |
were translated from some
other language into English-- | 1,931.66 | 3.93 |
but some weren't or at least
they didn't have a translator | 1,935.59 | 3 |
that was separate from the author. | 1,938.59 | 1.89 |
So to think about what data
is missing from our table, | 1,940.48 | 3.09 |
we should introduce this new idea-- | 1,943.57 | 2.31 |
this one called NULL. | 1,945.88 | 2.56 |
So I'll walk over here. | 1,948.44 | 1.29 |
And we'll see that we have this
type called NULL, where this | 1,949.73 | 3.92 |
means that this value doesn't exist. | 1,953.65 | 1.83 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.