SQL| Find managers for every employee in the table|Common SQL interview question|Self Join explained

preview_player
Показать описание
In this video we discuss a very commonly asked SQL question.

Question?
--Show the name of the manager for each employee in the same row?
--Result set should contain four columns, namely:
--1)emp_id (Employee Id)
--2)emp_name (Employee Name)
--3)manager_id (Manager Id)
--4)manager_name (Manager Name)

Self join concept is used to write the query.

Self join links a table to itself. To use a self join, the table must contain a column (call it X), that acts as the primary key and a different column (call it Y) that stores values that can be matched up with the values in Column X.

"Thanks for watching. If you liked this video, make sure to subscribe for more!”

Feedbacks are always welcome!

#dataprojecthub
#data_project_hub
Рекомендации по теме
Комментарии
Автор

could you please ping insert and create command

vijaygupta