text
stringlengths
1
81
start
float64
0
10.1k
duration
float64
0
24.9
could put on my own shelf overall.
663.62
2.8
So we'll look at this database.
666.42
2.13
But we'll need a few tools in our toolkit,
668.55
2.03
metaphorically, to actually interact with this database.
670.58
3.07
And one of them is going to be Visual Studio Code.
673.65
3.86
Visual Studio code is an IDE, integrated development environment, to write code
677.51
4.95
and to edit files with.
682.46
1.56
It's also often called VS Code.
684.02
3.35
Now, in VS Code, we'll also be able to use SQLite, this database management
687.37
5.33
system, or a DBMS for short, to actually interact with that database.
692.7
4.9
So we'll be using these two tools combined
697.6
2.18
to work with the database of longlisted books for the International Booker
699.78
4.32
Prize.
704.1
1.42
And although we'll be using it here, SQLite is not just used in this course.
705.52
4.02
It's used in a variety of applications.
709.54
2.4
You could think too of phone applications,
711.94
2.16
where SQLite is often used on those devices have much lower memory.
714.1
4.44
You could think too of it being used on desktop applications
718.54
3.6
to simplify the process of storing data there too.
722.14
3.18
You could even think of it being used on websites
725.32
2.67
to help store information that user submits via a form, for example.
727.99
4.9
So we'll jump into using SQLite, but keep in mind
732.89
2.87
that not just in this course you'll use it,
735.76
2.58
but also, it's used in a variety of applications here too.
738.34
4.84
So why don't we just jump right into things and start using our environment
743.18
4.35
and start using SQLite?
747.53
1.32
So I'll go over here to my computer and will open up, let's say, VS Code.
748.85
5.64
We're here.
754.49
0.84
You can see I have my terminal environment.
755.33
2.4
And if you're familiar, you can type things like ls
757.73
2.46
to see the files that are in your current folder.
760.19
2.92
So I'll type ls right here.
763.11
1.7
And I'll see this database called longlist.db.
764.81
3.99
Again, working with books that have been longlisted or considered
768.8
3.57
for the International Booker Prize.
772.37
2.55
So if I want to open up this file, I can use this command.
774.92
5.46
Then this command is going to be called SQLite 3.
780.38
4.53
Or I can take some file that I have, like longlist.db, and open
784.91
4.68
it using this program called SQLite 3.
789.59
3.09
Well, it's called SQLite 3 because this is the third version of the SQLite
792.68
4.02
software.
796.7
1.17
So let's try this in our terminal.
797.87
2.49
I'll go back over here, and I'll say sqlite3 longlist.db.
800.36
6.75
And now, I'll hit Enter.
807.11
2.07
And notice how my terminal prompt changes.
809.18
2.83
It's no longer dollar sign.
812.01
1.46
It now says sqlite in front.
813.47
2.49
This means I'm inside of my SQLite environment.
815.96
3.88
So to clear things up, let me just clear my terminal.
819.84
3.06
I can use Control-L for this.
822.9
1.88
And now I have just that prompt up top.
824.78
3.27
And now a question I want to answer in this case first is, what
828.05
3.99
data do I actually have in my database?
832.04
3.48
What data is actually here for me to look at and to ask questions about?
835.52
5.13
Now, for this question, I can use my very first SQL
840.65
3.87
keyword, which will be called SELECT.
844.52
2.58
So SELECT is a way for me to select some rows in a table inside of my database.
847.1
6.27
Using SELECT, I can get back certain rows
853.37
2.52
or, in this case, perhaps all of them just to get a taste of what's inside.
855.89
4.12
So let's try using SELECT on this database to understand
860.01
3.2
what rows we have in our table here.
863.21
3.34
Let me go back to my computer and to my SQLite environment.
866.55
3.89
And I will try this very first SQL keyword.
870.44
3.48
I'll say SELECT.
873.92
1.77
And I can use this star operator here to say select everything.
875.69
4.29
I want every row and every column from this table.
879.98
5.07
Now, it's not enough for me to simply say select star and end my query.
885.05
4.89
I had to tell SQL which table do I want to select rows from.
889.94
4.2
In this case, I know I table was called longlist.
894.14
3.12
So I'll say SELECT star from "longlist," quote, unquote.
897.26
5.25
And to end my query, I'll say Semicolon.
902.51
3.93
And then finally, I can hit Enter.
906.44
2.79
And notice how I get a lot of data back.
909.23
2.46
This is a lot of data all at once.
911.69
1.595
But it's because my terminal is a little bit small,
913.285
2.125
there's a lot of rows and columns here.
915.41
1.84
So I could probably simplify this just a little bit.
917.25
3.17
And instead of saying SELECT star, I could also select a particular column
920.42
4.32
from my table.
924.74
1.65
I could say, for instance, SELECT, let's say,
926.39
2.97
just the title column from my database for my table like this.
929.36
5.74
I just know already that there is a column called title.
935.1
4.07
So now, I'll try this instead-- not select star, but select title instead.
939.17
4.2
I'll hit Enter.
943.37
1.02
And now, this looks a little bit better.
944.39
2.25
I can see the titles inside of this table from top to bottom.
946.64
7.33
Now, the neat thing here is I can select more than one column too.
953.97
4.215
Let's say I don't want just the title--
958.185
1.625
I want titles and authors in my search.
959.81
2.55
Well, I could do that as well.
962.36
1.9
Let me try this.
964.26
0.89
SELECT not just "title," quote, unquote, but then I'll
965.15
3.87
say comma and some new column to select.
969.02
3.72
I'll select also the authors from this table.
972.74
3.96
And I'll select them from the longlist table like this.
976.7
3.81
Now I'll hit Semicolon to end my query.
980.51
2.34
Hit Enter.
982.85
1.11
And now I'll see a variety of columns here,
983.96
3.3
in particular the title and the author column.
987.26
4.19
Now, this is going to be like all of my columns so far.
991.45
2.733