text
stringlengths
1
81
start
float64
0
10.1k
duration
float64
0
24.9
Let me ask the audience, what style mistake did
2,279.64
2.31
I just make when I typed in this query?
2,281.95
3.73
So I'm seeing maybe I used double quotes when I should have used single quotes.
2,285.68
3.915
So let me come back and fix that first.
2,289.595
1.625
I'll come back over here.
2,291.22
1.5
And, again, by convention, we tend to use single quotes for our strings.
2,292.72
5.04
So let me fix that right here.
2,297.76
2.04
And now let me run this query to see what we get back.
2,299.8
2.43
I'll hit Enter.
2,302.23
1.05
And I'll see only those books that begin with "The."
2,303.28
4.97
Now, let me show this query again, though.
2,308.25
4.55
This was our query here.
2,312.8
2.1
Knowing what we know about the percent sign,
2,314.9
4.17
what other titles might I accidentally get back by running this query?
2,319.07
5.94
I have "The" percent.
2,325.01
2.295
But what other words actually begin these book titles
2,327.305
3.945
if I were to run this query here?
2,331.25
2.52
We saw only those with "The," but if I had other book titles, what might
2,333.77
3.33
I get back?
2,337.1
1.52
So I might get back those book titles that
2,338.62
1.95
have not just "The" the beginning but also, let's say,
2,340.57
3.45
"There" or "They" or so on.
2,344.02
2.2
There are many words beginning with T-H-E.
2,346.22
2.585
And if I had the percent sign right after it,
2,348.805
1.875
I might match one of those words like Y or R-E or so on.
2,350.68
4.72
So I didn't have any of those titles in this database.
2,355.4
2.25
But you can imagine a different database where I have that kind of data.
2,357.65
5.26
Let's fix this then.
2,362.91
1.35
I say, I want to match not just "The" but "The" and a space,
2,364.26
4.69
and match any characters after that to make this
2,368.95
2.15
query better designed in this instance.
2,371.1
4.28
OK.
2,375.38
0.83
So let me pause here then and ask what questions we
2,376.21
2.73
have on using percent along with LIKE.
2,378.94
5.24
SPEAKER: Can we use two percent signs between two words?
2,384.18
3.958
CARTER ZENKE: Yeah, I think so.
2,388.138
1.292
So let me go back to my terminal here and let me try to answer this question.
2,389.43
3.31
So can we use two percent signs to say something's between two words?
2,392.74
4.05
So let me say this.
2,396.79
1.1
I'll go with SELECT, let's say, "title" from "longlist" WHERE maybe
2,397.89
8.82
the "title" has something like--
2,406.71
3.51
maybe it begins with "The."
2,410.22
1.41
So I'll say WHERE "title" LIKE "The."
2,411.63
5.58
And then I'll take any set of characters afterwards.
2,417.21
3.57
But I want to have "love" also in here too.
2,420.78
2.85
So I'll say "love."
2,423.63
1.44
And then I'll take any other characters after it, percent again, single quote,
2,425.07
6.43
Semicolon.
2,431.5
1.38
Now, I don't know if I have any books that actually fit this search.
2,432.88
4.53
But I could say the percent love percent to mean give me
2,437.41
4.35
back any title that has "The" at the beginning
2,441.76
2.97
then any words or characters then "love" then any words or characters
2,444.73
3.78
after that.
2,448.51
1.17
I'll hit Enter.
2,449.68
0.81
And I see I don't have any books that fit that kind of description.
2,450.49
3.82
But if I did, I would see them here with "The" at the beginning and "love"
2,454.31
4.1
somewhere in the title.
2,458.41
3.29
All right.
2,461.7
0.5
So let's keep going.
2,462.2
0.833
Let's focus not just on this percent sign, but also on this underscore.
2,463.033
4.977
So if I want to find--
2,468.01
1.32
let's say, I don't know what a particular character is in my title.
2,469.33
4.62
I could use this underscore to match any particular character.
2,473.95
3.63
Not any string of characters, but any single character too.
2,477.58
3.24
So let's try this in our terminal.
2,480.82
2.43
And there is a book, this one called a Pyre.
2,483.25
3.18
And I actually keep forgetting how it's spelled.
2,486.43
2.73
I don't know whether it's P-I-R-E or P-Y-R-E. It could be either one,
2,489.16
5.53
but I want to find it in my database.
2,494.69
2.07
So let me try this.
2,496.76
1.01
I'll say SELECT, let's say, "title" FROM "longlist," WHERE, in this case,
2,497.77
6.9
"title" is LIKE--
2,504.67
2.13
well, I know that it starts with a P. And I
2,506.8
2.94
don't know if this is an I or a Y. But I'll at least leave it as an underscore
2,509.74
4.26
now to say it could be any character here.
2,514
2.88
Then I'll say R-E single quote, Semicolon.
2,516.88
5.92
And now I could try hitting Enter.
2,522.8
2.06
And I'll see I get back this title called Pyre.
2,524.86
3.96
So notice in this case that the underscore is matching
2,528.82
3.24
literally any single character.
2,532.06
2.25
This could be a Y. It could be an I. But in this case, I have this Y here.
2,534.31
5.92
OK.
2,540.23
0.605
Let me go back.
2,540.835
0.625
And let's actually ask in this case what questions we
2,541.46
2.46
have on using LIKE with these single underscores if any.
2,543.92
4.157
SPEAKER: Yeah.
2,548.077
0.583
So Carter, I wanted to ask you, that as you use the underscore sign here,
2,548.66
4.57
so for multiple characters, can we use multiple underscores in order
2,553.23
4.16
to find something in the database?
2,557.39
2.308
CARTER ZENKE: A great question.
2,559.698
1.292
Could we use more than one underscore to try to find
2,560.99
2.777
some characters in our database?
2,563.767
1.333
You absolutely could.
2,565.1
0.875
So let me try that myself.
2,565.975
1.525
I'll go back to my terminal.
2,567.5
2.13
And let me try to find a book title this could work with.
2,569.63
2.88
I'll say maybe SELECT "title" from "longlist"
2,572.51
3.87
to get back all the books in this table.
2,576.38
2.28
I'll hit Semicolon.
2,578.66
1.32
And maybe I will go with--
2,579.98
2.775