filmov
tv
How to join multiple tables in MySQL || MySQL Joins || Code With Neha

Показать описание
In my previous video of mysql series I have given a brief overview about Joins in mysql and how to simply join 2 tables in mysql
You can check the video from the above I button
Today I am going to show how to join 3 or more tables in mysql
So without any further delay let's get started
Today I am referring to a database named employee_info
Within employee_info database
There are 3 tables named employee,department and manager
Here in employee table emp_no is primary key
In department table dept_num is the primary key and dept_name is the foreign key
In manager table manager_id is the primary key and dept_num is foreign key
So let the query be to fetch emp_no,emp_name ,emp_address,dept_name,dept_city,dept_num and manager_name in one table
This can be done in 2 ways
1st by using joins
In this case we will select whatever we want to print
First write select leave spaces for the columns we want to print
From employee alias e
Join department alias d on that is the common attribute between this 2 tables so
Then write the columns we want to print that is
Select emp_no,emp_name ,emp_address,dept_name,dept_city,dept_num
From employee e
Run the query to see the result
So 1st we are joining first 2 tables
Modify the same query
Now we will join 3rd table
So inner join manager m
Now add another column manager name in select statement
Run the query to see the result
2nd method is parent_child relationship
Again select leave blank spaces for the required column output
From employee e,department d,manager m
Write the required columns in select statement
Run the query to see the result
that's all for today Hope you all will get some help from this video
If it's so then don't forget to subscribe my channel Code with Neha and press the Bell Icon for Regular Updates
See you in the next video till then Stay Safe Stay Happy
#SQLJOINS
#JoinsinSQL
#SQLJoinsTutorial
#SQLJOINSTutorialforbeginners
#SQLJOINQuerieswithExamples
#introductiontojoininsql
#Joininmysql
#sqljoins
#sqltypesofjoins
#sqljoinstutorialforbeginners
#sqljoinswithexample
#sqljoinsexamples
#SQLqueriesusingJoins
#SQLJoinqueries
#joins
#joinsindbms
#typesofjoinsindbms
#needofjoins
#joinsexample
#joinvssubquery
#typesofjoins
#howtojoinmultipletablesinmysql
#MySQLJoins
#joinmultipletablesinmysql
#mysqljoinsmultipletablestutorial
#joinsmultipletablesmysql
#mysqlserver
#howtoJoinMultipleTablesusingMySQL
#joinsmultipletablestutorials
#joinsmultipletables
#joinmultipletables
#MySQLjoinsmultipletablesinHindi
#mysqljoinsmultipletables
#sqljoinsmultipletables
#mysqljoinmorethantwotables
#howtojointhreetablesinmysql
#howto join3tablesinmysql
#howtojointablesinmysql
#howtojoinmultipletablesinmysql
You can check the video from the above I button
Today I am going to show how to join 3 or more tables in mysql
So without any further delay let's get started
Today I am referring to a database named employee_info
Within employee_info database
There are 3 tables named employee,department and manager
Here in employee table emp_no is primary key
In department table dept_num is the primary key and dept_name is the foreign key
In manager table manager_id is the primary key and dept_num is foreign key
So let the query be to fetch emp_no,emp_name ,emp_address,dept_name,dept_city,dept_num and manager_name in one table
This can be done in 2 ways
1st by using joins
In this case we will select whatever we want to print
First write select leave spaces for the columns we want to print
From employee alias e
Join department alias d on that is the common attribute between this 2 tables so
Then write the columns we want to print that is
Select emp_no,emp_name ,emp_address,dept_name,dept_city,dept_num
From employee e
Run the query to see the result
So 1st we are joining first 2 tables
Modify the same query
Now we will join 3rd table
So inner join manager m
Now add another column manager name in select statement
Run the query to see the result
2nd method is parent_child relationship
Again select leave blank spaces for the required column output
From employee e,department d,manager m
Write the required columns in select statement
Run the query to see the result
that's all for today Hope you all will get some help from this video
If it's so then don't forget to subscribe my channel Code with Neha and press the Bell Icon for Regular Updates
See you in the next video till then Stay Safe Stay Happy
#SQLJOINS
#JoinsinSQL
#SQLJoinsTutorial
#SQLJOINSTutorialforbeginners
#SQLJOINQuerieswithExamples
#introductiontojoininsql
#Joininmysql
#sqljoins
#sqltypesofjoins
#sqljoinstutorialforbeginners
#sqljoinswithexample
#sqljoinsexamples
#SQLqueriesusingJoins
#SQLJoinqueries
#joins
#joinsindbms
#typesofjoinsindbms
#needofjoins
#joinsexample
#joinvssubquery
#typesofjoins
#howtojoinmultipletablesinmysql
#MySQLJoins
#joinmultipletablesinmysql
#mysqljoinsmultipletablestutorial
#joinsmultipletablesmysql
#mysqlserver
#howtoJoinMultipleTablesusingMySQL
#joinsmultipletablestutorials
#joinsmultipletables
#joinmultipletables
#MySQLjoinsmultipletablesinHindi
#mysqljoinsmultipletables
#sqljoinsmultipletables
#mysqljoinmorethantwotables
#howtojointhreetablesinmysql
#howto join3tablesinmysql
#howtojointablesinmysql
#howtojoinmultipletablesinmysql
Комментарии