UNION is used to combine the result sets of two or more SELECT queries into a single result set. key points about using UNION: Distinct rows only: By default, UNION removes duplicate rows. Same number of columns: Each SELECT query must have the same number of columns. Column data types must match: The corresponding columns should have compatible data types. You can use UNION ALL if you want to keep duplicate rows in the final result.
Hello Alex, let me thank you with the core of my heart from Pakistan. The way you teach SQL is the best way I have ever experienced. I have completed your SQL Server courses (Beginners - Advanced) and beginners series of MySQL, now, eagerly waiting for complete intermediate and advanced series of MySQL.
This nice program of yours is so good & has been a very nice help for me in many ways, especially MySQL Database Management Currier. I have been learning a lot through Your UA-cam Channel. I have downloaded most of the SQL courses from beginners to Advanced courses. Thanks a million, man. You became a nice teacher for me.
Used SQL for years when I was younger (mainly for web development projects - PHP) but not really used it for a good few years (Still use it slightly for PowerBi but have not had to write queries for ages), just refreshing my SQL knowledge before my Data Engineer interview, I forgot about UNIONS and WINDOW functions.. oops. Thanks for the great content it's all coming back to me
Love these! Went through the Business Analyst MySQL course on Udemy, started to do some more project learning now. These snippets of information are a great help.
Very helpful and clear tutorial about Unions, so thank you! Your videos are very helpful to refresh my SQL knowledge and learn new stuff to help me prep for my data analyst job search
[NOTE: Just copied this comment from the STRING FUNCTIONS lesson where I had entered it by mistake. 😜] Well, that was fun! Ending my day with Alex the Analyst while my lovely Bride is preparing dinner (I'm one lucky 'Wanna-Be-Data-Nerd'). Somehow UNION just makes more sense than JOINS for me. I just need more exposure and practice - like this Intermediate MySQL Series for example. Thanks again Alex!
Wow i heard the tech industry was age-ist. This video just made my anxiety go through the roof. We're going to push folks out for being old at 40 years old? i'm 44. should i even bother switching my career to data analysis?
Most thorough tutorial on what a UNION can actually do, just love these videos as always Alex. Also, notice from previous video on JOINS, there is no FULL OUTER JOIN in MySQL. You need to do it via a UNION I'm guessing by combining a LEFT and RIGHT join?
quick note if you have UNEQUAL ROWS set the columns which are present on the econd database table but not the fist database table as NULL set the columns which are present on the first database table but not the second database table as NULL since union actually merges so it will create additional rows to merge those columns NOW IF WE PUT NUILL IT WILL MATCH THE UMBER OF ROWS
If you go back to his SQL Studio setup video, he manually creates the table using CREATE TABLE, then I think you'd have to add the first/last name columns to salary table
What a weird use case, discriminating against employees over 40 ( 'Old men" and 'Old Ladies') and cutting salaries or firing high-paid employees. "i've done something similar to this in my real job.' Charming.
Apart from learning Data Analysis, I'm also learning satire. Thank you man.😄
I loved it when he said “so that our job is still secure” 😂
Yea the job market is tough these days 😂
UNION is used to combine the result sets of two or more SELECT queries into a single result set. key points about using UNION:
Distinct rows only: By default, UNION removes duplicate rows.
Same number of columns: Each SELECT query must have the same number of columns.
Column data types must match: The corresponding columns should have compatible data types.
You can use UNION ALL if you want to keep duplicate rows in the final result.
Hello Alex, let me thank you with the core of my heart from Pakistan.
The way you teach SQL is the best way I have ever experienced. I have completed your SQL Server courses (Beginners - Advanced) and beginners series of MySQL, now, eagerly waiting for complete intermediate and advanced series of MySQL.
What is the defference between sql course and my sql videos
"If someone is over 50 years old, we're gonna try to push them out"
Sir that's ILLEGAL 🤣
Exactly my thought. I didnt't like this example at all. I am 46
This nice program of yours is so good & has been a very nice help for me in many ways, especially MySQL Database Management Currier. I have been learning a lot through Your UA-cam Channel. I have downloaded most of the SQL courses from beginners to Advanced courses.
Thanks a million, man. You became a nice teacher for me.
Great to hear!
Couldn't understand a thing on this topic on Udemy, but you lay it down simple here. Glad there's a channel like this.
Used SQL for years when I was younger (mainly for web development projects - PHP) but not really used it for a good few years (Still use it slightly for PowerBi but have not had to write queries for ages), just refreshing my SQL knowledge before my Data Engineer interview, I forgot about UNIONS and WINDOW functions.. oops. Thanks for the great content it's all coming back to me
Love these! Went through the Business Analyst MySQL course on Udemy, started to do some more project learning now. These snippets of information are a great help.
Very helpful and clear tutorial about Unions, so thank you! Your videos are very helpful to refresh my SQL knowledge and learn new stuff to help me prep for my data analyst job search
Don't push out those older employees LOL
It’s corporate - I can’t control it. Sorry. 😞
I just stopped and laughed when Alex said, Donna is just an old lady hahaha 😂
[NOTE: Just copied this comment from the STRING FUNCTIONS lesson where I had entered it by mistake. 😜] Well, that was fun! Ending my day with Alex the Analyst while my lovely Bride is preparing dinner (I'm one lucky 'Wanna-Be-Data-Nerd'). Somehow UNION just makes more sense than JOINS for me. I just need more exposure and practice - like this Intermediate MySQL Series for example. Thanks again Alex!
big up Alex, great course!
Wow i heard the tech industry was age-ist. This video just made my anxiety go through the roof. We're going to push folks out for being old at 40 years old? i'm 44. should i even bother switching my career to data analysis?
Most thorough tutorial on what a UNION can actually do, just love these videos as always Alex. Also, notice from previous video on JOINS, there is no FULL OUTER JOIN in MySQL. You need to do it via a UNION I'm guessing by combining a LEFT and RIGHT join?
THANK YOU ALEX😊😊
Can you do a video on BI analyst vs data analyst
Please sir make a video on SPSS
quick note
if you have UNEQUAL ROWS
set the columns which are present on the econd database table but not the fist database table as NULL
set the columns which are present on the first database table but not the second database table as NULL
since union actually merges so it will create additional rows to merge those columns NOW IF WE PUT NUILL IT WILL MATCH THE UMBER OF ROWS
can you tell me how to do that? like how do i set a column as null?
at 6:32 when we order by both first_name and last_name what's the difference when we order it by just first_name?
You say at 4:55 that the age 50 is too low and lower it further to 40 😂
Alex here executing commands and other people's job🤣🤣
superb!
You’re making more than 70 sure the parks department is gonna try and get rid of you 😂😂😂😂
At 6.25, why ORDER BY not only first_name? result will be the same. Then why last_name included?
Got to do whatchu got to do 😭😭😭
Can i anybody how he is using old first time,he says it is a label. I know alias but i don't know label.Can anybody explain?
hello alex, where can we get this dataset for practice
If you go back to his SQL Studio setup video, he manually creates the table using CREATE TABLE, then I think you'd have to add the first/last name columns to salary table
Hi All, please help. Please send me a link to download database
We send it to a person who needs it so our job is secure, job market is tough nowadays LOL 🤣🤣
What's the use of Union?
To fire people😂😂😂
😂😂😂😂😂😂 good question
you gotta do what you gotta do 😂
omg not you calling Jerry old
wow
What a weird use case, discriminating against employees over 40 ( 'Old men" and 'Old Ladies') and cutting salaries or firing high-paid employees. "i've done something similar to this in my real job.' Charming.
40 is middle age not old 😀
Wow - not cool about using the term "old" over 50. Not cool at all. I'm 57 and was offended.