IQ15: 6 SQL Query Interview Questions

2154528
1286
37726
18.08.2016
The Coding Interview

The Coding Interview

3109216
40800
86
09.06.2016
Описание видео:

6 common SQL Query Questions

Кадры из видео
IQ15:  6 SQL Query Interview Questions
IQ15:  6 SQL Query Interview Questions
IQ15:  6 SQL Query Interview Questions
IQ15:  6 SQL Query Interview Questions
Тэги из видео
Комментарии пользователей:
Aleš Mohorič
2022-11-09 21:31:22

Excellent, engaging, and challenging questions! Especially the 2nd highest sallary. I do not mean that as bad as sarcastic, but it seems you were completely oblivious to "order by".

Luis Daniel Mesa Velasquez
2022-11-04 11:51:05

The second highest salary doesn't need a "NOT IN" comparison... "<>" is better in this case.

The last one is better this way:
SELECT e.first_name, e.last_name, e.salary, d.department_name
FROM Employees e
INNER JOIN (SELECT MAX(salary) max_salary, department_id FROM Employees GROUP BY department_id) f
ON e.department_id = f.department_id AND e.salary = f.max_salary
INNER JOIN Department d ON e.department_id = d.department_id

This way you get all MAX salaries by department even if there are multiple employees making that much in the same department.

FOR Vpbof-20
2022-10-24 21:32:34

Selecting the nth salary could be better queried using the following, for example the 5th highest salary
Select * From (Select *, ROW_NUMBER() Over(Order By Salary DESC) rn From employee) as t
Where rn = 5
But, I agree to choose the 2nd your query is elegant.

Younes ABAROUDI
2022-10-17 09:10:08

The coding Interview: Why you didn't use ORDER BY DESC or ASC combined with LIMIT 1 ; ? I think it's very easy

Sally Isabel Boyer
2022-10-04 23:48:04

Excellent!

Skills and Thrills
2022-09-27 14:18:04

Do you have more videos for interview questions ,? Can you please share ?

Skills and Thrills
2022-09-27 14:17:31

Very useful video for interviews .

Nabil Kawkab
2022-09-27 13:54:29

Now how to get the 3rd or 4th highest salary ?

Cesar Aracena
2022-09-22 03:35:22

On the 1st question... Why not simply top 1 and order by salary desc? Much faster than al sub.

2nd question... A cte with top 2 is the the best option for easy future maintenance.

Got bored. Won't see the rest.

Vadiyar Hemadri
2022-09-15 03:24:56

Super learnt lot of knowledge from you thank you so much

BLACKGRAPES
2022-09-13 10:48:17

How to find non matching records from two tables: youtu.be/j9HL_2NIfcE youtu.be/j9HL_2NIfcE

Jordan
2022-09-11 00:38:52

Thank you

Cro Magnon
2022-09-07 18:03:32

refreshing !

Jiexi Ai
2022-08-26 06:59:56

Awesome tutorial.

Felipe Prandini
2022-08-18 11:58:56

In that last query implementation, if you happen to have a sales record with a salary of 80000 wouldn’t that line also return in your result?

Vivek Vlog
2022-08-02 14:49:48

Was indeed good stuff

Kumara Krish
2022-07-29 14:45:24

highly informative about:invalid#zCSafez

debbah
2022-06-26 20:33:26

the way you write SQL keywords irritates me. some lower case, some PascalCase and some uppercase.

Choose one style god damnit

Priya B
2022-06-09 14:35:38

For the last one we can also do like this ==> Select e.name/ e.name ,max(e.salary),d.deptname from employee e inner join dept d on e.deptid =d.deptid
Group by e.name/ e.name ,d,deptname

Что ищут прямо сейчас
факты о солнце Русский дубляж фильма abuso glo™ HYPER как закрыть канал утка лалафан как быстро сшить física maçonaria binz nirahua ka film стопгейм политика камера видеонаблюдение в подъезде programer game Nouveaurap ihg rewards club RAID 1 Papaya Soap MBKEYPROG короче говоря бездомный
Похожие видео
27.03.2019
Top 65 SQL Interview Questions and Answers | SQL Interview Preparation | SQL Training | Edureka

Top 65 SQL Interview Questions and Answers | SQL Interview Preparation | SQL Training | Edureka

06.01.2022
SQL JOINS Tutorial for beginners | Practice SQL Queries using JOINS - Part 1

SQL JOINS Tutorial for beginners | Practice SQL Queries using JOINS - Part 1

27.01.2022
How I use SQL as a Data Analyst

How I use SQL as a Data Analyst

23.03.2019
Expert Level SQL Tutorial

Expert Level SQL Tutorial

17.11.2018
Learn SQL In 60 Minutes

Learn SQL In 60 Minutes

25.03.2019
SQL Joins Explained  |¦| Joins in SQL |¦| SQL Tutorial

SQL Joins Explained |¦| Joins in SQL |¦| SQL Tutorial

02.09.2022
How to remove Duplicate Data in SQL | SQL Query to remove duplicate

How to remove Duplicate Data in SQL | SQL Query to remove duplicate

13.12.2021
SQL interview questions and answers | Entry level data analyst interview

SQL interview questions and answers | Entry level data analyst interview

28.06.2019
SQL

SQL "difference between" interview questions (part 1)

24.01.2019
Concurrency vs Parallelism | C# Interview Questions | Csharp Interview Questions and Answers

Concurrency vs Parallelism | C# Interview Questions | Csharp Interview Questions and Answers

17.04.2018
Selenium Interview Questions and Answers

Selenium Interview Questions and Answers

06.06.2019
Top 30 Interview Questions - From a recruiters hiring playbook

Top 30 Interview Questions - From a recruiters hiring playbook

04.02.2022
Top 25 SQL Interview Questions| India's Best IT Training | KSR Datavizon | Power BI

Top 25 SQL Interview Questions| India's Best IT Training | KSR Datavizon | Power BI

22.11.2017
How To Troubleshoot a Slow Running Query in SQL Server Extended Events & Wait Stats (by Amit Bansal)

How To Troubleshoot a Slow Running Query in SQL Server Extended Events & Wait Stats (by Amit Bansal)

05.09.2021
SQL WITH Clause | How to write SQL Queries using WITH Clause | SQL CTE (Common Table Expression)

SQL WITH Clause | How to write SQL Queries using WITH Clause | SQL CTE (Common Table Expression)

05.09.2022
Top 15 SQL Interview Questions Answers | Most Important Questions for Job Interview

Top 15 SQL Interview Questions Answers | Most Important Questions for Job Interview