All language subtitles for Introduction To Databases.en_US

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 Download
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
fr French
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: WEBVTT 00:00.020 --> 00:01.940 Hello and welcome to this new section. 00:01.940 --> 00:08.030 And in this section we will be learning about how to use databases in a Python application. 00:08.030 --> 00:11.570 So in this section we will learn how to work with databases. 00:11.570 --> 00:17.870 And in this specific lecture we will learn what is a database and why exactly do we need a database. 00:17.870 --> 00:22.910 So in order to understand what a database is and why essentially it is required. 00:22.910 --> 00:24.470 Let's take a simple example. 00:24.470 --> 00:27.500 So let's say you want to design a social media website. 00:27.500 --> 00:33.620 So while creating that website, a social media website needs to have a data related to the user. 00:33.620 --> 00:39.320 Now obviously you first need to accept that particular data or information from the user, just as you 00:39.320 --> 00:41.930 would accept from a regular Python console. 00:41.930 --> 00:47.750 However, the problem here is that whenever you accept some information from the user in a Python program, 00:47.810 --> 00:52.220 that information typically gets destroyed whenever the program ends. 00:52.220 --> 00:58.640 However, we want this information to persist, and therefore we need to store that information somewhere 00:58.640 --> 01:03.320 so that the information remains there even after the program execution ends. 01:03.320 --> 01:10.430 So to make the data persist, we could store it into a file, or we could store it into a database. 01:10.430 --> 01:14.810 And we have already learnt how to store data in a file and the file handling section. 01:14.810 --> 01:21.320 Now, a better way to store data is storing that data into a database instead of storing that data into 01:21.320 --> 01:21.890 a file. 01:21.890 --> 01:27.380 So let's now compare the two options for storing data which is file versus database. 01:27.380 --> 01:33.560 So these are the major differences between storing data in a file and storing data in a database. 01:33.560 --> 01:36.440 So data which is stored in a file is unstructured. 01:36.440 --> 01:40.430 And data stored in a database is usually well organized. 01:40.430 --> 01:47.960 So whenever you save some data into a file, typically that data is not as well organized or as structured 01:47.960 --> 01:49.640 as it is in a database. 01:49.640 --> 01:56.390 Therefore we always go ahead and prefer a database to store information more than a file database. 01:56.390 --> 02:02.690 Enforce data integrity and files do not have a built in mechanism to enforce a data integrity. 02:02.690 --> 02:05.420 Now what exactly is data integrity? 02:05.420 --> 02:11.690 Let's suppose, for example, you want to accept a user's name and then save that name into a file or 02:11.690 --> 02:12.620 a database. 02:12.710 --> 02:18.770 Now in case of a file, what happens is if the user actually types in his name as one, two, three, 02:18.770 --> 02:26.060 four, the file has no way to ensure what kind of data it needs to accept, and the file will happily 02:26.060 --> 02:30.650 go ahead and accept one, two, three, four as the name of the user and it will store it. 02:30.680 --> 02:37.430 However, with databases, we could enforce a data integrity rules, which means that we could say that 02:37.430 --> 02:42.770 all right, as we want to accept the name of the user, the name of the user has to be in form of a 02:42.770 --> 02:44.600 string and it cannot be a number. 02:44.600 --> 02:50.270 So this rule enforces data integrity on the data which we store in a database, which is not possible 02:50.270 --> 02:51.320 in case of a file. 02:51.320 --> 02:56.990 Therefore, databases are a much more better choice when it comes to storing data, because databases 02:56.990 --> 02:59.450 automatically enforce that data integrity. 02:59.450 --> 03:05.660 The third point is data which is stored in a file can only be accessed and manipulated through simple 03:05.660 --> 03:06.530 I o operations. 03:06.530 --> 03:09.950 So let's suppose you have some kind of data which is stored in a file. 03:09.950 --> 03:15.560 So in order to access that data and manipulate that data, you could do that by simple input output 03:15.560 --> 03:19.850 operations, like reading data from a file and writing data to a file. 03:19.850 --> 03:27.800 However, the data which is stored in a database can only be accessed and manipulated using SQL or SQL, 03:27.800 --> 03:30.410 which stands for Structured Query Language. 03:30.410 --> 03:36.110 And this Structured Query language actually allows us to perform some really complex queries over the 03:36.110 --> 03:36.740 database. 03:36.740 --> 03:41.600 So whenever you have to access data in a file, that could be easily performed by a simple read and 03:41.600 --> 03:42.470 write operations. 03:42.470 --> 03:47.240 But whenever you are dealing with databases, you need to learn a special language, which is called 03:47.240 --> 03:48.860 as a structured query language. 03:48.860 --> 03:54.110 Now, the Structured Query language is a little bit more complex as compared to the standard read file 03:54.110 --> 03:55.040 and write file. 03:55.040 --> 04:01.520 However, SQL actually gives you a more powerful way to access and manipulate the data inside the database, 04:01.520 --> 04:06.110 and also enables you to perform complex queries on that database as well. 04:06.110 --> 04:12.050 And the final point is, databases are optimized for performance and files can be extremely slow to 04:12.050 --> 04:12.440 read. 04:12.440 --> 04:17.690 So when you are dealing with a very large amount of data of hundreds of millions of users, then in 04:17.720 --> 04:20.930 that particular case, databases are obviously more preferred. 04:20.930 --> 04:26.600 As databases are more optimized for performance, they are much faster as compared to reading data from 04:26.600 --> 04:26.990 files. 04:26.990 --> 04:30.440 So this was the major difference between a file and a database. 04:30.440 --> 04:34.220 Now let's focus on the question what exactly is a database. 04:34.220 --> 04:40.850 So a database is nothing, but it's an organized collection of structured information or data stored 04:40.850 --> 04:42.740 electronically in a computer system. 04:42.740 --> 04:44.000 So a database is nothing. 04:44.000 --> 04:48.200 But it's kind of like an organized collection of structured information. 04:48.200 --> 04:52.310 So the data or the information which is stored in the database is highly structured. 04:52.310 --> 04:56.180 And a collection of that structured information is a database. 04:56.180 --> 04:59.870 Now this is electronically stored inside a memory inside a computer system. 05:00.620 --> 05:04.340 And a database is controlled by a database management system. 05:04.340 --> 05:09.320 So whenever you use some kind of a database along with the database, you also have something which 05:09.320 --> 05:13.460 is called as a database management system or DBMs. 05:13.460 --> 05:20.000 So this database management system allows you to access the database, create database and perform manipulations 05:20.000 --> 05:22.040 inside that database as well. 05:22.280 --> 05:29.840 Now typically a database and a database management system combines together is called as a database. 05:29.840 --> 05:36.500 So remember that whenever we say database from here on, we typically mean the database itself combined 05:36.500 --> 05:38.630 with the database management system. 05:38.630 --> 05:45.260 Now once we have a basic idea of what a database is, let's now go ahead and understand how data is 05:45.260 --> 05:47.150 actually stored in a database. 05:47.150 --> 05:50.960 So data in a database is stored in a tabular format. 05:50.960 --> 05:55.970 So if you recall the data inside a file is not stored in a tabular format. 05:55.970 --> 05:59.870 It is typically written as we write some kind of text to a file. 05:59.870 --> 06:06.560 However data inside a database is stored in form of a table which looks something like this. 06:06.560 --> 06:10.250 Now a single database can contain multiple tables. 06:10.250 --> 06:14.660 So let's say we are creating an application for a school management system. 06:14.660 --> 06:19.580 And in that we want to store the information of students teachers, so on and so forth. 06:19.580 --> 06:25.550 So in that particular case, in order to store students information, we store that information inside 06:25.550 --> 06:28.070 of a table which looks something like this. 06:28.070 --> 06:30.440 So this right here is a database table. 06:30.440 --> 06:34.820 And inside of a database table you have these rows. 06:34.820 --> 06:38.090 And then you have these columns right here. 06:38.300 --> 06:43.730 And inside a row or inside each row we have information related to one student. 06:43.730 --> 06:50.120 And inside each column which we have, each column is actually identified by a unique attribute. 06:50.120 --> 06:54.530 So for example as in this case we want to store the information of a student. 06:54.620 --> 07:01.250 A student might have an unique ID, they might have name age, and they also might have address. 07:01.250 --> 07:07.460 So in order to represent this information we now create columns with respect to those attributes of 07:07.460 --> 07:08.300 a student. 07:08.300 --> 07:13.940 And then in order to save information related to that student, we create multiple rows inside this 07:13.940 --> 07:14.540 table. 07:14.540 --> 07:19.970 So right now this table only contains this single row which is for John. 07:19.970 --> 07:26.330 So John has an ID one, John's age is 19 and his address is New York. 07:26.330 --> 07:31.520 So each row inside our database table represents one entry. 07:31.520 --> 07:36.530 So if you want to add another student here you need to go ahead and create another row here inside your 07:36.530 --> 07:37.640 database table. 07:37.730 --> 07:42.320 So this is how typically information is stored inside a database. 07:42.320 --> 07:45.620 So inside a database you have a database table. 07:45.620 --> 07:49.400 And that database table is represented by rows and columns. 07:49.400 --> 07:54.650 So the column inside the database table represents attributes of the data which you want to store. 07:54.650 --> 08:01.220 So in this case as we want to store students data, the students attributes are ID name, age and address. 08:01.220 --> 08:03.320 And the rows which we have up over here. 08:03.320 --> 08:07.730 They actually represent the data related to each individual student. 08:07.730 --> 08:12.950 So this is how you could go ahead and store information of a student inside a database. 08:12.950 --> 08:19.670 So once you have a brief idea about how information is stored inside a database, now let's learn how 08:19.670 --> 08:22.880 we could access this particular information from the database. 08:22.880 --> 08:29.420 So as I earlier mentioned, whenever you want to read a data or manipulate data inside of a database, 08:29.420 --> 08:33.710 you need to use something which is called as a structured query language. 08:33.710 --> 08:36.680 So let's take the previous example of the student table. 08:36.680 --> 08:41.030 And let's say you want to access the information of a specific student here. 08:41.150 --> 08:45.800 So in order to access this information you have to write a special syntax. 08:45.800 --> 08:51.050 Or you have to use a special language called as Structured Query Language or SQL. 08:51.110 --> 08:54.470 So this is what the syntax of SQL looks like. 08:54.470 --> 09:02.720 So here let's suppose I want to get the age for the person or for the student whose name is Sean. 09:02.930 --> 09:09.620 So in this case I write a SQL statement which would say something like all right, select age from the 09:09.620 --> 09:13.460 student table where the name of the person is Sean. 09:13.460 --> 09:16.460 So don't worry if you don't understand this syntax. 09:16.460 --> 09:21.050 As of now we are going to learn how this syntax works in the lectures to come. 09:21.050 --> 09:26.060 So when you go ahead and when you write this particular statement and execute this, you're going to 09:26.060 --> 09:27.890 get an output as 19. 09:27.890 --> 09:34.490 Because this statement specifically wants to get the age from the student table for the entry where 09:34.490 --> 09:36.290 the name of the student is Sean. 09:36.290 --> 09:39.140 And therefore we got the age for that particular student. 09:39.140 --> 09:44.210 Now imagine if you have thousands of students here, and out of those thousands of students, you want 09:44.210 --> 09:46.490 to find the age of a specific student. 09:46.490 --> 09:50.330 You could easily do that by writing this SQL query right here. 09:50.330 --> 09:54.080 So SQL is also pronounced as SQL as well. 09:54.080 --> 09:59.630 So in this lecture we have learned the major differences between storing data in a file versus storing. 09:59.750 --> 10:00.890 Data in a database. 10:00.920 --> 10:06.830 We have also learned how exactly data is stored in a database by using database tables. 10:06.830 --> 10:11.660 We have also learned how to retrieve the data from a specific database table as well. 10:11.660 --> 10:17.420 So this was just a brief overview to give you an idea about how databases actually work. 10:17.420 --> 10:23.090 Now in the next lecture, let's go ahead and let's learn the different types of databases and database 10:23.090 --> 10:24.170 management systems. 10:24.170 --> 10:28.190 So thank you very much for watching and I'll see you guys in the next one. 10:28.190 --> 10:28.790 Thank you. 13860

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