Learn & Practice SQL Complex Queries | 10 examples (Must DO for Interviews)

Поделиться
HTML-код
  • Опубликовано: 5 сен 2022
  • In this video, we practice writing SQL Complex queries.
    Below are the SQL Queries with their timelines -
    1- Find employees with highest salary in a department - 1:27:36
    2- Find employees with salary lesser than department average - 9:06:80
    3- Find employees with less than average salary in dept but more than average of ANY other Depts - 11:50:16
    4- Find employees with same salary - 15:42:90
    5- Find Dept where none of the employees has salary greater than their manager's salary - 20:06:16
    6- Find difference between employee salary and average salary of department - 25:41:96
    7- Find Employees whose salary is in top 2 percentile in department - 28:02:56
    8- Find Employees who earn more than every employee in dept no 2 - 31:19:63
    9- Department names(with employee name) with more than or equal to 2 employees whose salary greater than 90% of respective department average salary - 35:41:40
    10- Select Top 3 departments with at least two employees and rank them according to the percentage of their employees making over 100K in salary - 43:52:66
    All the material related to this video can be found here -
    know-star.blogspot.com/2022/0...
    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
    Please do not forget to like, subscribe and share.
    For enrolling and enquiries, please contact us at
    Website - knowstar.org/
    Instagram - / learn.knowstar
    Facebook - / knowstartrainings
    Linkedin - www.linkedin.com/company/know...
    Email - learn@knowstar.org

Комментарии • 55

  • @LearnatKnowstar
    @LearnatKnowstar  Год назад +2

    Need more tips and pointers to solve SQL Complex queries. Check out our latest video below -
    ruclips.net/video/YKHFhZJDw-o/видео.html

  • @saransubramani-cp1jp
    @saransubramani-cp1jp Год назад +2

    I thought sql was tough until I watch this video. Thanks for the wonderful explanation.

  • @Yash7642v
    @Yash7642v Год назад +2

    You the only destination for Datastage developer. I have cleared lots of interviews seeing your videos only. Please add the script for those questions. So that it will be helpful for practice.
    Thanks🙏

    • @LearnatKnowstar
      @LearnatKnowstar  Год назад +2

      Thank you. The scripts are available here -
      know-star.blogspot.com/2022/09/how-to-write-complex-sql-queries.html?m=1

  • @diydecor2653
    @diydecor2653 Год назад

    Great video. Explaining how to think logically is very helpful.

  • @amukelaniebenezer406
    @amukelaniebenezer406 Год назад +2

    Excellent explanations. Thank you for sharing

  • @nikolaybaranov2213
    @nikolaybaranov2213 Год назад +2

    Thank you for the video. That is how, step by step, the tasks should be solved!
    However, solution #4 is not correct because the number of employees with the same salary can be more than 2. Universal solution:
    SELECT EmployeeID
    ,FullName
    ,DeptID
    ,E.Salary
    FROM Employees E INNER JOIN (SELECT Salary
    FROM Employees
    GROUP BY Salary
    HAVING Count (Salary) >1) MS ON E.Salary = MS.Salary

    • @LearnatKnowstar
      @LearnatKnowstar  Год назад

      Thanks for sharing this. This is a great solution.

  • @hv0032113
    @hv0032113 Год назад

    Amazing content. Please post more of such detailed videos!

  • @avi8016
    @avi8016 Год назад +1

    Wow , great video as usual and questions were also good. Thanks a lot 🙏

  • @yakkaluruvijaysankar787
    @yakkaluruvijaysankar787 Год назад +1

    Very useful information. Very helpful for our preparation. Please do more videos like this. Thankyou

  • @successfulvictorypublisher6090

    Excellent coverage! Looking forward to plenty more queries -- I genuinely love this! Here's hoping that you can create more and more training series -- Basic, Intermediate and Advanced plus super-duper Complex examples! Dhanyawad! AWESOME!

  • @denizcantasdelen9755
    @denizcantasdelen9755 Год назад

    Thank you very much for your effort. I wish you success in your life

  • @AkashDeep-ux1ig
    @AkashDeep-ux1ig Год назад

    Gr8 vdo thnx for ur efforts

  • @natarajbeelagi569
    @natarajbeelagi569 Год назад +1

    2nd question can be solved using co related sub query.
    Select e.employeeID, e.DeptID, e.Salary from emp e where e.sal < (select avg(sal) from emp e2 where E1.deptno=e.deptno);

  • @abhaysingh-ve6gg
    @abhaysingh-ve6gg Год назад

    Really very helpful.

  • @kristyowens2284
    @kristyowens2284 Год назад

    Superb!

  • @esr58
    @esr58 Год назад

    Good explanation thank you

  • @hasanmougharbel8030
    @hasanmougharbel8030 Год назад

    Hey there,
    God bless your efforts.
    I have come through the term concurrence in sql, what does it actually means?
    Thanks for taking time to clarfifying this to me.

  • @shubhambharadwaj05
    @shubhambharadwaj05 9 месяцев назад

    I just subscribed this channel after seeing this video.. Wonderful explanation..
    I would suggest to make similar kind of scenarios questions videos playlist for PL/SQL also.

  • @sudhamanohar1
    @sudhamanohar1 8 месяцев назад

    Good

  • @sudhanshudash7792
    @sudhanshudash7792 Год назад

    I'm getting "Cannot insert explicit value for identity column in table 'Employees' when IDENTITY_INSERT is set to OFF." ERROR

  • @srirammaddula5661
    @srirammaddula5661 Год назад

    In the syntax of creating the table how you refer the managerId by using empID. I think there is a wrong syntax.

  • @varunthakur5832
    @varunthakur5832 11 месяцев назад

    wow

  • @johnadoga9765
    @johnadoga9765 7 месяцев назад

    great video, you've gained a subscriber, but it will be great to have the scripts so i can tag along, the links in the description isn't going through

    • @LearnatKnowstar
      @LearnatKnowstar  7 месяцев назад

      Thank you. You can find the sql statements and dataset here - know-star.blogspot.com/2022/09/how-to-write-complex-sql-queries.html?m=1

  • @almundher
    @almundher Год назад

    wow great keep it up, i will be grateful if you could tell how to get this database to my sqlserver so i can practice after watching
    sincerly

    • @LearnatKnowstar
      @LearnatKnowstar  Год назад

      Thank you.The dataset and sql links are in the description.

  • @tradingstation9080
    @tradingstation9080 Год назад +1

    in your screen query not visible properly becouse of latest ouput.

    • @LearnatKnowstar
      @LearnatKnowstar  Год назад +1

      All queries are provided in the link in the description box. Hope it helps.

  • @rajeshgoud9619
    @rajeshgoud9619 5 месяцев назад

    can you pls give me the data set script so that we can try practice

    • @LearnatKnowstar
      @LearnatKnowstar  5 месяцев назад

      You can find the practice dataset and sql queries here -
      know-star.blogspot.com/2022/09/how-to-write-complex-sql-queries.html

  • @vaibhavtiwari4201
    @vaibhavtiwari4201 10 месяцев назад +1

    Ma'am please reduce size of characters.. can't see full query at a time

    • @LearnatKnowstar
      @LearnatKnowstar  9 месяцев назад

      Will keep in mind. Thank you for bringing this to our attention.

  • @darbardarbar9460
    @darbardarbar9460 Год назад +1

    hi make a video 15 to 20 minutes

    • @LearnatKnowstar
      @LearnatKnowstar  Год назад

      Sure, we will be making medium length videos as well 👍

  • @amalkumar5201
    @amalkumar5201 Год назад

    Waise agar Hindi me ki hoti sure like Jayada subscribe hota but English hi without style bolo

  • @jaitiwari241
    @jaitiwari241 9 месяцев назад

    your script showing error

  • @amalkumar5201
    @amalkumar5201 Год назад

    Madam tum log style me ku bolte ho jra acche se bolo n

  • @amit4rou
    @amit4rou 9 месяцев назад

    Bhai samajh aarhi toh padhlo warna dusre channel follow krlo...
    Inka channel hai inki marzi...