Загрузка...

SQL Interview Question 297 | #shorts #ytshorts #youtubeshorts #sql #mysql #interview @SekharAcademy1

#SQL Interview Question 297

Write a SQL query to find employees who were hired within the same month as the employee with the highest salary in the company.

WITH top_salary_employee AS (
SELECT TOP 1 hire_date
FROM employ
WHERE salary = (SELECT MAX(salary) FROM employ)
)
SELECT e.employee_id, e.name, e.hire_date, e.salary
FROM employ e
WHERE EXISTS (
SELECT 1
FROM top_salary_employee tse
WHERE MONTH(e.hire_date) = MONTH(tse.hire_date)
AND YEAR(e.hire_date) = YEAR(tse.hire_date)
);

@SekharAcademy1

#shorts
#ytshorts
#youtubeshorts
#sqlqueryinterviewquestionsandanswers
#mysqlserver
#sql
#sqlqueries
#mysql
#oracle
#interview
#database
#sqlinterview
#interviewquestions
#quiz
#sqlquiz
#quiztest
#databasequeries
#leetcode
#leetcodesolutions
#leetcodesql
#follow
#sqljoins
#join
#interviewquery
#leetcode
#leetcodesql
#sqlinterviewquestionsandanswers
#sqlforbeginners
#sqlinterviewquestions
#sqlqueryinterviewquestionsandanswers
#mysql questions asked in interview
#mysqlquestionsaskedininterview
#sqltrickyinterviewquestionsandanswers
#sqlsenariointerviewquestionsandanswers
#sqlinterviewquestionsfortesting
#sqlinterviewquestionsandanswersforjoin
#Joininsql
#functionsinsql

Видео SQL Interview Question 297 | #shorts #ytshorts #youtubeshorts #sql #mysql #interview @SekharAcademy1 канала Sekhar Academy
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять