Shadowing Practice: Learn Basic SQL in 15 Minutes | Business Intelligence For Beginners | SQL Tutorial For Beginners 1/3 - Learn English Speaking with Video

Kies een oefenmodus

Elke modus opent een volledig scherm oefenruimte.

201 zinnen
Als zinnen te kort of te lang zijn, klik op Bewerken om ze aan te passen.
1
In this video, you're going to learn the basics of SQL querying in just 15 minutes.
2
And by the time we're finished, you'll be wondering what all the fuss was about.
3
Are you ready?
4
Then let's get started.
5
Hello and welcome to Vitamin BI, bringing you business intelligence for beginners and beyond.
6
On this channel I help you do more with data, so if you're new here consider subscribing.
7
Right, so as I said in my intro I'm going to teach you the basics of SQL querying,
8
the essentials that you'll need to know if you're considering becoming a business intelligence analyst.
9
Obviously we can only go so far in 15 minutes, but I promise you
10
that by the time we're finished
11
you'll be able to understand quite a lot of what you might be called upon to do.
12
We'll be focusing specifically on querying data, not creating or deleting databases,
13
tables or data, just selecting data from tables that we want to return for our specific needs.
14
Before we get started, let me give you a little context.
15
You might be wondering why you need to learn SQL with BI tools becoming more and more sophisticated.
16
Can't they write the SQL queries for me the answer to
17
that is yes and no yes
18
when it comes to requesting data for different charts graphs and tables
19
that you might want to present in dashboards in these cases
20
the bi tool will have some kind of graphical interface to be able to drag
21
and drop fields to return data but no in
22
that in a lot of cases you'll need to write sql queries to pre -aggregate filter
23
and select only the data necessary for the project that you're working on.
24
These are often called views and you create views mainly
25
because it's more efficient than connecting to all data when you only need some of it.
26
So you could have a table that contains millions of rows of data
27
but by creating a view of it your BI tool will
28
only need to work with a few thousand making analysis and presenting results much faster.
29
So you see, knowing how to query with SQL is a useful skill to have.
30
Let's jump onto my computer and get started.
31
So today we're working with a SQLite database that I found online, containing data compiled from the FIFA video game by EA Sports.
32
So soccer stats.
33
I'll leave a link to the database in the description if you want to play around with it too.
34
In terms of the tool I'm using to query the database?
35
It's called NaviCat.
36
It's the premium version that allows you to connect to and query pretty much any relational database.
37
But they also have a version for specific RDBMS like MySQL, SQL Server, etc. Link also in the description.
38
Here we're in the NaviCat interface.
39
On the left we can see that I'm connected to the SoccerDB connection
40
that I've created and in that connection is a database called main and in that database we have various tables country,
41
league, match, player etc. We're going to be working mainly with the player table.
42
If I double click it we'll see the data contained within that table.
43
We've got three different IDs, player name, birthday, height and weight.
44
What I want to do is write SQL queries
45
and ask the database to return specific data from this table so I'll open a new query window.
46
Now when we're asking for data we're using what's called a select statement
47
so that's what we need to write first and
48
if we want to return the whole table in the result we do so with a star.
49
Then we specify the table that we want to select everything from.
50
In this case the table called player select star from player then we run the query
51
and the database returns all data from that table you may notice
52
that i've written everything in lowercase
53
because the sequel isn't case sensitive however i have the option to what's called beautify the sequel
54
and when i do you'll notice that select
55
and from have been capitalized although it's not obligatory this does actually make your queries easier to read.
56
It's not so important with such a small query like this one
57
but when you've got one with tens if not hundreds of lines of code it really does make life easier.
58
So we've selected all fields or columns and all rows from the table
59
but what if we only want to select specific fields?
60
Simple.
61
Instead of the star we just write out the field names
62
we want separated by commas like this player underscore name comma birthday I run this,
63
and those are the fields returned.
64
When we select specific fields, we can also rename them by creating aliases.
65
To do this, we use the as function.
66
So player name as name.
67
And we can see that update.
68
We could specify an alias containing a space, but to do this, we would need to put the name in quotes like this.
69
Full name.
70
Let's go back to all data
71
and look now at how we can ask the database to only return specific rows in the result.
72
To do this we use a WHERE clause with different operators.
73
For example, we could select only players with a weight of 190 pounds.
74
So we use the equals operator.
75
We could also select any player with a weight greater than 190 pounds or greater than or equal to 190.
76
You see, it's not that complicated.
77
And we've gone from over 11 ,000 records to just under 1 ,000 being returned.
78
We can also specify more than one condition by using either
79
and or or so weight greater than 190 and height greater than 190
80
so both conditions must be met if I change it to
81
or it means that either condition must be met in order for the row to be returned
82
so that's selecting rows based on the value in integer fields what about when it comes to text values?
83
Well, we can also use the equals operator to find any row where the text matches exactly with what we specify.
84
PlayerName equals Aaron Galindo.
85
But we could also use the like operator which achieves the same goal.
86
But what if we want to select just rows from all players called Aaron?
87
So basically the player name field starts with Aaron.
88
Here we can use a percent character after the text to look for, like so.
89
And we get all Arons returned.
90
If we wanted to find any player name that ends with Aaron, we put the percent character before.
91
Nothing that ends with Aaron.
92
We could put a percent before and after, which would basically mean any player name that contains Aaron.
93
And we've got Rolando Arons.
94
Finally, here's an example which puts the percent in the middle of text.
95
So here we'll return all rows where the player name starts with a and ends with n.
96
you can go even further with the like operator by using
97
underscore to represent single characters an example would be like t underscore m percent
98
so the underscore is asking for any rows where the player name starts with t
99
then any character between the t and the m followed by anything and run.
100
We've got Tamas, Tamir, Tim, Timmy, etc.
101
There are also things called wildcards that allow you to go even further
102
when specifying the rows you want to return but we won't go into those for this video.
103
We will however finish looking at the where clause by talking about a couple more operators that you can use.
104
For text fields we have in which allows us to specify multiple or statements, more simply.
105
However, it can only be used for exact matches, so we can't use percents or underscores with it.
106
So let's look for Ronaldo and Messi.
107
Open brackets Cristiano Ronaldo, Lionel Messi.
108
For integers, we can use the between operator.
109
So I could say wear weight between 180 and 190.
110
Finally we have the isNull and isNotNull.
111
Null being empty.
112
In this table we don't have any null values.
113
But if I open up the match table we can see that there are lots in there.
114
So select star from match where home player 1 is null. or is not null.
115
There we go.
116
Let's go back to our player table and see how we can sort results.
117
We can do this using the ORDER BY clause.
118
The rows are currently sorted by the ID field in ascending order.
119
But if we wanted to sort by weight, we can say ORDER BY WAIT.
120
This sorts by weight in ascending order, because that's the default sorting method when not explicitly specified.
121
But we can change this to descending order by adding DESC now we can see who the heaviest player is
122
when it comes to sorting data using order by this isn't something that's overly important for our use case
123
because when we're selecting data to create views we're usually then going to connect
124
that view to a bi tool and use
125
that for building individual chart queries
126
and these tools will let you apply sorts to the data
127
now we're going to look at how to join data from different tables.
128
To demonstrate this I'm going to use the player attributes table.
129
We can see that in this table we have the player ID but not the player name.
130
To be able to create a view containing the player name plus the overall rating
131
we would need to join the data from the player attributes and player tables.
132
I'm going to start by specifying player API ID comma date comma overall rating.
133
Now I want to get the player name from the player table.
134
How do I do that?
135
Well because we're going to need fields from two different tables we need to specify which field comes from which table.
136
We do this by writing the table name dot field name.
137
So player attributes dot player API ID.
138
Same for date and overall rating.
139
Now we can specify, perhaps after the player ID, player dot player name.
140
If I run this I'll get an error saying
141
that there's no such column as player .playerName because we're saying that we're looking for it in the player attributes table.
142
This is when we need to specify the joining of the tables using one of the four join types.
143
I'm not going to go into them in this video
144
but I'll probably do a separate video that explains them in more detail so don't forget to subscribe.
145
So in this case we'll use an inner join
146
and we'll say inner join player the player table on
147
and now we specify what fields
148
we want to use to create the join in this case we're going to use the player api id field
149
which is contained in both tables
150
and again we have to add the table name first dot field name equals player dot player API ID and run.
151
Now we have the player name appended to the player attributes table data.
152
Pretty clever right?
153
But let me show you something even more clever.
154
I showed you earlier how to use the as function to create aliases for fields.
155
Well we can actually do this for tables as well which makes the query much cleaner.
156
First I'm going to give the player attributes table an alias of a and the player table an alias of b.
157
I just need to write these two letters after where I've specified each table.
158
So a after player attributes here and b after player here.
159
Once I do this I can now replace the table name for each field like this.
160
You see, much cleaner.
161
So, you may notice that there are multiple rows for each player on different dates.
162
So how would we add up all of these different values for each player?
163
Well, to do this, we're going to want to aggregate the data using the SUM aggregator.
164
I'll add this to the overall rating field and run the query.
165
Ah, that's not what we were expecting.
166
But that's because we haven't specified in the query how we want to group the data together.
167
This is when we need to use the GROUP BY clause.
168
When we use the GROUP BY clause we need to add into it all of the fields that we need to group.
169
So in this case essentially all fields apart from the overall rating.
170
A .PlayerApiId, B .Playername, A .Date And run
171
This is correct, but not exactly what we want.
172
We want to combine all of the ratings for the different dates,
173
so we actually want to remove the date field from the specified fields as well as the group by. and run.
174
That's better.
175
But let's clean it up by aliasing the sum overall rating as rating.
176
Let's sort this descending.
177
Order by rating descending.
178
Strange that Ronaldo and Messi aren't in there at the top.
179
Let's try and see why this is.
180
Perhaps there are just more entries for some players when we sum them up.
181
To find this out, we could add a count of b .playerName.
182
And yes, in this case how about using an average?
183
I'll replace sum with average, avg, and run.
184
And there we go, that makes more sense.
185
We're going to go one step further and filter this result.
186
To do that we can use the HAVING clause.
187
The HAVING clause is only applied to the result of the GROUP BY function, so isn't the same as the WHERE keyword that's applied before.
188
And it's only applied to numeric values, so in this case I'm going to ask for only ratings above 85.
189
I need to write it directly after the group by and before the order by.
190
So having rating greater than 85 and run.
191
Only 26 records.
192
And there we have our final query.
193
I'll beautify it and this is what it should look like.
194
You can see that all of the SQL keywords are capitalised.
195
And you can see that we've come a fairly long way in a very short space of time.
196
We've only covered a very small part of SQL as a whole, so there's masses more to learn.
197
But what I've shown you today is a really good foundation for giving you the confidence to dive deeper.
198
Did I not say that once we'd finished, you'd wonder what all the fuss was about?
199
If you got value out of this video, please do like, share
200
and subscribe for more videos like this one why not start with this playlist here as always thanks for watching
201
I've been Adam Feiner and until the next time stay BI curious

App downloaden

Alles wat je nodig hebt om vloeiend te spreken

AI UitspraakScoor elke zin
IPA OefeningBeheers elk geluid
WoordenschatBouw je woordenschat op
WoordenspelLeren terwijl je speelt
FOR YOU

Aanbevolen Video

Woordenschat en spreektips bij deze les

Deze spreekles is gebaseerd op de video “Learn Basic SQL in 15 Minutes”. Deze woorden komen het vaakst terug: player, table, field, row, select. Deze video bevat 201 zinnen en 2466 woorden om na te spreken. Het gesproken deel duurt 17:28. De spreker praat in een gelijkmatig tempo van ongeveer 141 woorden per minuut, prettig om te shadowen. 84% van de woorden hoort bij de 3.000 meest gebruikte Engelse woorden; de rest kun je beter vooraf bekijken.

Belangrijke woorden in deze video

15 woorden uit de video die het leren waard zijn, met uitspraak en betekenis:

WoordUitspraakBetekenis
query zelfstandig naamwoord/ˈkwɪɹ.i/vraag, verzoek
select werkwoord/sɪˈlɛkt/uitkiezen, selecteer
specify werkwoord/ˈspɛs.əˌfaɪ/specificeren
database zelfstandig naamwoord/ˈdeɪtəˌbeɪs/database, databank
rat zelfstandig naamwoord/ɹæt/rat, bruine rat
operator zelfstandig naamwoord/ˈɑpəˌɹeɪtɚ/bediener
clause zelfstandig naamwoord/klɔːz/nevenschikking, bijzin
attribute zelfstandig naamwoord/ˈæt.ɹɪˌbjut/attribuut, eigenschap
connect werkwoord/kəˈnɛkt/verbinden
subscribe werkwoord/səbˈskɹaɪb/abonneren
filter zelfstandig naamwoord/ˈfɪltɚ/filter
interface zelfstandig naamwoord/ˈɪn(t)ɚˌfeɪs/koppeling, aansluiting
sequel zelfstandig naamwoord/ˈsiːkwəl/vervolg
aggregate zelfstandig naamwoord/ˈæɡ.ɹɪ.ɡət/geheel, samenstel
soccer zelfstandig naamwoord/ˈsɑk.ɚ/voetbal

Zinnen om te herhalen

Korte, volledige zinnen uit de video die je in alledaagse gesprekken kunt gebruiken:

  • Let's jump onto my computer and get started.
  • In terms of the tool I'm using to query the database?
  • You see, it's not that complicated.
  • In this table we don't have any null values.
  • How do I do that?

Grammatica in deze video

De structuren die de spreker het meest gebruikt, met de exacte woorden uit de video:

StructuurIn de video
Voorwaardelijke zinnen if + zin, will/would + werkwoord — een voorwaarde en het gevolgIf I double click it we'll see · If I run this I'll get
Present perfect have/has + voltooid deelwoord — iets uit het verleden dat nu nog teltI've created · i've written · have been capitalized
Lijdende vorm be + voltooid deelwoord — het gaat om wat er gebeurt, niet om wie het doetmight be called · are often called · have been capitalized
Mogelijkheid met “might / may” might/may + werkwoord — iets is mogelijk maar niet zekermight be · might want · may notice

Uitspraak om op te letten

De spreker gebruikt 70 samentrekkingen en verkorte vormen, zoals we're, I'm, I'll. Spreek ze kort uit, zoals je ze hoort.

  • De klanken “sh” en “zh”: efficient /ɪˈfɪʃənt/, essentially /ɪˈsɛnʃəli/, dashboard /ˈdæʃˌboɹd/
  • Lange woorden — let op de klemtoon: operator /ˈɑpəˌɹeɪtɚ/, complicated /ˈkɑm.plɪˌkeɪ.tɪd/, essentially /ɪˈsɛnʃəli/, aggregator /ˈæɡɹɪˌɡeɪtɚ/, capitalize /ˈkæpətəˌlaɪz/

Klanken die Nederlandstaligen lastig vinden:

  • Stemhebbende eindmedeklinker — /b/, /d/, /g/, /z/, /v/ niet verscherpen: clause /klɔːz/, subscribe /səbˈskɹaɪb/, descend /dəˈsɛnd/, pound /ˈpaʊ̯nd/, complicated /ˈkɑm.plɪˌkeɪ.tɪd/
  • /æ/ — opener dan de Nederlandse “e”: rat /ɹæt/, attribute /ˈæt.ɹɪˌbjut/, aggregate /ˈæɡ.ɹɪ.ɡət/, dragon /ˈdɹæɡən/, graph /ɡɹæf/
  • /g/ — een harde plofklank, geen Nederlandse “g”: aggregate /ˈæɡ.ɹɪ.ɡət/, dragon /ˈdɹæɡən/, graph /ɡɹæf/, beginner /bəˈɡɪnɚ/, aggregator /ˈæɡɹɪˌɡeɪtɚ/

Zo oefen je met deze video

  1. Luister de hele video één keer zonder te spreken en noteer de woorden die je niet kent.
  2. Spreek zin voor zin na op normale snelheid en herhaal elke zin tot je ritme gelijk is aan dat van de spreker.
  3. Neem jezelf op en vergelijk met het origineel; let daarbij op woorden als query, select, specify.

Wat is de Shadowing-techniek?

Shadowing is een wetenschappelijk onderbouwde taalleermethode die oorspronkelijk is ontwikkeld voor professionele tolkentraining en gepopulariseerd door polyglot Dr. Alexander Arguelles. De methode is eenvoudig maar krachtig: je luistert naar native Engelse audio en herhaalt het onmiddellijk hardop — als een schaduw die de spreker volgt met slechts 1–2 seconden vertraging. In tegenstelling tot passief luisteren of grammaticadrills, dwingt shadowing je hersenen en mondspieren om echte spraakpatronen tegelijkertijd te verwerken en te reproduceren. Onderzoek toont aan dat het de uitspraaknauwkeurigheid, intonatie, ritme, verbonden spraak, luisterbegrip en spreekvaardigheid aanzienlijk verbetert — waardoor het een van de meest effectieve methoden is voor IELTS Speaking-voorbereiding en echte Engelse communicatie.

Shadowing-techniek: lees de volledige stap-voor-stap-gids →