Transcripts
1. Introduction: This is the
introductory video of our M school class
in which you will know that what we'll be
learning in this class. So we'll basically start
with the data retrieval. How can we get the data? And then we'll learn
to filter the data. And after that, we can go
and figure out to sort the data and to limit
the number of the raws. And we can also play around
with the conditions, which will be used to get
the conditional data. And you'll also see the
other things as well. And this is what we're
going to learn in the first class of
our Mcal course.
2. Basics and Data Retrieval: As we are starting
our class now. So before going into
the learning zone, I want you to let you know
that what we will be learning. So for that, I've created
the table of content. So we going to start
with the introduction to my school in which we'll be learning about
the installing part, importing the database
and all that. And then we'll cover all the
topics that are listed here. And after these topics, we also have five more topics, so we're going to basically
end with creating ESS. Okay. So before going into the content of our
table of content, I just want you to
know some basics. So we're going to basically
start with what is database. So by definition, database is
an organized collection of our data so that
it can easily be accessed and managed
as simple as that. So if I put the database
in the simple verse, it's just like the place
where you store your data, and they're also the
types of database. So we have the two
type of the database. The first one is relational. And the second one
is non relational. And what is relational database? It is the database that organize the data in the Ras and
the columns format, which collectively
forms a table, just like the Excel file, and what is non
relational database? A non relational database
is a database that does not use the tableo
schema of Ras and columns. So in simple words, we don't use tables in
non relational database. So since we have learned about the basic concept
about the database, and what are the type
of the database. Now is the time to install MSCe. Okay. So before
installing the Micco, the first thing
that we need to do, we have to download this. Okay? So how can
we download this? I'm going to simply search
for M ske download here, and here you will be able
to see M school download, so we have to click here. And then what you need to do. So here you'll be able to see option of M school community. So we have to click here. And after here,
what we need to do, we have to install M
sche community server. So let's click here. All right. So as
I'm using the MCS, that is why I'm having this
on the operating system. But if you're using the windows, you'll get the windows here. Okay. So since I'm using
the MC with the arm tip, that is why I'm going to
simply download this one. But before that, if you
are using the windows, you're going to go here into the windows Microsoft Windows, and you'll be able to see the
option of MSI installers. So you can simply download
this and from there, we can install MCL. So now I go back and select
our operating system. And now click on this download. All right, so from here, I don't have to log in or sign up. I can simply download this
by clicking on this link. Okay. So now you can see this. We are downloading our Mico. So it's going to take some time. Al O M sche is being downloaded. So let's click here.
We have to open this. And now we have to install
this to the double click. Okay, now let's
click on Continue. And we have to click
on Continue again. Click on continue. Al. So if you wanted to
change install location, you can simply do it from here. So I'm going to go here
with the default location, so let's click on
install. All right. So here you can see
the two options here. The first one is strong
password encryption. And the second one is the
legacy password encryption. All right. So the first option is
basically recommended. So let's click on next. And now we have to add
our password here. And you have to remember that the password that
you're adding here, you have to add this
whenever you want to log in into your Mcle or
whenever you want to access your Miccle, okay? All right. So I would start
M school server later. So let's just finish
this. All right. So now Mischel is
being installed. So now what we need
to do, we have to put this installer into bin, and we have to start our
Miccle server first. So we have to go here
into system settings. And now you can see the
option of M score here. Okay? We have to click here, and we have to click on
Start Mickle Server. As our Muscle server is
basically working now. So now we need to test
this in terminal. So in the terminal, we're
going to test our mice. So for that, we're going
to write down macule and we'll use minus u here. So basically stand
for the user name. So as we know that the default
user name is the root, and now I'm going to
write down the P, and now you'll
simply hit the er, and then you have to
write down your password. All right. So now
you can see this, we are inside our M school, and our M school is
successfully installed. So now just test out the QE here so that would be
show data bases. We're going to use SMI column. I the ter, now you can see this, we have the data bases. So this is how we can
install M school. Also sometime we
get the issue of the path when we install M
school for the first time. So how can we resolve that? So if you're having that issue that whenever you're
writing down my school, and you get the error that
the command is not found. So for that, what you can do, the first thing that
you need to do, you have to look for a file So you basically have
to look for this file. Z as HRC. Okay? So if this file
is not installed, if you can't see this file, you'd basically have
to create this file. So how can you create this
file? That is really easy. You're going to simply
write down touch, and then you're going to write
down Z as HRC. That's it. Okay, I have to add the Z here. So you have to
create the file if the file is already not created. But if the file is
already created, but still you're
getting this issue, then what you can do You can
simply open up this file. For that, you're going
to write on open, and then you're going to write
down the name of the file. Hit the inter. Now
you can see this. We are having this text here. Okay. So at the top,
you can see this, we are having our M
school path here. So if this path is not added, you have to add this path. So how can you add
this or how can you get the path of Mike? That is really easy?
You're going to simply click on the spot. Search for the user here. And now you can see this folder, so you have to click here. And then you have to
go inside the local. Inside the local, you will find M school here since we
have installed this. Okay? So we're going to go
here inside the M school, and here you can see the Bin. Okay. So now what we need to do to get the path of our M school. You simply do the
right click here, and you can see the option
of copy Bin as path name. But if you can't see this path
here, what you need to do, you have to simply
click on the view here, and here you can see this
option here of path bar. So you have to enable
this from here first. Then after this, you can simply
copy the path from here. Copy the path from here,
then what you can do. You simply put this
here after here. So you would simply
push this here. Okay? So you have to write
down this text first, and after this you have to write down the path
of your M school. Okay, so after doing this, what we need to do, we
have to reload the file. So how can we reload the
file? That is really easy? You just simply write
down source here, and that would basically reload our file on current terminal. And after this, the path
of M score will be added, and then we can simply access our M score the way we take. Since we have installed
M school on our laptop, now is the time to
have user interface to practice our QCs
of the M school. So that is why we're going to install M school work Pinch now. Since we have installed Mce. So as we know that
it will be really difficult to learn M school
just in the terminal. So that is why we're
going to install user interface software for MC, that is basically called
M school work Pinch. Okay, what we can do, we can simply write down
M SQL download again. And here you have to click
on MSchol downloads. And now you'll be able to see the option of MCL community. So we have to click here.
So now you can see here, when we're installing M school, we had click on My
School community server. So right now we have
to install WQinch, so I'm going to
simply click here. And here you have to select
your operating system. That would be
automatically done. And here you can see
two options here. So we have the two files here. So the first one
is basically for the McBooks that
use in tail chip, and the second one is
for the Macbooks that use rm chip or the
M one or the M two. So I have the Mc
with the M one chip. So I'm going to
simply download this. And now we have
to click on here. And that would simply download
our M school work Binge. So we just have to
wait a bit for this. All right, so the work
pinch is being downloaded. So let's click here, and now we have to click on our work pinch. And now you can see here,
what we need to do. We simply have to drag our M school work pinch
into the applications. And that was simply install
our M school work pinch. So we have installed this. So after this, what
we need to do, let's just close this
and close this as well. All right. So now
what I need to do. I have to click on our
M school work pinch. Let's click here. Let's just
click on our local instance. So here you have to write down
the same password that you have written down when we
were installing Mcule. Okay? So you basically have
to remember that password. Click on Okay. All right,
so I can see this. We are inside our
Mice work page, and this is how it looks. So let me try
something simple here. So I simply have to write down, show data bases, and
I'll just run the QR. And now you can see this. We
have our data bases here. So this is how we can
install Mikel work pinch. After installing Michel
work pinch on our laptop, now we need to learn how can
we improve the database. All right, so now
our tools are ready. So now we need some data
that we can use in our MCL. Okay. So for the data, I'm going to use Gagl. I will get the data from there
because they really have a good amount of the datasets that you can use it
for the practice. So first, we're
going to go there. So you can basically
get the data from anywhere that is
totally your choice, but I'm going to go here
with the Cagle. All right. And I'll simply click
here on the data sets. And from here, you'll
be able to see a lot of the different data
sets here that you can use for the practice
on your M school. Why I'm preferring this because each data set has a good
amount of the data. So that would really help you to understand the
concepts in M school. So here, I'm going
to simply go here with all unicorns in the world. So let's click here. I'm
going to download this. Okay. So let's click here. All right, so you can
see here that we have a list of unicos in the word. We have the CSV file, but sometimes you get
the excel file format. Just like this,
you can see here, we have cel SX, but sometimes we get
the excel sheet form, but then you can simply
convert this into the CSV. That is not the problem. Okay.
So now what we need to do, we simply open up our work page. And since I've already
opened this up, so how can we import
our database or how can we import the CSV File
Eno M school work Pinch? So the first thing
that you need to do, you have to click here on to create a schema
that you can see here. So let's click here. So here, I'm going to write down
Unicor DB. Schema. All right. Now let's click on Apply
and click on apply again. Close this. Now
you can see this. We have Unic Schema A. And what is the schema? I think we already
know the difference between database and the schema. Okay. Now what we can do
to import our CSV file. Let's just do the
right click here, and you'll be able
to see the option of table data import Viz. Okay, we have to click
here, and from here, we have to browse and from
here what we need to do. We just have to click
on our CSV file. Okay. Let's click
here. Click on Open. Now let's click on next. All right, so we're
going to create a new table because we don't
have any existing table, so let's click on next. All right. So these are the columns that we
have in our table. So if you wanted to remove any
of these column from here, you can simply uncheck this from here and it won't be
included in the table. But I want to include
all the columns here. So I'm going to simply click
on next and click on next. And this would basically
import the data that we have in the CSV
file into our table. So let's click on next now. So now you can say this. We
have 1233 records imported, so let's click on finish. So now if I click on the tables. All right. So now
I'm going to simply open up new SQL file. All right, so now
what we can do here. Okay, so the first thing
that you need to do whenever you are opening the work pine for
the first time. So if you don't know
about the databases, what are the databases
that you have? What you can do, you'll
simply write down, show databases, and you'll
use the semi column. And then you'll simply
click on this icon here. All right, so you can see
here we have successfully imported our unicorn schema. So this is how we can import the database into our
M school work page. Now, don't you think that we should start learning
about the M school? So the first thing that
we're going to learn is, how can we retrieve the data
with the select statement? What is select a statement? So select a statement basically help us to retrieve the
data from our table. Okay. So consider
this that we are having a table in which
we have the four columns. And in these highlighted sales, we have our data. All right? So if I wanted to retrieve
the data from my table, I will basically use
select statement. Okay? So this is the syn text
of the select statement. First, you're going
to write down select. And after that in the blank, you will basically
write down the name of the column that you want to
receive from your table. Okay? So you can receive
a single column. You can receive the two column, you can receive the three
column. In the blank. You will basically write down the name of the columns
that you want to see. Okay? So you can basically retrieve the data of one column, two column, three columns, and also all the columns
that you have on your table. Okay. So now we're
going to learn how to retrieve the data
from our table. So the first thing
that you need to do, you're going to write down
the name of your table. Okay? So for instance, we have the users table. So if I wanted to
retrieve the data from all the columns that
I have in my table, I will basically use the astik or the star
that you can see here. So this will basically
give you all the data that you have on your
all number of columns. Okay? But if you want
to go specific here, if you just wanted
to have the data of the name and the e mail, then what you need
to do, you'll simply write down the name
and the e mail column, and you need to
separate them by coma. Then you will only able to see the data of name and e mail. In a similar way, if
you just want to get the data of the ID
and the phone number, you'll simply write
down ID and phone. But one thing that
you have to make sure that you have to use the exactly same names of the column in your
SQL Qi. All right. So now I'm going to demonstrate you all the things that
we have learned now. So now we will demonstrate a select statement
in MSc workbench. Before learning to
retrieve data with select, we have to learn some basics that we will use in our mice. Okay, the first thing is this, whatever you write down in
Mice is considered as a Q. So if I just write down, show data bases, and
if I just run this, so this is a kind of a Q. And if I just write down, use. So I want you to
use Unicorn schema. And in the last, we will
simply use Semicolon. Okay, so this is also a Qi. So if I just run this,
now in the M school, we're basically using
our unicorn schema. So now, whatever the tables that we have in the Unicorn schema, we can simply use this
in our Q. All right. So right now in our schema, we only have a
single table, okay? And one thing that you have to remember that in a
single database, you can have multiple
number of tables, and those tables can have a relationship
between each other. Okay? But we're going to
talk about that later. But right now, we have to learn how to retrieve the
data with select. Okay, so this is our
table. You can see this. The name of the table is list
of unicorns in the world. Okay. So now what we do, we simply write down. Select a statement. So how do you use the select statement? Is pretty symbol, you'll
simply write down select. And after this, you
will write down the name of the columns
that you want to retrieve. So right now, I want to retrieve all the columns
that we have in our table. So for that, we have a
symbol that we can use directly without writing
down all the column names. That is basically a star or we also call
it at the asterk. And after this, what I need to write down,
I will write down. From and after this, I will write down the
name of the table. Okay? So here, we're going to write
down name of the table. So that will be list of
unicorns in the world. Okay. So now you can see this. We are actually
having an error here. You can see this
cross icon here. That is because in our table
name, we have the spaces. And that is not a good practice. But since we already have it, now what we can do to access
the data from this table, we'll simply use the bates, And now we won't have
any issues with it. And now if I just write
down a semi column here and run the Qi you'll be
able to see our data here. So this is how we can retrieve
the data from the table. Okay. So now you can see this. We have these three
queries here. The first one is to show
databases and the second one in which we are
simply using a database. And in the last one,
we are retrieving data from a table from the database that we have
selected. All right. So one thing you have
to make sure is that, how can we separate
multiple queries? So we can simply separate
them by using Semi column. So if I just don't use
a semi column here, you can see this, we are
having the error here. So that is why if you want to separate out the
multiple queries, you'll use Semi Column. Now, we have to learn
about one thing that you can see
these two icons here, this one and this one. So we basically use this one to execute a single statement
or a single uri. Okay. So how does it decide which query this
is going to execute, it basically decide based
on your keyboard cursor. So you can see this
our keyboard cursor is on the second es statement. And if I put this on
the first statement, it will execute this
first statement. If I put this on the second one, this will execute
the second one, and if I put this
onto the third one, this will execute the third one. So now, for example, if I wanted to put this
on the second query, and I'll simply click here. And now you'll see our
database has been selected. And now if I wanted to see the databases that
we have in our Mcle, so I'll simply click on Show
databases and click on here. You will be able to
see all the databases that we have in our my school. So as we know, this one is
used to execute single query, but what if I wanted to execute
all the queries together? For that, what we can do, we'll
simply click on this one. So I just click on this one. You can see this. It will be
executing all of the things. So you can see this, we
have the databases here, and we have our data here. Right, let me try to use select statement with a
specific number of columns. Okay. So now here, what
we're going to learn, if I only wanted to see a specific number of
columns in my table. So if I only wanted to see
just like the company, the company, and the country. So what I would do,
I'll just simply write down company and I'll
write down city. And we will have the
same sentence here. We can write down
from, and after this, we'll write down the
name of the table. So let me just copy
this from here. And we will use a semi
column. All right. So if I just click
on this icon now, you'll be able to see each
of our QE is executed. The first one show databases,
and in the second one, we wanted to see all the number of columns that we
have in our table. And in the last one,
we actually wanted to see company and the city only. Okay. So that is how we can go here with a specific
number of columns. So I I just write down, country here and execute
only this query. You'll be able to see we're only having the table with
the three columns. So it only executed this last Q. Okay, so now, you know the
difference between both of these icons and what
is the Q and how can we select all number
of columns that we have in our table and also
the specific number of columns in our table. But one thing that is bothering me is the name of the table. I would basically
like to rename this. Okay? So how can we do this? That is really simple? I will just simply
write down rename. Then I will write down the name of the
table that we have. Okay, so after writing down
the name of the table, I will write down two,
and here we're going to write down the new name of the table that
we want to have. So that would be simple
list underscore Unicorns. Okay? So that would look fine, and we have to add semi coolumn, and we have to do
one thing here. I have to add table
keyword here. Okay, now we'll only
execute this query. So let's select this
one and click here. Now you'll be able to see here. Okay. So let me excavate
a space here. All right. So now at the last,
you can see here, we have renamed the
table from list of unicorns in the world
to the list unicorns. And you can also see
this here in the tables, but you would have to refresh the M school work page, maybe. Okay. So now let's just
remove all of these things. I'm going to remove this Qur. We're going to remove this one, this one, and
everything from it. And I'll just run this cury. We will basically have the error because we have changed
the name of the table. So I have to use
the new name here. So that would be List unicorns. All right. So I just run this Qure and now we
will have our data. All right, so this is our data. So this is how we can retrieve the data with select statement. After learning to
retrieve the data, now we will learn how can we filate the data with a clause? I'm sure that now you have a good understanding of
the select statement, and how does it help us
to retrieve the data. But one thing that you
would have noticed while using select
statement that it basically gives you all the data that is
available on your table. Now you might be having
a question in your mind, then how can I filter the data? So the answer of this
question is the clause. So a clause simply helps you to filter the data
beast on your conditions. Now, let's imagine that we're
having the users table, and we have the
four columns in it, and we are having this
dummy data into it. Now, what do we want, you want to filter the data. You want to have
the specific data based on the conditions. Okay? So for instance, I want you to have
the data of the hake. Okay, so how can I do this? But before that, we have to understand the synex
of the clause, and where do we use it? So we use the are clause after the name of the table that we use in the
select statement. And you would be wondering why we are using the
select statement, Because how do we
filter the data if we haven't retived the data
with a select statement? So are close has to be used
with a select statement. It doesn't have any
use without it. Okay? So we put the are close after the
name of the table. And after the are close, we basically write down
the name of the table that we want to use
to filter the data. And after that, we
simply use the value. Based on that, we want
to do the filtration. Okay? So if I wanted to have
the data of the Jackie, I'll simply write down
the name of the column, that is basically name. And after that, I will
simply write down the value. That is in our instance, Jackie. Okay? But one thing you have to notice here that in
the select statement, we only wanted to receive the data of name and the e mail. So when we run the uri, we will only be able to receive the name and the
e mail of the Jackie. Okay. But if you wanted to
have all the data of the Jake, then you will simply use the estic estate of the
name of the columns. Okay? So that is how
the wear clause work. But if you still have
the dows, don't worry. We're going to demonstrate
this now in our work bench. I have imported more database
here online Fd schema, because I wanted to have the
table with some null values. Okay. So how can we
filter the data with a clause as we are already familiar with the
synex of the are clause? So now, what we need to do? First of all, we have
to use the schema, so we're going to
write down All right, so we have to run this query. All right. So now
what I need to do? I have to write down
select star from. Okay. So the table that we have in the Online food
schema is online foods. Okay? So we're going to
write down online foods. Okay? So let's just
run this query, and you will be able
to see the data that we have in our table. Okay. So how can we filter the data based
on the a clause? So first thing that
we have to do, we have to add a clause
after the name of the table, and after this, I'm going
to put my condition. Okay. So I wanted to select all
the people who are single. So I'm going to write down
the name of the column. So I will need to add the
Betas because we have a space in the name of
the column. All right. So where the merital
status is equal to single. Okay? We're going to
use the semi column. Now let is run this Qury. All right, so I've
done a mistake in the name of the column, so that is I have to
remove the I here. Now lets run this again. And now you'll be able
to see we're only getting the people
that are single. So in a similar way, I can simply change the value
here to the merit. So let's run this again. And now you'll be able to see only the people whose
marital status is merit. So now I wanted to
have the people that are basically below
than 25 in an age. So I'm going to write
down the age here. And here what I would do. Okay. So I'll simply use the
less than sine and use 25. So that would simply return all the people that are
basically below then 25. Okay? So let's run
this query again, and you'll be able to see only the people that
are below then 25. Okay, so that is
how we can use the were clause to filter the data. Okay, so now we can also get the value of a
specified column so. So for example, I
would go here with H, and I will go here with gender and then we can go
here with occupation. All right. So let's just
run this query again. And now we only be able to
see the three columns here. So this is how we can
use the ad clause. And what we can do here, we can also filter out the
data based on null values. Okay, so we can also do the filtration based
on the null values. Okay? So how can we do this? So first, I would
simply go back here, and I would actually select all the columns and
run this again. Okay. So now I wanted to
do that I only wanted to get the people whose monthly
income is basically null. Okay? So how can you do this? It's really easy. You'll simply write down the name
of the column, that is monthly income, and you have to
write down is null. Okay? So that will basically
return as all the people. Monthly salary is
null in our table. Okay? So let's just run this again. And now you can see this. We are getting all the
people whose monthly income or the salary is basically null. And I can also do
the opposite thing. So if I wanted to get all the
values that are not null, so I'm going to simply
add not null here, and it will retain us all the
people with monthly income. So let's just run this again. All right, so as you can
see is we don't have anyone with the
monthly income, null. Okay? And there is one more
thing that we can do here. We can use inequality sign. So for example, if
I just remove this, so for example, I wanted to get the people whose
occupation is a student. Okay? So let's just write
down occupation is equal to. Student. Let us Run this. And now we will
get all the people whose occupation is
basically student. But what if, if I wanted
to have all the people, whose occupation is
basically not a student? So that is where I can
simply use inequality sign, and that will return us all the people whose
occupation is not a student. So we'll basically get all
the values except student. In the occupation
column. Let us Run this, And now you'll be able
to see that we are getting self employed
and employees. We are getting house wive,
and you can see this. We are getting all the different
values except student. And that is how we can use
inequality sign in are close. Okay, so I need to ask you what it tough to
filter the data. Now I have something
easier for you this time. So now we're going to
learn about how to sort the data with order Bi. Since you know how to
use the are close, and how can we put the
simple condition with it? Now is the time to
learn about order by. So basically, it will help
you to sort the data. All right. So now, just imagine that we are
having our users table. And you can see here
that at the top, in the name, we
are having Edward. And after this, we are having
Michael, and in the last, we are actually having K.
So now you can see here that we really don't have the
data in the sorted format. Okay. So now we're going to do this with the
help of order by. But before that, we
have to understand the sent text of the order by. So just like the clause, It will be used
after the name of the table that we have
in our select statement. So you're going to simply
write down order by, and then you'll write down
the name of the column. Based on, you want
to sort your data. But you have to make
sure one thing here that order by can be used
along with the close too. So whenever you are using
it along with the clause, then it will be used
after the clouse. It means that after the name of the table of
the select statement, you will write down the
close and the condition. And after that, you will write down the order by and
the name of the column. You don't have to
worry about this. We're going to demonstrate
this in the work pinch. Okay. So for our instance, we want you to sort the data by name column. So
now, what do I do? I just simply write down the name column
after the order by. And before that in
the select statement, I can simply choose to see the number of the
columns that I want. So for now, I just want to
see all the columns here. All right. So when
I run this Qury, this will be the result
that we will get. Now our data is sorted in the ascending order based
on the name column. Okay, now you can see here, the first thing that
we have is a gate. After that, we have the Edward, then we have the Marco and
the Michael and the Jackie. Okay. So by default, when you use the order by, it sorts the data in
the ascending order, but you can also sort this
in the descending order. You don't have to worry about
this because now we are also going to demonstrate
this in our workbench. Okay, we are using Unicorn schema in sorting the data because I
think the data that we have in the table and Unicorn schema can
actually help us to understand better
about sorting data. Okay? St write down our
select statement first, all sleet run this.
Now you can see this. We have our data of
List Unicorn table. So now what we'll
do, we'll basically sort the data with order by. Okay. So I'm going to
write down order by here. After that, you have to
write down the name of the column on which you want to sort the
data of the table. So the first thing that
I want to do is to sort the data based on
numerical column. It simply means the column
that has the numerical values. I think I can go here with
my unknown column here. I'm going to write down
my unknown column, and then what I will do, I just simply run our Qury, and you'll be able to
see no difference here. The reason is when we
use order by by default, it sorts the data
in ascending order. And since we have
used unknown column, and you can see this,
that was already sorted in ascending
order by default. If I wanted to change this into descending order,
what I can do here, I'll just simply write down D E S C. And if I just
run the Q again, now you'll be able to see
we are having our data in descending order based
on my unknown column. That was the numerical
column that we use, and now what we will use, we'll basically use Alphabetic
column. So let's see. I think I would go
here with the company. I'm going to write
down. Company here and let's just run the query. And now you can see
this, we sort the data based on company column
in descending order. But if I wanted to have
this in ascending order, what I can do here, I
can simply remove this. Now it will sort the data in
ascending order by default. But if you still wanted to
define that, what you'll do, you'll simply write down as C. That simply means you want to sort the data in
ascending order. Right now, I'm going
to simply remove this. So let just run
this query again. And now we can see
this, we sort the data by company in ascending order. So that was the
idea of order by, and we can also sort the data
by using multiple columns. How it's going to
work. Let me show you. So the second column
that I want to use is basically country. So let's just run this,
and it will basically sort the data by company
and country column. You won't be able to see so much difference with
both of these columns. So that is why I'm going
to use country column, and we're going
to use CT column, for sorting the data. So that will give you a
better understanding. So first, we're going
to write down Okay, so let me just remove this, and we're going to
write down city here. Okay. But first, let's just
go for the country only. So let's run this.
Now you can see this, we are having Australia, and you can see
this in the city. We are having Sydney, then
we are having Melbourne, then we are having Say Hills. So there's no order basically
in the city column. But if you want you
to have the order, you simply write down City here. So It's just run the Qi again. Now you can see
this in Australia, and also in the city, we are having a
sending order. Okay. So how does it work when we use two columns to sort the data? So basically, it will
just work like this, that it will try
to sort the data based on the first column
that we have is the country. But when we have the duplicate
value in our first column, it will try to sort the data
based on the second column. So I can see this in
our first column, we are actually having Australia
for the multiple times. So that is the
duplication of the value. So in such scenario, it will basically sort the
data based on the city column. So you can see
this, we are having Alexandra, we are
having Brisban, we are having Melbourne,
and after this, we are having the Richmond
and the other cities. So that is how it works. But if I put this in
descending order, So now how this going to work. First, it will try to sort the data in ascending
order by country. But when we are having the duplicate values
in the first column, it will try to sort the data in descending order by city column. So that is how it
works when we try to sort the data based
on multiple columns. Okay, let's just run this now. And you will see that we
are having Sydney now, and after this, we are having Surry Hills then
the other values. And now in cities, basically, you are having descending order, and in country, you are
having ascending order. But the first value you can see here we are having Argentina, and then we are having
the name of the city. That is really
difficult to pronounce. Okay. But you can see here
that based on the first value, we can see this, it is
basically not in any order. But actually, it is working
because I told you first it will try to sort the
data on the first column. And when we're having the duplicate values
in the first column, then it will try to sort the data based on
a second column. So that is why you
can have a kind of mix of the data on
the second column, but that is the idea of it. Okay. So I can also use
the descending order in
3. What's Next?: Congratulations on
completing the first class of the M school course. And I know now you'd have the solid understanding on
the basics of the Micol, and you also might be curious that what we will learn
in the next class. So the next class is
about the manipulation and the management of the
data in the M school. And I will be publishing
this really soon or it might already be published at the time when you're
watching this video.