SQL Training Online

  • Training Courses
  • Beginner Book
  • Blog

September 27, 2017 by Joey Blue Leave a Comment

SQL Joins Tutorial for Beginners – Inner Join, Left Join, Right Join, Full Outer Join – SQL Training Online

How to write SQL Joins in 10 minutes.  (*Plus another 8 minutes of bonus material.)

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.

Video: SQL Join Tutorial


How to write SQL Joins in 10 minutes.

The following Scripts are used in the training:

--Create Customer Table
CREATE TABLE [dbo].[Customer](
	[CustomerId] [int] NOT NULL,
	[CityId] [int] NULL,
	[CustomerName] [varchar](50) NOT NULL
) ON [PRIMARY]
GO
--Insert Customer Records
INSERT [dbo].[Customer] ([CustomerId], [CityId], [CustomerName]) VALUES (1, 1, N'Bob Smith')
GO
INSERT [dbo].[Customer] ([CustomerId], [CityId], [CustomerName]) VALUES (2, 1, N'Sally Smith')
GO
INSERT [dbo].[Customer] ([CustomerId], [CityId], [CustomerName]) VALUES (3, 2, N'Tom Smith')
GO
INSERT [dbo].[Customer] ([CustomerId], [CityId], [CustomerName]) VALUES (4, NULL, N'Mary Smith')
GO
--Create City Table
CREATE TABLE [dbo].[City](
	[CityId] [int] NOT NULL,
	[CityName] [varchar](50) NOT NULL
) ON [PRIMARY]
GO
--Insert City Records
INSERT [dbo].[City] ([CityId], [CityName]) VALUES (1, N'Kansas City')
GO
INSERT [dbo].[City] ([CityId], [CityName]) VALUES (2, N'New York')
GO
INSERT [dbo].[City] ([CityId], [CityName]) VALUES (3, N'Houston')
GO

See the original SQL Join Tutorial for Beginners video.

Related

Filed Under: SQL Tip, SQL Training Tagged With: SQL Full Join, SQL Inner Join, SQL Join, SQL Left Join, SQL Outer Join, SQL Right Join, SQL Video, SQL Where

Leave a Question, Comment, or Reply. All are welcome! Cancel reply

Recent Posts

  • SQL Database Normalization – 1NF, 2NF, 3NF, and 4NF
  • SQL Joins Tutorial for Beginners – Inner Join, Left Join, Right Join, Full Outer Join – SQL Training Online
  • Zillow House Price Analysis from CSV Archive – #PowerBI 002
  • Learn Basic SQL – 1 Hour Training Course – SQL Training Online
  • Create Table Statement in SQL Server and Inserting Baseball Homerun Leader Dataset – SQL Training Online

Popular Posts

  • SQL Functions
  • SQL Jobs in Oracle and Microsoft SQL Server
  • Troubleshooting a SQL Join
Copyright © 2023 · SQLTrainingOnline.com · Consulting at EmbarkBlue.com