SQL Interview questions | Data Analyst | Part - 1

This video is the first part of our series on SQL interview questions and answers. This series is specifically designed for people targeting jobs as data analysts, data scientists, data engineers, and business analysts.
In this video, I have explained two methods to solve the given question using MySQL workbench.
Use the below the commands to create your own database and table:
CREATE DATABASE THEMLMINE;
USE THEMLMINE;
CREATE TABLE Employees(
ID INT NOT NULL PRIMARY KEY,
Name VARCHAR(20),
Salary INT
);
INSERT INTO Employees VALUES
(1, 'Somesh', 90000),
(2, 'Vinay', 70000),
(3, 'Hima', 75000),
(4, 'Prashant', 70000),
(5, 'Shivangi', 45000),
(6, 'Priya', 40000),
(7, 'Mohan', 95000);
You can download the final script from here:
drive.google.com/file/d/1bfqx...
Learn SQL from scratch: • SQL Tutorial for begin...
Instagram: / the_ml_mine
Timestamps:
00:00 Intro to series
00:12 Interview Question
00:39 Query using LIMIT and OFFSET
05:47 Query using DENSE_RANK
10:46 Summary
11:27 Outro
Intro music : Education - upbeat positive (short ver.) by AudioCoffee -- freesound.org/s/724628/ -- License: Attribution NonCommercial 4.0

Пікірлер: 18

  • @TheMLMine
    @TheMLMineАй бұрын

    If you know SQL questions that were asked in any job interview, do write them in comments. If popular, I will make a solution video on the same 😊

  • @hamudxd9497
    @hamudxd949710 күн бұрын

    GOOD❤

  • @Pragya3421
    @Pragya342116 күн бұрын

    This is the best explanation I have ever seen without complicating the thing. Even a beginner can understand the functions of '"LIMIT, OFFSET, DENSE_RNK, RNK" etc.

  • @TheMLMine

    @TheMLMine

    16 күн бұрын

    Thank you Pragya

  • @dharmajakrishnakunche5692
    @dharmajakrishnakunche569215 күн бұрын

    This is the most concise as well as detailed explanation to the question!! You deserve more likes and subs!!!! And trust me this my second time commenting of KZread ever!! Thought your explanation is crisp and clear!! Also Please cover topics like stored procedures, indexing, normalisation etc!! Would really appreciate!! Thank you!! Keep up the good work!!!

  • @TheMLMine

    @TheMLMine

    14 күн бұрын

    Thank you. Glad to hear. Sure, I will try to cover these topics in a separate video.

  • @apurvabomle8606
    @apurvabomle860610 күн бұрын

    Wonderful explanation 😊keep it up✌️

  • @TheMLMine

    @TheMLMine

    10 күн бұрын

    Thanks apurva

  • @Pragya3421
    @Pragya342116 күн бұрын

    So, in case of Dense_rank, we don't need to use the "distinct" command for repeated salary? Why so?

  • @TheMLMine

    @TheMLMine

    16 күн бұрын

    Correct. You need to understand that when we used LIMIT with OFFSET. The duplicate salaries were counted as two separate instances while counting with OFFSET command. Ideally, the salary of Vinay and Prashant should be counted as one which is the 4th highest salary (not 4th and 5th highest salary). To avoid that we used DISTINCT, so that only unique salaries are provided to the OFFSET command (to overcome its above discussed limitation). While in DENSE_RANK we don't have such issue. It automatically provided the same rank to Vinay and Prashant, indicating that the two rows are counted as single instance (unlike OFFSET). So, we don't need to use DISTINCT command here. Hope it answers your question !

  • @sweetsubha514
    @sweetsubha514Ай бұрын

    Wow the way you explained 👌..Thank you so much... very informative... And please make a video on MySQL index,stored procedure, views & remove duplicates and also joins (queries)

  • @TheMLMine

    @TheMLMine

    Ай бұрын

    Thanks subha. I will try to cover that in future.

  • @rokithkumar4905
    @rokithkumar4905Ай бұрын

    Great 👍🏻 but what abt pandas tutorial part-3 😢

  • @TheMLMine

    @TheMLMine

    Ай бұрын

    Hi Rokith, are there any specific topics in the pandas tutorial that you think were important and were not covered? Let me know

  • @raviyadav-dt1tb
    @raviyadav-dt1tb11 күн бұрын

    I’m facing more challenges in sql how to overcome it? Please help me

  • @TheMLMine

    @TheMLMine

    10 күн бұрын

    Hey Ravi, could you please explain what challenges you are facing in SQL?

  • @raviyadav-dt1tb

    @raviyadav-dt1tb

    10 күн бұрын

    @@TheMLMine thank you bro i mean to say I’m weak in sql query because in interviews most of the time I got rejected due to only sql query

  • @TheMLMine

    @TheMLMine

    9 күн бұрын

    Even in my case as well, I got rejected a few times just because of SQL queries. What I did is - There are SQL questions that are asked in interviews and are standard. Try to solve all of them. Watch SQL interview questions from different KZread channels as well. It will increase the probability of solving questions in your next interview. - Don't just see the solution, but understand the approach. Ask questions like what would happen If I used this command instead of that and spend some time with the solution. It will develop your thinking pattern for solving new problems. - Trust your capabilities, you can crack the interview only if you believe that you can do it. Stick to it. I know you will get through it as well.