Part 10 Join 3 tables in sql server

preview_player
Показать описание
Link for all dot net and sql server video tutorial playlists

Link for slides, code samples and text version of the video

Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.

In this video we will discuss joining 3 tables in SQL Server. Joining 3 tables (or even more) is very similar to joining 2 tables.

Write a query to join 3 the tables and retrieve EmployeeName, DepartmentName and Gender.

Query:
SELECT EmployeeName, DepartmentName, Gender
FROM Employees
JOIN Departments ON Employees.DepartmentID = Departments.DepartmentID
JOIN Genders ON Employees.GenderID = Genders.GenderID

Write a query to show the total number of employees by DEPARTMENT and by GENDER.

Query:
SELECT DepartmentName, Gender, COUNT(*) as TotalEmployees
FROM Employees
JOIN Departments ON Employees.DepartmentID = Departments.DepartmentID
JOIN Genders ON Employees.GenderID = Genders.GenderID
GROUP BY DepartmentName, Gender
ORDER BY DepartmentName, Gender
Рекомендации по теме
Комментарии
Автор

You are a FREAKING MIRACLE WORKER. Much love!

ForsakePariah
Автор

It was very nice and easy to study via this video. Thank you very much for sharing it!

ivanaoricchio
Автор

Your Tutorials are so helpful to the beginners ... Thanks a lot

persistencej
Автор

still so FRESH in 2024 ! you are amazing sir :)

revathipatathil
Автор

sir, you are amazing, even a 7th standard student can understand these things. Thank you sir

dsskdhanalakshmi
Автор

This 5 min vdo is very understandable than the whole month training.

priyaroy
Автор

Your videos are very useful sir.. Thank you very much 👍🏻

happysaccount
Автор

Thank you for the videos, brother, amazing teacher

Ab-khnm
Автор

Very nice video. This was explanation was so easy to grasp I feel foolish for having had to look it up!

BrentConnorIsBestConnor
Автор

I enjoyed watching this video and recommend to others. Thanks

krismaly
Автор

thnx a lot sir...these topics are very nicely concepts get clear

saagarsoni
Автор

Perfect. Thanks your videos so help me

dwikiahadiyat
Автор

Thanks for this vedio ...i have a question how can we check that how many tables/database s in server through tsql

saiprathap
Автор

How can we apply left or right outer join if there are more than 2 tables?

amyyyy
Автор

I am tried this way....but still I am not getting result...every time asking ambiguous column name....plz give me clarify

nkiran-dgip
Автор

what if there is only one table connected with two other table
for example if there are 3 tables college, faculty and student both table connect with collegeId

jeetsutaria