SQL Query | How to find employees with highest salary in a department
ฝัง
- เผยแพร่เมื่อ 21 พ.ย. 2020
- This video is part of the series of videos on SQL Queries on Employee Salary database
How to find employees with maximum salary in a department
Check out all the SQL Queries and TH-cam videos for this series here -
know-star.blogspot.com/2021/0...
How to install SQL Server for practice?
• How to install SQL Ser...
Check out the complete list of SQL Query Interview Questions -
• SQL Query Interview Qu...
Best Data Science / Analytics / SQL courses
Learn SQL Basics for Data Science Specialization
imp.i384100.net/qnXYk5
Data Science Fundamentals with Python and SQL Specialization
imp.i384100.net/mgVYre
Python for Everybody Specialization
imp.i384100.net/DVz7Aj
Google Data Analytics Professional Certificate
imp.i384100.net/OR37oQ
Coursera Plus - Data Science Career Skills
imp.i384100.net/c/3299742/132...
Please do not forget to like, subscribe and share.
For enrolling and enquiries, please contact us at
Website - knowstar.org/
Facebook - / knowstartrainings
Linkedin - www.linkedin.com/company/know...
Email - learn@knowstar.org
No words to explain how valuable this video... Take a bow ma'am..🙏🙏🙏
Thanks so much!
Can we use correlated sub query using each where clause with dept as the joining condition?
Can i please see the ERD table of this example? thanks!
Mam, how to find out number of transactions including current and historical transactions for an id if records are maintained in different database??
thank you soooo much for the second solution. i looked at so many solutions but they were all in postgrSQL or mySQL and didnt work with tSQL ... finally i can rest in peace
Thank you so much
Nice and great explanation more to come as videos. It helps a lot people like me
Glad it helped
Thxs for sharing this. I always stuck in this scenario question. This video will help
Glad it was helpful!
can we do this with cte
Can't we use subquery to derive these outputs??
Thanks a lot...👍👍👍
Thank you
Display the 35 years old and above with the highest salary ., pls help me
It is a great video, but it would be nice if you put .sql file in description so we can practice with same example 😁😁 just advice
Thank you. Sure, we will try to add the sql files for upcoming videos👍
@@LearnatKnowstarCould you please put the URL to that test database? I tried several but none were right.
Very helpful
Glad to hear that
Great tutorial
Thank you
Nice video and helpful
Thanks so much!!
show the ERD table
How to get max salary as well as min salary on department wise with employee other details as well.
You can use windows function - rank as explained in the second approach in the video.
Max Sal = Rank = 1 Order sal desc
Min Sal = Rank = 1 Order Sal Asc
Nice video.
Kindly share the same data aswell .That would be really helpful
The same query is covered in our latest tutorial on complex queries
th-cam.com/video/E_6haE_10eE/w-d-xo.html
There is practice data available for that tutorial. Hope it helps!
@@LearnatKnowstar Thank you so much. In real time scenerio of HR database,I used cte to make a temp table joing employees and departments table to practice your question.😀😀
Thank you so much for the dataset.It will save some time.
Ma'am, How to find the difference between punch in & punch out times of each employee, if those values are not in the same record?
You can try to do a self join to fetch the two related records.
@@LearnatKnowstar Thank you...
Query : list the name of the employee and department having salary >50000
Find out top 2 salaries from each department and list them out:
Table1
======
DEPT
id
dept_name
Table2
==========
EMP
emp_id
dept_id # foreign_key salary
Maam where is sql script
You can find it here -
know-star.blogspot.com/2021/01/sql-interview-queries-on-employee.html?m=1
Please speak in hindi.
Very helpful
Thank you