SQL Joins

Full Transcript

n't

welcome back to our classes oriel in this video we're going to see how to combine data from multiple tables with the showing because of

I have a slightly mortified example tend to show you how we can display their country from a given author if you remember from our previous videos we saw the other unauthorized kept a reference of

so that's the way we combined the two tables

in this game what I have done is I have all soup worried big concert you've heard of it author and I'm including dot country inside also the template in order to showing in the page

well if you could if we reload decides

you will see that the conference included there asinine to share its basic building the ID off the represented countries

but what we want to do is display the actual name of the country so what we're going to do is

showing that I'm combined it too tables so for example if the country would eighty one is the United States will want to display the United census instead of system number one

so let's see how this showing works the first thing I'm going to do is commands are examples Pan Am Shamus right speaks humble twelfth

so we are going to take a look at the code

if you've checked closely the only thing that has changed here in this particular example is this sequel Korea we're riding the the other code pretty much remains the same we are fetching all the results from the database on them were rendering of him plead with those results so let's take a look out there template and we see that it's pretty common up pretty similar to what we had

for

so if I reloaded page where going to see that now we can

see the countries on the names of the countries of each one

authors

so again of the treat relies on this equals pavement we're riding we are shining the table offer with a table cow

three I wear indicating that relationship where combined that data basically think contrary to feel in the author's table combines with their ID feel from the country table

what we want to show you here is Todd's

fly on skis self aids a really powerful framework but Dave features of the

don here are all related to either Tyson or in this case sequel so to construct a good web obligation you are not sure

supposed to learn about class but also %HESITATION about special topics like in these cases that arises

and databases story and school

mmhm