SQL Interview questions | Data Analyst | Part - 1

Поделиться
HTML-код
  • Опубликовано: 30 июл 2024
  • 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

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

  • @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 😊

  • @Pragya3421
    @Pragya3421 Месяц назад +4

    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.

  • @arpanmahali3584
    @arpanmahali3584 11 дней назад

    I don't know whether the interviewer will ask me this type of questions or not..
    but the way you are explaining is really amazing...
    learnt a new thing..
    thank you so much..

    • @TheMLMine
      @TheMLMine  11 дней назад

      Thanks. Glad it was helpful

  • @Bigbakerscafe01
    @Bigbakerscafe01 11 дней назад +1

    Bro please make a video on sql for data analyst roadmap and which things to learn is mandatory for experienced data analyst 🎉❤

    • @TheMLMine
      @TheMLMine  9 дней назад +1

      Sure. I will try to summarize the SQL learning as a roadmap in a separate video. Thanks for your feedback

  • @akashkhantwal2430
    @akashkhantwal2430 6 дней назад

    Sir, you are doing great and amazing video for upcoming data analyst❤

    • @TheMLMine
      @TheMLMine  6 дней назад

      Thanks Akash. Glad it was helpful

  • @hamudxd9497
    @hamudxd9497 Месяц назад

    GOOD❤

  • @dharmajakrishnakunche5692
    @dharmajakrishnakunche5692 Месяц назад

    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 RUclips 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  Месяц назад

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

  • @apurvabomle8606
    @apurvabomle8606 Месяц назад

    Wonderful explanation 😊keep it up✌️

  • @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.

  • @Bigbakerscafe01
    @Bigbakerscafe01 11 дней назад

    Bro your way of explaining is great 👍 subscribing from this video❤

  • @karthipalanivel6345
    @karthipalanivel6345 14 дней назад +1

    Please explain mssql also while explining the mysql querys

    • @TheMLMine
      @TheMLMine  12 дней назад

      Hi Karthipalanivel, I could do that but different servers support different syntax of queries. So, I could not do that in the same video. But, I will see if I can cover it in my upcoming videos. Thanks for your feedback.

  • @piudutta5665
    @piudutta5665 13 дней назад

    👍

  • @rajm5349
    @rajm5349 3 дня назад

    thnq fr the nce xplanation. can u xpln health care project if possble

    • @TheMLMine
      @TheMLMine  День назад

      Hi raj, if you have any interview question related to any health care project, please let me know. I can make a separate video on that.

  • @Pragya3421
    @Pragya3421 Месяц назад +1

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

    • @TheMLMine
      @TheMLMine  Месяц назад +3

      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 !

  • @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-dt1tb Месяц назад +1

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

    • @TheMLMine
      @TheMLMine  Месяц назад +1

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

    • @raviyadav-dt1tb
      @raviyadav-dt1tb Месяц назад

      @@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  Месяц назад +4

      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 RUclips 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.

    • @fahadhussain9824
      @fahadhussain9824 23 дня назад

      @@TheMLMine Bro you give great tip on how to think and approach the problem you are the one who can give these kind of tips no other youtuber or even any person had gave that kind of high quality tips and knowledge Plz share more of your tips that how you can Plz give us more tips on how to improve our logical and critical thinking and Thankyu

  • @himanisrivastava1800
    @himanisrivastava1800 22 дня назад

    1K SUBSCRIBERS

    • @TheMLMine
      @TheMLMine  22 дня назад

      Thanks. And you are the 1000th subscriber