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
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 😊
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.
Thank you Pragya
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..
Thanks. Glad it was helpful
Bro please make a video on sql for data analyst roadmap and which things to learn is mandatory for experienced data analyst 🎉❤
Sure. I will try to summarize the SQL learning as a roadmap in a separate video. Thanks for your feedback
Sir, you are doing great and amazing video for upcoming data analyst❤
Thanks Akash. Glad it was helpful
GOOD❤
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!!!
Thank you. Glad to hear.
Sure, I will try to cover these topics in a separate video.
Wonderful explanation 😊keep it up✌️
Thanks apurva
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)
Thanks subha. I will try to cover that in future.
Bro your way of explaining is great 👍 subscribing from this video❤
Thanks bro
Please explain mssql also while explining the mysql querys
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.
👍
thnq fr the nce xplanation. can u xpln health care project if possble
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.
So, in case of Dense_rank, we don't need to use the "distinct" command for repeated salary? Why so?
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 !
Great 👍🏻 but what abt pandas tutorial part-3 😢
Hi Rokith, are there any specific topics in the pandas tutorial that you think were important and were not covered? Let me know
I’m facing more challenges in sql how to overcome it? Please help me
Hey Ravi, could you please explain what challenges you are facing in SQL?
@@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
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.
@@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
1K SUBSCRIBERS
Thanks. And you are the 1000th subscriber