All right.
So we're here to create that connection between the database and so you know between the police and
white and code.
So what we can do is we can create a new package.
Let's do that let's say in no so we already have sorry we already have to package out here in databases.
But we're here let's say a new trial.
We can just open it up and say this is for connecting
to escalate.
Right.
So we can have that and we can you know we can just work on it.
We just will we'll work on this quite naturally or we can just close it up.
Correct.
So in this particular connecting to escalate what we need to do is before the Fall need to import the
escalatory library.
So I hope we do that along with me.
So first you pulled the escalatory.
And then escalated three dot talked.
You need to use this connect which means to connect to a it later.
Now if the data exists well and good it will connect to that same database.
If it doesn't it will create a new one.
Let's get it up with cholesterol it or let me created this I'm creating you know the results of a school.
OK discretely so I can create.
So because I'm connecting I'm going to get a connection which I need to use whenever I want.
Let me say this connection help will help me to get something called a CASA so you can have a look.
So a connection Dacosta this Koso will help me whenever this particular Koso which I get from a particular
connection will help me whenever I want to point to a particular point in the table if I want to point
everything then I get everything to be pointed.
So this goes there's something there which guides me to all the entire database.
Right.
Or if you want to execute a particular staying you want to execute a particular queries then the cursor
is used for executing it by writing cursor dot cursor dot execute.
So that's where you're right.
This particular cursor comes in a user you have to execute queries that we need to fire.
So let's say for example in school I want to create a database I want to create a table of surance and
I want to create a table of teachers.
So what I need to do is I need to have a query so every school command is called a secretary right.
So I'm going to have a terrible string so that it's a multi-line string.
Ok so I'm going to say we here create
create table student write create table student.
Oh we're sorry.
So a student will have a role limbo will have a name Chenda.
OK.
And let's say gender and some general let's say it has DRP.
That's the data.
But so there's something which every student to now will have.
So you create this but then when you say that you also need to say what though what are the types of
the what are the data types of each of them role number is going to be in teacher.
Right.
One number is going to be one in Teacher Name is going to be RADICH at
20.
Gender is going to be again a lot of care.
But Lancair which consists of only one and dear Beacon's is still the right.
Our teacher the kind we can use any one of them.
So deal becomes is to date.
So there's a query we have fired the QUERIDO.
You've just written that in a string.
This particular query of course needs to every query and will complete with the semi-colon.
Now this particular query we need to fire we need to execute.
So when you say cursor execute Kraddick you say that course Rexy could query.
And also after you execute a particular query you can create another query for you know one for Student
1 for a teacher.
OK so I create a table.
One is
let me create in students students and teachers.
This time they will not have a roll number but they will have an ID.
They will have a name they love and they love it.
Yes.
So these are a few things so I'll execute that to curse or not execute and let me just fire a few.
Let me just fire a few commands where I need to keep batting.
I need to keep adding different students and teachers one after the other.
So let me say I just create new craze.
So let me say Querrey is you know insert into students and so did the students.
Well let me say I just want to insert a rule number you know named and gender for now I don't want their
well currently in the industry.
And so all of these values are going to be let's say 12 Qamar x y z.
Now that's in a double code.
That's why you need to have a triple core each of single over here as you can see each of these are
symbols so so that I can have a double code inside because the name strings and everything and an Escuela
requires a double code inside.
Otherwise you wouldn't be able to escape it.
Right.
So unless you put a backslash and Chander let's say the first one is male and we can close that values.
And of course put a semi-colon.
Of course after that you need to execute it.
So let's execute this query.
And from now on you can just copy both of these and keep executing them again and again for around 5
6 times.
Each of them over here.
This is sturgeons.
So all values roll number one can be 45 another can be 50 for this we can have 4 teachers straight.
So we can have teachers here teachers
teachers are going to have the name and gender ID name and gender.
So this is what teachers are going to have.
So we are going to copy paste that for four teachers.
Right.
So that's about students and teachers So here we have all the students being added.
The other one is an exercise student.
Another is a BQ you are there is a ABC OK and of course you're having one female or two females in teachers
you have you have a male sir.
You know you have a female teacher and again you have a male teacher.
So let's say you have you know x x u b w x y or something like that x y are not x you receive the q
r r SD.
And let's have this as DPF.
So you have these teachers being inserted.
Each of them have a different word ID 12 13 and 14.
OK so you're going to execute each of them.
But after you execute you need to come in that whatever has been done to this particular connection
needs to be committed or else the changes will be made connections that come at and after you do connection
that come out you can do a connection that close OK.
So this is quite quite a part about dealing with databases.
It's nice you can run this out when you run it.
Will be executed if you would like to have a look see that is a school for DP which is already open
in the database.
You know in the databases folder.
So where does the database folder the side it it resides in the colon by Chelm project's colon databases.
So if you want to open them you need to go to it's now in C.
So any change Eric treated the colon
colon data colon.
What does that equal.
And quite some projects ops by chum projects slash
databases.
So data bases right into the system.
OK so let me just enter into just my chum projects.
Let me see did I was not there.
OK so you have entered all in that there is one more Peacham projects.
So you need to go into quite some projects yet again.
OK so are there.
So is there something simple one it wants to fight and frailty is this.
Oh yes yes.
There is an advanced bited Fridays a CD had von Spuyten for I ot our
well there are no directory's as such.
We need to deal with them.