HomeНаука и техникаRelated VideosMore From: Joey Blue

SQL Joins Tutorial for Beginners - Inner Join, Left Join, Right Join, Full Outer Join

1759 ratings | 117161 views
Learn how to create SQL Joins. The first 10 minutes teach you the basics. Inner Join, Left Outer Join, Right Outer Join, and Full Outer Join. The second 10 minutes show you are few techniques that will help you as you start building joins. READ THE ORIGINAL ARTICLE WITH THE TABLE SCRIPS http://www.sqltrainingonline.com/sql-joins-tutorial-for-beginners/ YOUTUBE NEWS UPDATES http://www.youtube.com/user/sqltrainingonline VISIT SQLTRAININGONLINE.COM FOR TONS MORE VIDEO NEWS & TIPS http://www.sqltrainingonline.com SUBSCRIBE FOR OTHER SQL TIPS AND NEWS! http://www.youtube.com/subscription_center?add_user=sqltrainingonline SUBSCRIBE TO OUR EMAIL LIST! http://www.sqltrainingonline.com LET'S CONNECT! Facebook: http://facebook.com/SQLTrainingOnline Twitter: http://twitter.com/sql_by_joey Linkedin: http://linkedin.com/in/joeyblue SQLTrainingOnline: http://www.sqltrainingonline.com
Html code for embedding videos on your blog
Text Comments (139)
lukslda1 (3 days ago)
thank you! greetings from Argentina.
Symon (8 days ago)
great tutorial, understood like nothing!
Your Mother (8 days ago)
Dis is CityName taka orda prease.
Eli Makhoul (9 days ago)
thx man
RoXaS (9 days ago)
Thanks a lot! This short video summarised hours of my database classes. Totally recommendable! :)
Lyuben Zarev (10 days ago)
Finally, an English speaking SQL tutorial <3
David R (14 days ago)
really great, clear, and easy to understand explanation. The best I've seen. Thank you!
Rajesh Kalakoti (15 days ago)
What is GUI?
olabode oladipupo (16 days ago)
Thank you for this video. Now I understand well.
Ricardo Vaz (16 days ago)
Always great having classes from Trey Gowdy.
Comrade -Rashka (17 days ago)
Thanks you so much for this!
Murmad Man (16 days ago)
4:18 left (outer) join 9:40 MISC
Keshini Patel (18 days ago)
Simply BEST
neamenful (19 days ago)
rose blossoms (22 days ago)
wowwww…!! loved da way u explain..
giridharan gounder (23 days ago)
So is that like that table1.primary key=table2.foreign key
Randal Andrade Nunes (24 days ago)
Hi, thanks for the video. I have a question regarding inner join though. I have three tables users, movies, and userMovies. users contains id, name, email, password. movies contains id, title.(I will add more later). userMovies contains users_id, movies_id. I also added REFERENCES to the userMovies table. "userMovies_movies_id_foreign" FOREIGN KEY (movies_id) REFERENCES movies(id) ON DELETE CASCADE "userMovies_users_id_foreign" FOREIGN KEY (users_id) REFERENCES users(id) ON DELETE CASCADE So as you can see users is linked to movies through the references in userMovies. I think that is called a join table or something? I would like to write a SQL or Knex query that fetches all the movies that belong to a specific user. Can you help me with that please?
Randal Andrade Nunes (23 days ago)
I was able to figure this out. Here is a post I found on Stackoverflow that explains how this works very well. For anyone having the same issue. https://stackoverflow.com/questions/33403508/sql-join-on-junction-table-with-many-to-many-relation
Cesar Rubio (26 days ago)
I just wish my college course in data analytics was a good as your video! It would help a lot! Thank you for the video! I really appreciate it!
Wttftyh Gytyf (28 days ago)
is 'on' used a lot in production? or just get a second query that does the filtering for readability ?
Wttftyh Gytyf (28 days ago)
Is Sally Smith hot enough? I could join her with me.
Danilo Novaković (1 month ago)
Thank you for this! Especially how you connected code with picture, made things really clear!
Oke Uwechue (1 month ago)
Nicely done!. The Venn diagram explanation really helps to clarify the various Join meanings.
Blaow (1 month ago)
This is the best explanation thx a lot!
wojoeviewer (1 month ago)
No Indian accent, nice :D
Scott Businge (1 month ago)
Great and simple.
Oloruntola Deed (2 months ago)
5:26, 7:45 ,8:31
Harald Engels (2 months ago)
Excellent tutorial. Thank you for sharing :-)
Manila Kid (2 months ago)
Best explanation about SQL joins on the Tube. The others try to over complicate things to make themselves sound scientific which defeats the purpose of a tutorial. Thanks Joey.
Archie P (2 months ago)
if only my instructor gave me a vendiagram instead of just definition
Yordeh Lakew (2 months ago)
Very clear explanation thank you 👍
Ekaterina Kalache (2 months ago)
Great explanation! Thank you
Omkar Patre (2 months ago)
Is it like Union and Intersection ??
Kaf3in0 B (2 months ago)
Joins seemed super complicated before this video. Thanks a lot!
Amee Vakil (2 months ago)
Thanks a lot for simple explanation!!!!!!!!
Rashid Haji (2 months ago)
You've unlocked the part of my brain that just couldn't understand the different types of Joins at 5 minutes before you even started to discuss Left Join ;) Thank you!
Cris310587 (2 months ago)
I dont understand very good the english, but the examples are awesome!
What software is this ?
IOT ACADEMY (2 months ago)
SQL Server management studio
Chloe Kimball (3 months ago)
A commendable effort! Thank you so much sir.
blazeesq2000 (3 months ago)
Why use a right join at all? That was my issue in learning SQL. Is it just a syntactical concept? I just don't see why I wouldn't write my queries "from left to right" all the time.
Senthil Raju (3 months ago)
Wow.. its really awesome.. Easy to understand... Subscribed :-)
Dude what ide are you using
Minh Nguyen (3 months ago)
Thank you for the demonstration with the diagrams. Those are extremely helpful.
John Smith (3 months ago)
This is probably the best Join video I've watched. Caleb should watch your videos for production values inspiration!
Nasiru Tanko (3 months ago)
Wow nice explanation, Thanks
Sushil Singh (3 months ago)
God Bless you...Mr Blue...v high quality and nice video.
Andy Massie (4 months ago)
I really appreciate the video! I'm taking classes through Udacity and this video was easier for me to understand.
Jose Ariel Delos Reyes (4 months ago)
Thanks for sharing this tutorial video. Easy to understand for beginner like me. 👍👍👏👏👏 Just want to ask, how to use constrain in sql? Thanks
Christina Camacho (4 months ago)
I love your pacing. Not too fast or too slow. You're right in the goldilocks zone!
Moshe Shperling (4 months ago)
You are the man!
Age of Reason (4 months ago)
16:50 you're going on to something else before finishing up with the first explanation.
Joey Blue (4 months ago)
My main point is that instead of using a Right Join, you can just rearrange your tables and use the Left Join.
Age of Reason (4 months ago)
12:36 What you say and what you do are not in sync. Confusing.
Joey Blue (4 months ago)
At that point, I am showing the difference between the cy.CityName='Kansas City' filter in the where clause and in the Left Join clause.
Age of Reason (4 months ago)
"cs.*" is redundant because SELECT * already picks up all columns. Why did you write it?
Joey Blue (4 months ago)
To show that is can be written. There are many times I want all of the columns from one table, but only a few columns from the other tables.
ANIFUR MONDAL (4 months ago)
thank u
ANIFUR MONDAL (4 months ago)
TheRed Eye (4 months ago)
Whenever i execute the columns are increasing again and again with the same values. Whats wrong? Everytime when i click select top 1000 rows, the columns are added.
Dallas Oak Cliff (5 months ago)
This dude is the Michael Jordan of SQL vids.
igor djurdjic (5 months ago)
Thank you for your great explanation, only this video showed me what each Join do. Bless you
Rasika Dhanapala (5 months ago)
Great teaching 👍
Subbarao Ganeshna (5 months ago)
thanks for the video man.
TheRed Eye (5 months ago)
hi, can you tell me the difference betwwen ORACLE SQL developer tool and MS SQL server studio?
TheRed Eye (5 months ago)
Big problem in installation. Not connecting to the server. Management tool is not opening. Say WMI... error😢😢😢
Joey Blue (5 months ago)
My personal opinion is SQL Server. You will also be able to use SSRS, SSIS, and SSAS.
TheRed Eye (5 months ago)
Joey Blue i want to learn sql. Which one should i go for? Ms server interface looks little bit easier.
Joey Blue (5 months ago)
They have the same basic functionality, but they will diverge based on database specific features.
TheRed Eye (5 months ago)
Joey Blue so both have the same functionality?
Alex Pacheco (5 months ago)
Your explanations were very simple. Great video!
Joseph Adewunmi (6 months ago)
amazing vid
VESPA5 (6 months ago)
Thank you so much for this video! I've watched so many PowerPoint presentations and lectures and your video was the only one that actually helped me understand joins! Thanks again
Christian Philippe (6 months ago)
Best tutorial that I've seen about: SQL - Inner Join, Left Join, Right Join, Full Outer Join
Capital Bee (6 months ago)
Katie Louise Stevenson (6 months ago)
seriously helped for my uni exam tomorrow thanks <3 xxx
krysta frame (6 months ago)
I was so confused until I watched this, so thank you!
bezualem fisseha (6 months ago)
thank you very much
John Bonda (6 months ago)
And I thought Joins were advanced concepts in SQL that I'm not yet ready to understand. God bless you Mr. Blue
Stian Leinaas (6 months ago)
That was great explanation! Thanks a bunch, Joey! :)
Osman Safa Kaya (6 months ago)
Thank you very much!!
Ahmed Sehic (6 months ago)
Many people post tutorials that are just confusing, yours is very clear Thanks Joey
Alexander Malinovski (6 months ago)
That part about Alias was super short, and it was a bit unclear how to create them. But in general very well made the tutorial, thanks.
mgismondo (6 months ago)
I have to agree! After hours of what should be a simple straightforward just simple explanations I FINALLY hit your page! Well done sir!
Michael Seven Foto (6 months ago)
Amazing Video!!!, wesuppose to be told this on HND classes - never happened
Aaron Marks (6 months ago)
Just stopping by to tell you - this is a great resource for folks who are new to SQL OR for developers who are trying to level up on SQL skills. Thanks for taking the time to make this!
Charles Hamm (7 months ago)
Thanks for this
George Cristian Iordan (7 months ago)
great man we owe you a lot, great explanations, great teacher!!!First I was learning without the app installed and I couldn't understand a thing, then I installed the Microsoft sql and I learned all your tutorials, I even created those tables that you show them in that video alone to understand better... Your are the best! thanks a lot.
Mia Dholl (7 months ago)
Thank you! Undersand this now. I am going to binge watch all your videos😀
Steven Bustamento (7 months ago)
This is excellent
Majid Khan (7 months ago)
its SQL Server Management Studio 17.5 or 17.6 ? great video thank you
Joey Blue (7 months ago)
I can't remember what version it was when I made the video. I just checked and I am currently running SSMS 2016. It looks like 17.5 and 17.6 are 2017. I think it is time for me to upgrade on my PC.
Adeem (7 months ago)
This video is beautiful.
ti wale (7 months ago)
Nice video Joey. Why have a left and a right join when they are essentially the same thing? Why not just switch the tables in the query ?
Joey Blue (7 months ago)
When you get to nested subqueries, the query might get real complex and you don't want to switch the tables. But, you are correct. You can just use the left join and switch the tables as needed.
curlycues4u (7 months ago)
Excellent explanation. Thank you! (Subscribed)
sky maze (7 months ago)
what software do you use in the video?
Joey Blue (7 months ago)
It is SQL Server Management Studio. It comes with SQL Server.
Mohamed Tarib (7 months ago)
Thank you very much
4Real Entropyst (7 months ago)
Spent an hour reading various tutorials and watching videos on this. Then you saved my nerves. This is by far the best and easiest explanation to SQL Joins I've ever seen, I can't thank you enough!
Mattie Kahn (8 months ago)
Thank you!  This is very helpful in my work.  I am truly appreciative to have your videos to go to over and over as I need them!
Vikrant Raut (8 months ago)
Chowzoo (8 months ago)
Awesome tutorial!
Alex Huthmacher (8 months ago)
This is best explanation of sql joins I have found! Well done! How about cross joins?
Johannes NEs (8 months ago)
How would one describe this video: LEGENDARY
Shifang Li (8 months ago)
Joey Davall (8 months ago)
This gave me a great understanding of joins, thank you
Bas de Waal (8 months ago)
Well explained Joey! Keep it up
Brian Woody (9 months ago)
What if a column is assigned one data type, but the join is another. For example, if I have a column that is populated with the IDs of another column, and I want to return that column with the corresponding string values from the joined column's IDs, I keep getting "Conversion failed when converting the varchar value 'Animals' to data type int."
4Real Entropyst (7 months ago)
My reply might be ages late, but I hope it helps: According to the error, you are trying to bind the Animals column (which is text) from one table to the ID column of the second table.
Doina Galateanu (9 months ago)
very well eplained. made me understood
Jose Díaz González (10 months ago)
Really well explained, it definitely helped me understand the different types of JOINs. Thank you.
Roopesh k (10 months ago)
Hey blue how did u display both the tables at a time
Miles Rose (10 months ago)
thanks to you i finally figured this out!

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.