All language subtitles for 16 - What Is A Query English

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (SoranĂ®)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 1 00:00:00,090 --> 00:00:01,570 ‫All right, Querrey time. 2 00:00:02,100 --> 00:00:09,600 ‫So in the previous video, we ended on talking about queries, a query is nothing more than an instruction 3 00:00:09,900 --> 00:00:11,660 ‫write in English. 4 00:00:11,940 --> 00:00:13,620 ‫A query is defined as a question. 5 00:00:14,370 --> 00:00:21,600 ‫And Enescu, well, queries are the way that we are going to put together our questions to which we 6 00:00:21,600 --> 00:00:23,850 ‫want an answer from the database. 7 00:00:24,630 --> 00:00:27,370 ‫A query is also known as an equal statement. 8 00:00:27,510 --> 00:00:29,010 ‫Those are just synonyms. 9 00:00:29,550 --> 00:00:30,840 ‫Query is equal to ask you all. 10 00:00:30,840 --> 00:00:35,140 ‫Statement, as you will statement is equal to a query, just different ways of saying the same thing. 11 00:00:35,820 --> 00:00:41,250 ‫So if we look here, there is a very basic query select star from users. 12 00:00:41,850 --> 00:00:48,210 ‫And if we were to break this down, what it's basically saying is select us all of the information. 13 00:00:48,210 --> 00:00:50,810 ‫So the star here is what we call a wild card. 14 00:00:51,150 --> 00:00:54,960 ‫We don't know what we want to get back, but just get us everything back. 15 00:00:55,560 --> 00:01:00,180 ‫So select us everything from so we're going to say where we want it from. 16 00:01:00,660 --> 00:01:04,200 ‫And we know somewhere in our database we are storing users. 17 00:01:04,350 --> 00:01:04,730 ‫Right. 18 00:01:05,130 --> 00:01:08,730 ‫So select us everything from users. 19 00:01:09,330 --> 00:01:09,990 ‫All right. 20 00:01:10,830 --> 00:01:12,720 ‫That's pretty straightforward. 21 00:01:13,230 --> 00:01:14,430 ‫So let's execute that. 22 00:01:18,440 --> 00:01:25,280 ‫All right, so here we see select star from user over here, let's just copy paste all of this information, 23 00:01:25,280 --> 00:01:26,800 ‫just put it in your DB fiddle. 24 00:01:27,290 --> 00:01:28,720 ‫Let's not worry about that just yet. 25 00:01:29,180 --> 00:01:36,020 ‫And if we execute our command select star from user, what we're going to get is a bunch of information 26 00:01:36,320 --> 00:01:39,200 ‫because a bunch of user information was input it. 27 00:01:39,200 --> 00:01:44,120 ‫We can see they have an ID, they have a name, a last name, date of birth, sex on a roll. 28 00:01:45,100 --> 00:01:51,070 ‫Awesome, so we can see here that select star from user is actually selecting us all of the information 29 00:01:51,070 --> 00:01:52,570 ‫that we have around that user. 30 00:01:53,110 --> 00:01:58,720 ‫And if we filtered and we just said name, what we would see happen is we would only get the name back. 31 00:02:00,020 --> 00:02:06,830 ‫Amazing, so let's hop back into the slides and check out what a breakdown of equerry looks like. 32 00:02:08,170 --> 00:02:14,230 ‫So here we've expanded the query a bit because we want to break down something a little more complicated. 33 00:02:14,590 --> 00:02:20,350 ‫So let's say we did select name, so select the user's name from. 34 00:02:21,410 --> 00:02:25,370 ‫Our datasource users in the database where. 35 00:02:26,460 --> 00:02:31,480 ‫Rule is equal to manager, so this is new, right, where role is equal to manager. 36 00:02:31,950 --> 00:02:33,470 ‫This is what we call a condition. 37 00:02:33,690 --> 00:02:36,630 ‫So where is our key word? 38 00:02:37,050 --> 00:02:41,570 ‫And we're seeing where the role of the user is equal to manager return the name. 39 00:02:42,420 --> 00:02:43,680 ‫I hope that makes sense. 40 00:02:44,490 --> 00:02:46,770 ‫We're filtering data at this point. 41 00:02:46,920 --> 00:02:50,330 ‫We're seeing where the roll is equal to manager of the user. 42 00:02:50,460 --> 00:02:51,520 ‫Give us back their name. 43 00:02:52,470 --> 00:02:55,740 ‫And so if we were to break down this query and we looked at it line by line. 44 00:02:56,690 --> 00:03:02,870 ‫Select name is a clause from users, is called a clause, and where role is equal to manager is called 45 00:03:02,870 --> 00:03:03,420 ‫the clause. 46 00:03:03,710 --> 00:03:08,280 ‫These are just parts of the school statement or the query. 47 00:03:08,870 --> 00:03:11,180 ‫So each line here is called a clause. 48 00:03:11,540 --> 00:03:15,270 ‫And when we select name, name is called an identifier. 49 00:03:15,320 --> 00:03:21,840 ‫Now, what does an identifier and identifier is just a different word for a part of the data. 50 00:03:22,130 --> 00:03:29,420 ‫We know that users have a name, so when we select name, we're saying that name is the identifier that 51 00:03:29,420 --> 00:03:29,870 ‫we want. 52 00:03:30,320 --> 00:03:36,890 ‫And when we look at the last line where role is equal to manager, our filtering line, this is a bit 53 00:03:36,890 --> 00:03:37,950 ‫more complicated, right? 54 00:03:38,720 --> 00:03:39,980 ‫Where is our keyword? 55 00:03:40,640 --> 00:03:42,800 ‫Role is our identifier. 56 00:03:43,650 --> 00:03:49,650 ‫But the line role equals manager is called the condition, so a condition is something that needs to 57 00:03:49,650 --> 00:03:50,250 ‫be met. 58 00:03:50,580 --> 00:03:58,890 ‫We're saying that, OK, a user has a role, that role needs to be equal to manager in order for us 59 00:03:58,890 --> 00:03:59,930 ‫to get some data back. 60 00:04:00,970 --> 00:04:04,850 ‫Pretty straightforward and manager is called our expression. 61 00:04:05,710 --> 00:04:13,320 ‫We are expecting that some of the roles may be equal to manager, but some may not be. 62 00:04:13,960 --> 00:04:20,260 ‫So that's why we call it an expression, because we are making an assumption here that some of the roles 63 00:04:20,260 --> 00:04:21,290 ‫are equal to manager. 64 00:04:21,310 --> 00:04:24,160 ‫We want to filter based on our assumption. 65 00:04:24,760 --> 00:04:25,330 ‫Awesome. 66 00:04:25,990 --> 00:04:27,880 ‫So let's fire that real quick. 67 00:04:30,420 --> 00:04:35,270 ‫All right, so we have our query here ready to go, so let's run it. 68 00:04:37,490 --> 00:04:41,360 ‫And as you can see, we are getting back, George, Janene and Jason. 69 00:04:42,360 --> 00:04:44,640 ‫So let's verify that that's actually what we want. 70 00:04:45,380 --> 00:04:47,280 ‫So let's get back all of the information. 71 00:04:48,780 --> 00:04:54,030 ‫All right, so we see here, George, Janene and Jason, and we see that the role is equal to manager, 72 00:04:54,930 --> 00:04:56,940 ‫all right, that makes sense. 73 00:04:57,600 --> 00:04:59,410 ‫But who else did we have here again? 74 00:04:59,820 --> 00:05:00,960 ‫So let's go look at that. 75 00:05:02,070 --> 00:05:09,300 ‫This is a way to put a line in comment, you just you don't want to execute that line, it's a quick 76 00:05:09,330 --> 00:05:11,520 ‫way of turning lines on and off. 77 00:05:12,660 --> 00:05:13,530 ‫So let's run that. 78 00:05:14,410 --> 00:05:19,840 ‫So here we can see, OK, George is a manager, and then we had Maizie and Bill who are employees, 79 00:05:20,530 --> 00:05:21,080 ‫OK? 80 00:05:21,220 --> 00:05:21,950 ‫That makes sense. 81 00:05:21,970 --> 00:05:24,790 ‫So let's turn that line back on if we run it. 82 00:05:26,040 --> 00:05:29,010 ‫And we said, OK, now filter us, the employees. 83 00:05:32,660 --> 00:05:35,040 ‫Awesome, so we see Macy and Bill come up. 84 00:05:35,930 --> 00:05:36,920 ‫All right, awesome. 85 00:05:37,070 --> 00:05:39,140 ‫So now it's all starting to come together, right? 86 00:05:39,770 --> 00:05:43,670 ‫We know how to build a very, very simple query. 87 00:05:44,030 --> 00:05:48,500 ‫And I would push you to copy paste what's in here. 88 00:05:49,890 --> 00:05:55,710 ‫Put it in your DB fiddle and try to write some simple queries where you filter and you select certain 89 00:05:55,710 --> 00:05:58,200 ‫fields, and that way you can play around with it. 90 00:05:59,570 --> 00:06:06,020 ‫So we've done our break them and now we know all of the different parts that go into equerry, and that's 91 00:06:06,020 --> 00:06:07,160 ‫super powerful, right? 92 00:06:07,160 --> 00:06:12,330 ‫Because now we've just said select name from users where role is equal to manager. 93 00:06:12,560 --> 00:06:15,930 ‫We asked a question and we got an answer back. 94 00:06:16,640 --> 00:06:20,660 ‫This is what we call a declarative language. 95 00:06:20,660 --> 00:06:23,060 ‫School is a declarative language. 96 00:06:23,420 --> 00:06:24,980 ‫Now, what does that actually mean? 97 00:06:25,430 --> 00:06:27,140 ‫Well, let's dive a bit deeper into that. 9206

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.