How to Join two or more than two Tables using multiple columns | How to Join Multiple Tables

  Рет қаралды 135,127

The Data Millennials

The Data Millennials

Күн бұрын

Пікірлер: 67
@nsangchat3529
@nsangchat3529 2 жыл бұрын
OMG you are a god !!! I have been looking at minimum 10 videos and yours are the most CLEARLY illustrated ONE !! Thanks a lot
@thedatamillennials
@thedatamillennials 2 жыл бұрын
@N Sangchat, Hope you are well and I am Glad that our video was helpful . Request you to please help us to reach out to all of those people who might want to learn something new by sharing our content. And Request you to please subscribe our channel to learn more about such topics In case if you are struggling with any topic, Please connect with us on the below given email id and we can connect over a quick google meet call and help you to resolve it. Email Id:- master.datamillennials@gmail.com
@justintunley8347
@justintunley8347 Жыл бұрын
Extremely helpful
@thedatamillennials
@thedatamillennials Жыл бұрын
apologies for the delayed response. I am Glad that our video was useful and helpful . Request you to please check out our other videos of Excel, SQL and Google data studio ( Looker) and also please help us to reach out to all your friends and family members who might want to learn something new by sharing our content. And Request you to please subscribe our channel to learn more about such topics
@glorygabriel2862
@glorygabriel2862 2 жыл бұрын
Explanations are so clear. Thanks a bunch, I understand it clearly now. Please make a video for full outer join
@thedatamillennials
@thedatamillennials 2 жыл бұрын
Hi Glory, I am Glad that our video is helpful . and i believe outer join explanation is uploaded in the sql playlist Request you to please help us to reach out to all of those people who might want to learn something by sharing our content. And Request you to please subscribe our channel to learn more about such topics *In case if you are struggling with any topic, Please connect with us on the given email id and we can connect over a quick google meet call and help you to resolve it.
@roi_4_dayz
@roi_4_dayz Жыл бұрын
Great tutorial. Thank you for your help!
@thedatamillennials
@thedatamillennials Жыл бұрын
HI @roi_4_dayz I am Glad that our video was useful and helpful . Request you to please check out our other videos of Excel, SQL and Google data studio ( Looker) and also please help us to reach out to all your friends and family members who might want to learn something new by sharing our content. And Request you to please subscribe our channel to learn more about such topics
@alexg97343
@alexg97343 2 жыл бұрын
Fantastic fantastic you explained this so clearly please continue dropping videos. I am subscribing
@thedatamillennials
@thedatamillennials 2 жыл бұрын
Hi Alex, I am Glad that our video was helpful and you have subscribed our channel. *Request you to please help us to reach out to all of those people who might want to learn something new by sharing our content.* In case if you are struggling with any topic, Please connect with us on the below given email id and we can connect over a quick google meet call and help you to resolve it. Email Id:- master.datamillennials@gmail.com
@kaustubhbandewar9815
@kaustubhbandewar9815 Ай бұрын
I have to connect 7 tables. How should i identify, which table to consider first in left join ? Also in a data model, if table B has 2 connections table A and table C with same xommon key whixh should i join first ? Thanks 🙏
@thedatamillennials
@thedatamillennials Ай бұрын
When performing multiple JOIN operations across several tables, the order of joins can significantly affect the outcome. you can identify which table to consider first in a LEFT JOIN and how to handle a situation where a table has multiple connections by keeping the below mentioned points in mind:- 1) Start with the table that contains the most important or primary data for your query. This is often the table with the majority of the data you want to retrieve. 2) consider starting with the table that has the most rows. This allows you to ensure you’re capturing as much data as possible in subsequent joins. On you another question regarding data model :- If Table B connects to both Table A and Table C using the same common key, the choice of which table to join first depends on several factors like 1) Foreign Key Dependency ( Join the parent table first: If Table B has a foreign key relationship with both Table A and Table C, but Table A is conceptually a parent of Table B, you would typically join Table A first.) 2) Cardinality - If Table B has one-to-one or many-to-one relationships with Table A and Table C, prioritize the table with fewer duplicates or fewer rows to reduce the possibility of incorrect data duplication. For instance, join the table with fewer rows or the one representing a higher level in the hierarchy. One last thing that i can suggest you is to consider the business logic or reporting requirements. If your query needs data from Table A more than Table C, prioritize joining Table A first.
@danielalejandrorobayo4630
@danielalejandrorobayo4630 Жыл бұрын
I noticed that all the 3 tables had the same key "roll_no", so it's somehow easy. However, what happens for example when table 1 and 2 has a common key, and table 2 and 3 have a different key, how to relate table 1 and 3 in this case?
@thedatamillennials
@thedatamillennials Жыл бұрын
In that case you have to get the output by joining table 1 and table 2( lets say output 1 ) and then you have to get output by joining table 2 and table 3 ( lets say output 2) and then you can relate output 1 and output 2 using the common key . you question is quite good and i think i should create a video on this question. i will upload a video on your question and share the link here in the comment.
@Radhe_kanha0
@Radhe_kanha0 2 жыл бұрын
Well explained.
@thedatamillennials
@thedatamillennials 2 жыл бұрын
HI @Neha Jha, I am Glad that our video was useful and helpful . Request you to please help us to reach out to all your friends and family members who might want to learn something new by sharing our content. And Request you to please subscribe our channel to learn more about such topics
@DilipKumar-ch5uu
@DilipKumar-ch5uu 2 жыл бұрын
This is perfect ❣️
@thedatamillennials
@thedatamillennials 2 жыл бұрын
Hi Dilip, I am Glad that our video was helpful . Request you to please help us to reach out to all of those people who might want to learn something new by sharing our content. *And Request you to please subscribe our channel to learn more about such topics*
@abhishekmahapatra4270
@abhishekmahapatra4270 Жыл бұрын
Thank You Sir. Concept is very well explained.
@thedatamillennials
@thedatamillennials Жыл бұрын
HI @Abhishek Mahapatra, I am really Glad that our video was useful and helpful for you. Request you to please help us to reach out to all your friends and family members who might want to learn something new by sharing our content. And Request you to please subscribe our channel to learn more about such topics
@ToLoHasso
@ToLoHasso 2 жыл бұрын
One Question If i need to print the name and percentage that they got from the same data how we can write the query for the same??? Please reply fast i am very curious
@thedatamillennials
@thedatamillennials 2 жыл бұрын
HI @To Lo Hasso, Apologies for delayed response. Below is the query which you have asked. #use youtube_example; select final.name, final.class, sum(final.Marks) as total_marks, concat(round(((sum(final.Marks)/500)*100),0),"%") as student_percentage from ( select sd.Roll_No, sd.class, sd.name, scd.Course_name, smd.Marks from student_data as sd left join Student_Course_Data as scd on sd.Roll_No=scd.Roll_No left join student_marks_data as smd on(sd.roll_no=smd.Roll_No and scd.Course_name=smd.Course_name) ) as final group by 1,2 ;
@thedatamillennials
@thedatamillennials 2 жыл бұрын
@To Lo hasso, Request you to please help us to reach out to all your friends and family members who might want to learn something new by sharing our content. And Request you to please subscribe our channel to learn more about such topics In case if you are struggling with any topic, Please connect with us on the below given email id and we can connect over a quick google meet call and help you to resolve it. Email Id:- master.datamillennials@gmail.com
@sharoonhoney1054
@sharoonhoney1054 Жыл бұрын
Outstanding explanation 😃
@thedatamillennials
@thedatamillennials Жыл бұрын
apologies for the delayed response. I am Glad that our video was useful and helpful . Request you to please check out our other videos of Excel, SQL and Google data studio ( Looker) and also please help us to reach out to all your friends and family members who might want to learn something new by sharing our content. And Request you to please subscribe our channel to learn more about such topics
@sharoonhoney1054
@sharoonhoney1054 Жыл бұрын
@@thedatamillennials acknowledged 🥰
@thedatamillennials
@thedatamillennials 11 ай бұрын
thanks
@arunajain9515
@arunajain9515 10 ай бұрын
why to use left join twice cannot we get the answer only with second left join
@thedatamillennials
@thedatamillennials 9 ай бұрын
i have used two joins to give a taste that how you can join two or more than two table at once
@leecallaghan4625
@leecallaghan4625 Жыл бұрын
good day . i have an issue with my leads platform . when i enter a lead it says it already exists . i wa looking into this issue and found that it maybe an issue with a DUPLICATE KEY . does anyone have any idea .
@thedatamillennials
@thedatamillennials 11 ай бұрын
you have the issue with primary key, let me know if you are still facing the issue
@gayatrichaudhari4306
@gayatrichaudhari4306 Жыл бұрын
We can use distinct keywords for marks
@thedatamillennials
@thedatamillennials Жыл бұрын
yes you can use
@m.a.s3072
@m.a.s3072 9 ай бұрын
If you change a record or some data in one table does it change in all the tables that reference it?
@thedatamillennials
@thedatamillennials 6 ай бұрын
no , it only changes the specific data that you have change.In case if you are struggling with any topic, Please connect with us on the below given email id and we can connect over a quick google meet call and help you to resolve it. Email Id:- master.datamillennials@gmail.com
@pradeepravi9608
@pradeepravi9608 2 жыл бұрын
Sir can we use where condition in left join
@thedatamillennials
@thedatamillennials 2 жыл бұрын
HI Pradeep, Yes you can use where condition in Left join. after joining the table you can use the where clause on left table's Column. For example suppose you have 2 table -- table 1 and table 2 and your table table1 is your left table then you can use the where condition like this Select t1.col1,t1.col2,t2.col3 from table 1 as t1 left join table2 as t2 where t1.col1="condition". In case if you are struggling with any topic, Please connect with us on the below given email id and we can connect over a quick google meet call and help you to resolve it. Email Id:- master.datamillennials@gmail.com Request you to please help us to reach out to all of those people who might want to learn something new by sharing our content. And Request you to please subscribe our channel to learn more about such topics
@pradeepravi9608
@pradeepravi9608 2 жыл бұрын
@@thedatamillennials i can't understand sir
@thedatamillennials
@thedatamillennials 2 жыл бұрын
@@pradeepravi9608 Lets connect over google meet and will clear your confusion . You can send google meet link or invite on the below email master.datamillennials@gmail.com
@subhadipmodak1321
@subhadipmodak1321 2 жыл бұрын
great video sir😍😍😍
@thedatamillennials
@thedatamillennials 2 жыл бұрын
Hi @subhadip modak, I am Glad that our video was helpful . Request you to please help us to reach out to all of those people who might want to learn something new by sharing our content. And Request you to please subscribe our channel to learn more about such topics In case if you are struggling with any topic, Please connect with us on the below given email id and we can connect over a quick google meet call and help you to resolve it. Email Id:- master.datamillennials@gmail.com
@subhadipmodak1321
@subhadipmodak1321 2 жыл бұрын
@@thedatamillennials obviously sir, i suggest this channel who are wants to something new & advance topic.
@thedatamillennials
@thedatamillennials 2 жыл бұрын
@@subhadipmodak1321 thank you , we would really appreciate your help.🙏
@adarshverma3372
@adarshverma3372 Жыл бұрын
Great
@thedatamillennials
@thedatamillennials Жыл бұрын
apologies for the delayed response. I am Glad that our video was useful and helpful . Request you to please check out our other videos of Excel, SQL and Google data studio ( Looker) and also please help us to reach out to all your friends and family members who might want to learn something new by sharing our content. And Request you to please subscribe our channel to learn more about such topics
@nsnreddy4147
@nsnreddy4147 10 ай бұрын
Could you please share with us excel sheet for practicing?
@thedatamillennials
@thedatamillennials 10 ай бұрын
Please drop me a note on below email id and I will share the data with over the email master.datamillennials@gmail.com
@deepthimurali962
@deepthimurali962 2 жыл бұрын
Hi, can you tell why we went for left join for both joins?
@thedatamillennials
@thedatamillennials 2 жыл бұрын
Hi @Deepthi, We went for left join for both the table , because as per our requirement we required all the rows from both of the tables
@nexsitymusichub1811
@nexsitymusichub1811 Жыл бұрын
hello please what is 'sd ' and ' 'scd'
@thedatamillennials
@thedatamillennials Жыл бұрын
hi sd and scd is the alias name of the table that i had given while joining the tables.
@farahamirah2091
@farahamirah2091 2 жыл бұрын
hi, i have question, if we are using left join from student_data as sd left join Student_Course_Data as scd so the table on the left is sd , let say we add left join student_marks_data as smd on scd.Roll_No=smd.Roll_No are we consider table scd as left table for joining or still sd?
@thedatamillennials
@thedatamillennials 2 жыл бұрын
HI Farah, The first table which you have used in From clause (in this case student data as sd ) will always be the let table.. Hope the above explanation clears your confusion. In case if you are struggling with any topic, Please connect with us on the below given email id and we can connect over a quick google meet call and help you to resolve it. Email Id:- master.datamillennials@gmail.com Request you to please help us to reach out to all of those people who might want to learn something new by sharing our content. And Request you to please subscribe our channel to learn more about such topics
@farahamirah2091
@farahamirah2091 2 жыл бұрын
Understood that,sure i will spread your video with my colleague
@thedatamillennials
@thedatamillennials 2 жыл бұрын
@@farahamirah2091 Thanks. We would really appreciate your help.
@sahilrohilla8796
@sahilrohilla8796 2 жыл бұрын
can you share this video insert query?
@thedatamillennials
@thedatamillennials 2 жыл бұрын
Hi @Sahil Rohilla, Apologies for delayed response. As requested in the comment, please find the below query used in this video. select sd.Roll_No, sd.class, scd.Course_name, smd.Marks from student_data as sd left join student_Course_Data as scd on sd.Roll_No=scd.Roll_No left join student_marks_data as smd on (sd.Roll_No=smd.Roll_No and scd.Course_name=smd.course_name) And Request you to please subscribe our channel to learn more about such topics
@SeniorTravels
@SeniorTravels Жыл бұрын
content is blurred
@thedatamillennials
@thedatamillennials Жыл бұрын
ok , will try to make videos in high definition
@neharoy6859
@neharoy6859 Жыл бұрын
Can someone pls explain what query we can use in this to get the final o/p Source A ID Name State 1 A Delhi 2 B Delhi 3 C Source B ID Name State 1 A Delhi 3 C Haryana 4 D Mumbai 5 E Final Output: ID Name State 1 A Delhi 2 B Delhi 3 C Haryana 4 D Mumbai 5 E Null
@thedatamillennials
@thedatamillennials Жыл бұрын
Hi @Neha Roy There are multiple ways to solve this kind of problem statement. But one of the easiest way is to use full join. The Full Join basically returns all records from the left table and also from the right table. For example, let’s say, we have two tables, Table A and Table B. When Full Join is applied on these two tables, it returns us all records from both Table A and Table B. If the condition is not met, then the null value is displayed instead Please let me know, if you want me to create a video on your problem statement
@tejindersingh4580
@tejindersingh4580 10 ай бұрын
Aise to koi paise le k bhi ni samjhata !! 🫀
@thedatamillennials
@thedatamillennials 9 ай бұрын
I am Glad that our video was useful and helpful . Request you to please check out our other videos of Excel, SQL and Google data studio ( Looker) and also please help us to reach out to all your friends and family members who might want to learn something new by sharing our content. And Request you to please subscribe our channel to learn more about such topics
@Tabla_Tejas67
@Tabla_Tejas67 Жыл бұрын
OMG you are a god !!! I have been looking at minimum 10 videos and yours are the most CLEARLY illustrated ONE !! Thanks a lot
@thedatamillennials
@thedatamillennials Жыл бұрын
Hi @Tejas Kumar. I am Glad that our video was useful and helpful for you . Request you to please help us to reach out to all your friends and family members who might want to learn something new by sharing our content. And Request you to please subscribe our channel to learn more about such topics. And happy new year in Advance.
А я думаю что за звук такой знакомый? 😂😂😂
00:15
Денис Кукояка
Рет қаралды 6 МЛН
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 2,9 МЛН
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 19 МЛН
MySQL: JOINS are easy (INNER, LEFT, RIGHT)
5:04
Bro Code
Рет қаралды 476 М.
SQL Join 3 Tables: How-To with Example
4:06
Database Star
Рет қаралды 120 М.
HOW TO JOIN 3 OR MORE TABLES IN SQL | TWO WAYS
4:05
Crack Concepts
Рет қаралды 430 М.
Using SQL to Select Records from Multiple Tables
10:32
MrBrownCS
Рет қаралды 77 М.
6 SQL Joins you MUST know! (Animated + Practice)
9:47
Anton Putra
Рет қаралды 208 М.
Querying Multiple Tables with SQL
10:40
Larry Domine
Рет қаралды 231 М.
А я думаю что за звук такой знакомый? 😂😂😂
00:15
Денис Кукояка
Рет қаралды 6 МЛН