Wednesday, 4 April 2018

Relational Tables lecture -15


hey as what's going on is clever taking and in this very we're going to be
learning how to data into my the skill database which has many to many
relational tables so this is what the basic syntax(Dallas Website Development) it looks like for
inserting so like innovating and doing data into my school tables so for the
insert we have answered into keywords followed by a table name and said the
around brackets who have columns spirit in common than we have a
keyboard called values and inside the round break we have values separated
by Hama and make sure to always in close your values into single quotes when
writing the code and right so the valley one is going to go and say call
them one and valley to is going to go and say column to and you can have as
many columns of valleys as you one next up his select and we have so I could
followed by a star if you want us like all the record from the so we have a
work called from a table named keyword was and then the column name equals
the value in closing single quotes and you can also have as many columns if you
want by and in then with a and keyword and then following that by color
named eagles value in closing the single quotes next what we have an update
table myself cured and whatever called me you want to have [UM] so you set
the valley of the column named equal to a new value in a cause that in a single
clothes and you can also have as many cans as you want by separating them by
common so you full of that by cannot a column and I'm not a value and then
you have where she worried and column and he calls value in a closing single
close to they share my school knows which exact columns to try to update how
do we have the elite delete from table name were column equals value and if
you in this part here so you could just right do it from a table is going to
india we all the records from your table so that's basically my ask also index
and that's all we're going to need for this video so what we're going to be
doing here is we're going to be inserting data which we're going to be
scraping from met movie data was [NOISE] calm and we're going to be in
sitting all the data in our database which we have created in the previous
video with many to many relational tables in it now the kind of a tricky
part is going to be inserting the data inside of these many to many with
tables and the way we're going to be doing this is inserting the movie I'd
as you can see all these three tables have movies and it also has directors
an idea which corresponds to the main primary key of the people's which movies
is linked to so for the directors has directors stars has starred idea and
join us have started our genres and the way the tricky part is knowing which

the movie is associated which you with which director and what movies associated
with a star and which movie associated with words john around and for that
we're going to be using a special function I cold my school I insert idea
which gets the last key of the movie which has been inserted into the
database so that how are we going to know which movie is associated with
which I'd because we're going to be getting the movie good which has been
inserted last so well if you guys don't have this do have just gone ahead and
go to quite a common click on this article here and I've been it I ask you
well source code down here had just copied the whole [SMACK] and you can go to
the stream I am in and one or databases go out to create the data was called
movies had created and then go to ask you well and just space the whole thing
there and quick so that way all the tables will be created and if you go to
movies database so you can see that all the tables are there so you're going
to need that and also going I need them the bees a scrape in the script
which we've created any other you know as well if you don't have that no
problem go to clay we're taking calm once again and click on this article
called was creating using page and I've included all the source code there
so just copy this whole source code and I become and to you pace this code
inside and you feel called scrape on the score I and be that PHP and later
on you're going to be able to include in your other file which we're going
to be used to insert data into my school database and when you just be
cared this so the first of all I want to show you guys what we're going to
be a

No comments:

Post a Comment