Kendra Little | April 15, 2024
Joins are essential. The SQL Corgs introduce you to INNER joins in this animated short.
Sample code
Freyja and Stormy love sample code, although their typing isn’t the best. This works in SQL Server:
create table #stormy (name sysname, color sysname)
insert #stormy values ('rope', 'blue'), ('bone', 'blue'), ('lobster', 'red'), ('ball','orange')
create table #freyja (name sysname, color sysname)
insert #freyja values ('bone', 'orange'), ('rope', 'orange'), ('ball', 'blue'), ('duck','green')
select s.color, s.name, f.color, f.name
from #stormy AS s
join #freyja as f on s.color=f.color;
GO