Practice Activity: Which employees are being paid more than their managers (using a self-join)

Опубликовано: 18 Май 2023
на канале: SQL Server 101
296
14

How can you use a JOIN on the same table?
---
My SQL Server Udemy courses are:
70-461, 70-761 Querying Microsoft SQL Server with T-SQL: https://rebrand.ly/querying-microsoft...
98-364: Database Fundamentals (Microsoft SQL Server): https://rebrand.ly/database-fundamentals
70-462 SQL Server Database Administration (DBA): https://rebrand.ly/sql-server-dba
Microsoft SQL Server Reporting Services (SSRS): https://rebrand.ly/sql-server-ssrs
SQL Server Integration Services (SSIS): https://rebrand.ly/sql-server-ssis
SQL Server Analysis Services (SSAS): https://rebrand.ly/sql-server-ssas-mdx
Microsoft Power Pivot (Excel) and SSAS (Tabular DAX model): https://rebrand.ly/microsoft-powerpiv...
----
In this Practice Activity, you will use the SQL Server Self Join Employee Manager to determine which employees are being paid more than their managers.

This Practice Activity is designed to help you learn how to use the SQL Server Self Join Employee Manager. After completing this activity, you will be able to use the Self Join Employee Manager to identify which employees are being paid more than their managers.

The starting code is:
CREATE TABLE tblEmployee
(EmployeeID int primary key,
EmployeeName varchar(30),
Salary int,
ManagerID int)
INSERT INTO tblEmployee
VALUES
(1, 'Amelia Thompson', 250000, NULL),
(2, 'Benjamin Martinez', 137162, 1),
(3, 'Chloe Taylor', 111146, 1),
(4, 'Daniel Anderson', 120422, 1),
(5, 'Emma Rodriguez', 126370, 1),
(6, 'Finn Parker', 107202, 1),
(7, 'Grace Evans', 80213, 2),
(8, 'Henry Wright', 136619, 2),
(9, 'Isabella Scott', 114506, 2),
(10, 'Jacob Morgan', 97419, 2),
(11, 'Katherine Mitchell', 122973, 2),
(12, 'Liam Hill', 88710, 3),
(13, 'Mia Cooper', 105454, 3),
(14, 'Noah Young', 58056, 3),
(15, 'Olivia King', 51885, 3),
(16, 'Penelope Lee', 100925, 3),
(17, 'Quinn Harris', 58599, 4),
(18, 'Riley Turner', 140719, 4),
(19, 'Sophia Brown', 78277, 4),
(20, 'Thomas Wilson', 132683, 4),
(21, 'Victoria Clark', 123334, 4),
(22, 'William Turner', 84004, 5),
(23, 'Xander Adams', 125854, 5),
(24, 'Yara Garcia', 62402, 5),
(25, 'Zachary Bennett', 138029, 5),
(26, 'Ava Miller', 91793, 5),
(27, 'Ethan Moore', 128893, 6),
(28, 'Harper Sanchez', 53647, 6),
(29, 'Jackson Brooks', 148164, 6),
(30, 'Lily Campbell', 100795, 6),
(31, 'Oliver Ramirez', 94987, 6)
----
Links to my website are:
70-461, 70-761 Querying Microsoft SQL Server with T-SQL: http://idodata.com/querying-microsoft...
98-364: Database Fundamentals (Microsoft SQL Server): http://idodata.com/database-fundament...
SQL Server Essential in an Hour: http://idodata.com/sql-server-essenti...
70-462 SQL Server Database Administration (DBA): http://idodata.com/sql-server-databas...
DP-300: Administering Relational Databases: http://idodata.com/dp-300-administeri...
Microsoft SQL Server Reporting Services (SSRS): http://idodata.com/microsoft-sql-serv...
SQL Server Integration Services (SSIS): http://idodata.com/sql-server-integra...
SQL Server Analysis Services (SSAS): http://idodata.com/sql-server-ssas-mu...
Microsoft Power Pivot (Excel) and SSAS (Tabular DAX model): https://rebrand.ly/microsoft-powerpiv...
1Z0-071 Oracle SQL Developer – certified associate: http://idodata.com/iz0-071-oracle-sql...
SQL for Microsoft Access: http://idodata.com/sql-for-microsoft-...
DP-900: Microsoft Azure Data Fundamentals: http://idodata.com/dp-900-microsoft-a...


Смотрите видео Practice Activity: Which employees are being paid more than their managers (using a self-join) онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал SQL Server 101 18 Май 2023. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 296 раз и оно понравилось 14 посетителям.