Skip to content

Commit

Permalink
Create SQL Unions Tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTheAnalyst authored Apr 17, 2021
1 parent d954432 commit cf34511
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions SQL Unions Tutorial
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Table 1 Insert:
Insert into EmployeeDemographics VALUES
(1011, 'Ryan', 'Howard', 26, 'Male'),
(NULL, 'Holly', 'Flax', NULL, NULL),
(1013, 'Darryl', 'Philbin', NULL, 'Male')

Table 3 Query:
Create Table WareHouseEmployeeDemographics
(EmployeeID int,
FirstName varchar(50),
LastName varchar(50),
Age int,
Gender varchar(50)
)

Table 3 Insert:
Insert into WareHouseEmployeeDemographics VALUES
(1013, 'Darryl', 'Philbin', NULL, 'Male'),
(1050, 'Roy', 'Anderson', 31, 'Male'),
(1051, 'Hidetoshi', 'Hasagawa', 40, 'Male'),
(1052, 'Val', 'Johnson', 31, 'Female')

2 comments on commit cf34511

@BrianMYee
Copy link

@BrianMYee BrianMYee commented on cf34511 Jan 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alex, Thanks for the videos. I am really learning from them.
I think something is missing here though so maybe you can point me in the right direction. I am looking for the INSERT INTO for the EmployeeSalary Table in order to get the added VALUES that contain NULLs for the Unions lesson.
I thought it would be pretty intuitive to have them contained here under the INSERT INTO EmployeeDemographics section. Thanks for all that you do! Brian

Edit: Found it by Pausing the video at the right spot: Recommend adding:
INSERT INTO EmployeeSalary VALUES
(1010, NULL, 47000),
(NULL, 'Salesman', 43000)

@TolaDini
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Alex and Brain, for the data on the second table

Please sign in to comment.