From the course: MySQL Data Analysis
Unlock this course with a free trial
Join today to access over 24,400 courses taught by industry experts.
Solution: The UNION operator - MySQL Tutorial
From the course: MySQL Data Analysis
Solution: The UNION operator
- [Instructor] This is the solution video for your assignment on union. As a reminder, you're trying to pull a list of all of your advisors and staff and denote the type of person that they are, advisor or staff, and pull in their first name and last name. Let's go over to Workbench and walk through the solution. So by now you should be pretty familiar with our first step, which is to figure out which tables we're working with. So we know that we want to pull in the names of our advisors and our staff. So we're going to start looking at those tables. Here we've got advisor. We're going to hope that we have, yep, first name and last name in these columns. So we're going to pull from there first. First name, last name, from advisor, and we'll just see what that looks like. So we've got the names of the advisors and then similarly we're going to take a look at our staff table as well and see if that has first name and last name. Turns out it does right here. So we're going to want to put…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Introduction30s
-
(Locked)
Normalization and Cardinality3m 47s
-
(Locked)
Relationship diagrams1m 10s
-
(Locked)
Multi-table querying1m 4s
-
(Locked)
Reviewing the maven movies database1m 44s
-
(Locked)
Common JOIN types2m 25s
-
(Locked)
INNER JOIN1m 31s
-
(Locked)
INNER JOIN example5m 49s
-
(Locked)
Challenge: INNER JOIN42s
-
(Locked)
Solution: INNER JOIN4m 13s
-
(Locked)
LEFT JOIN1m 39s
-
(Locked)
LEFT JOIN example4m 43s
-
(Locked)
Challenge: LEFT JOIN42s
-
(Locked)
Solution: LEFT JOIN3m 57s
-
(Locked)
RIGHT JOIN1m 41s
-
(Locked)
LEFT vs. INNER vs. RIGHT JOIN3m 18s
-
(Locked)
FULL OUTER JOIN1m 27s
-
(Locked)
Pro tip: Bridging unrelated tables6m 51s
-
(Locked)
Challenge: Bridging tables57s
-
(Locked)
Solution: Bridging tables4m 25s
-
(Locked)
Multi-condition joins2m 40s
-
(Locked)
Challenge: Multi-condition joins44s
-
(Locked)
Solution: Multi-condition joins4m 42s
-
(Locked)
The UNION operator2m 15s
-
(Locked)
UNION example3m 51s
-
(Locked)
Challenge: The UNION operator32s
-
(Locked)
Solution: The UNION operator2m 41s
-
(Locked)
-