#Meta/Facebook
Find matching pairs of Meta/Facebook employees such that they are both of the same nation, different age, same gender, and at different seniority levels.
Output ids of paired employees.
table name: facebook_employees

Solution:
select e1.id as emp1, e2.id as emp2
from facebook_employees as e1
join facebook_employees as e2
on e1.location = e2.location
and e1.gender = e2.gender
and e1.age != e2.age
and e1.is_senior != e2.is_senior
and e1.id != e2.id
Output:

SQL Script:
USE [StrataScratch]
GO
CREATE TABLE [dbo].[facebook_employees](
[id] [int] NULL,
[location] [varchar](50) NULL,
[age] [int] NULL,
[gender] [varchar](50) NULL,
[is_senior] [bit] NULL
) ON [PRIMARY]
GO
INSERT [dbo].[facebook_employees] ([id], [location], [age], [gender], [is_senior]) VALUES (0, N'USA', 24, N'M', 0)
GO
INSERT [dbo].[facebook_employees] ([id], [location], [age], [gender], [is_senior]) VALUES (1, N'USA', 31, N'F', 1)
GO
INSERT [dbo].[facebook_employees] ([id], [location], [age], [gender], [is_senior]) VALUES (2, N'USA', 29, N'F', 0)
GO
INSERT [dbo].[facebook_employees] ([id], [location], [age], [gender], [is_senior]) VALUES (3, N'USA', 33, N'M', 0)
GO
INSERT [dbo].[facebook_employees] ([id], [location], [age], [gender], [is_senior]) VALUES (4, N'USA', 36, N'F', 1)
GO
INSERT [dbo].[facebook_employees] ([id], [location], [age], [gender], [is_senior]) VALUES (5, N'India', 41, N'F', 1)
GO
INSERT [dbo].[facebook_employees] ([id], [location], [age], [gender], [is_senior]) VALUES (6, N'India', 44, N'F', 1)
GO
INSERT [dbo].[facebook_employees] ([id], [location], [age], [gender], [is_senior]) VALUES (7, N'India', 28, N'F', 0)
GO
INSERT [dbo].[facebook_employees] ([id], [location], [age], [gender], [is_senior]) VALUES (8, N'India', 24, N'M', 0)
GO
INSERT [dbo].[facebook_employees] ([id], [location], [age], [gender], [is_senior]) VALUES (9, N'UK', 18, N'M', 0)
GO
INSERT [dbo].[facebook_employees] ([id], [location], [age], [gender], [is_senior]) VALUES (10, N'UK', 21, N'M', 0)
GO
INSERT [dbo].[facebook_employees] ([id], [location], [age], [gender], [is_senior]) VALUES (11, N'UK', 23, N'F', 1)
GO
INSERT [dbo].[facebook_employees] ([id], [location], [age], [gender], [is_senior]) VALUES (12, N'Switzerland', 30, N'F', 1)
GO
INSERT [dbo].[facebook_employees] ([id], [location], [age], [gender], [is_senior]) VALUES (13, N'Switzerland', 31, N'M', 1)
GO