Top 10 SQL interview Questions and Answers | Frequently asked SQL interview questions.

Поделиться
HTML-код
  • Опубликовано: 15 янв 2022
  • In this video we will discuss most frequently asked top 10 SQL interview questions. If you have any interview I am sure 2-3 questions will be from this list.

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

  • @ankitbansal6
    @ankitbansal6  Год назад +17

    Master the art of SQL @ Rs 1999 with my zero to hero SQL course. The course is focused on data analytics and covers all the advanced concepts starting from scratch.
    www.namastesql.com/courses/SQL-For-Analytics-6301f405e4b0238f71788354
    Course contains 2 portfolio projects and a bonus session on Tableau.
    100+ interview problems to crack any SQL INTERVIEW.

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

      Is it in udemy ?

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

      @@avinashmishra4995 nope

    • @Rohitraj-mv3pz
      @Rohitraj-mv3pz 5 месяцев назад

      ​@@ankitbansal6 bro i really need your help.. is there any way i can reach out to you..

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

      Delete duplicate records query in not working in databricks notebook for deleting duplicate records from a table.. is there any way to do this in databricks notebook table?

  • @mariecurie5245
    @mariecurie5245 Год назад +62

    create table emp(
    emp_id int,
    emp_name varchar(20),
    department_id int,
    salary int,
    manager_id int,
    emp_age int);
    insert into emp
    values
    (1, 'Ankit', 100,10000, 4, 39;
    insert into emp
    values (2, 'Mohit', 100, 15000, 5, 48);
    insert into emp
    values (3, 'Vikas', 100, 10000,4,37);
    insert into emp
    values (4, 'Rohit', 100, 5000, 2, 16);
    insert into emp
    values (5, 'Mudit', 200, 12000, 6,55);
    insert into emp
    values (6, 'Agam', 200, 12000,2, 14);
    insert into emp
    values (7, 'Sanjay', 200, 9000, 2,13);
    insert into emp
    values (8, 'Ashish', 200,5000,2,12);
    insert into emp
    values (9, 'Mukesh',300,6000,6,51);
    insert into emp
    values (10, 'Rakesh',300,7000,6,50);

    • @ankitbansal6
      @ankitbansal6  Год назад +6

      Thank you 😊

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

      thanks

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

      god bless you

    • @kartikpidurkar9590
      @kartikpidurkar9590 Год назад +7

      create table orders(
      customer_name char(10),
      order_date date,
      order_amount int,
      customer_gender char(6)
      );
      insert into orders values('Shilpa','2020-01-01',10000,'Male');
      insert into orders values('Rahul','2020-01-02',12000,'Female');
      insert into orders values('Shilpa','2020-01-02',12000,'Male');
      insert into orders values('Rohit','2020-01-03',15000,'Female');
      insert into orders values('Shilpa','2020-01-03',14000,'Male');

    • @kartikpidurkar9590
      @kartikpidurkar9590 Год назад +9

      create table department(
      dept_id int,
      dept_name varchar(10)
      );
      insert into department values(100,'Analytics');
      insert into department values(300,'IT');

  • @aasthamehtatech
    @aasthamehtatech 2 года назад +4

    Crisp & insightful

  • @sheikhshah2593
    @sheikhshah2593 9 месяцев назад +2

    Literally great.
    In all my SQL interviews one or the other is asked.
    Subscribed

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

    Really Master class videos Ankit, Thanks.

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

    Your videos are very good and helpful. Thank you for providing data with create and insert statements.

  • @pavitrashailaja850
    @pavitrashailaja850 2 года назад +2

    Thnks for the video. Very helpful 👍

  • @suketshah7697
    @suketshah7697 2 года назад +3

    very simple way to explain...Nice!

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

    Good explanation👏 Please do more intermediate and advanced level of concepts in SQL.

  • @abhishek_grd
    @abhishek_grd 2 года назад +1

    Bang on ! Started product based companies interview prepration for Sr. DE role ( Google/Microsoft/Ubder/Amazon/Expedia / AirBnB) etc...and your content is crisp and clear. Thanks

  • @tupaiadhikari
    @tupaiadhikari 2 года назад +22

    For the First time in 10 years, I am feeling confident with using SQL, only after watching your series of videos. Earlier I used Python to do data preprocessing after doing Vanilla Select * from Table Statement, which was not a recommended approach for memory efficiency.

    • @ankitbansal6
      @ankitbansal6  2 года назад +5

      This is great. Best place to play with data is where it is residing 😊

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

    Wow it wsd asked today delete duplicates..thanks for the videos.it is really really helpful

  • @sandeeplakde7739
    @sandeeplakde7739 2 года назад

    Very well explained... 👌

  • @gracepaet4887
    @gracepaet4887 2 года назад +1

    Great video! Loved that last question. Subbed and eager to practice more SQL with your other videos

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

    Thank for the video 🙏

  • @One_Of_Kind_Jilu
    @One_Of_Kind_Jilu 2 года назад

    Just landed here bro you are doing amazing job

  • @raghum4938
    @raghum4938 3 месяца назад

    simple and clear explanation!!

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

    It will be helpful if you can create videos on views and stored procedures

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

    Tqsm for awesome explanation 🔥

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

    You just earned a subscribe from me bro. I haven't used SQL in years, but due to a career change I'm planning to have soon, I'll need to learn more about SQL in-depth alongside bettering my skillset in C++ programming.

  • @irinasummey4156
    @irinasummey4156 2 года назад

    Great video, I took down some notes!

  • @OmkarShinde-bz7oy
    @OmkarShinde-bz7oy 11 месяцев назад

    yeah it was really important vid as see for the interveiw sceneriao

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

    Thanks for this!

  • @AnshuKumar-lh4gr
    @AnshuKumar-lh4gr 2 года назад +1

    Good one .. !!

  • @surabhijagadish5210
    @surabhijagadish5210 3 месяца назад +1

    Awesome

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

    You just earned a subscriber really great content🥺

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

    thanks, it actually let me through so i could download it.

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

    Great content. Thank you Ankit

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

    Thanks ankit, ur videos always encourage and boost confidence to prac more n go beyond our limit. Thanks Man

  • @rohitsehajpal9295
    @rohitsehajpal9295 10 месяцев назад +3

    Hi Ankit, first of all this is really a great initiative that you are sharing all this knowledge and explaining the complex queries in a very easy way.
    And because of this I am really glad to tell you that your channel has majorly helped me to crack one of the SQL interview. Thank you so much for such a great effort and we all wish to see some more complex queries and concepts in coming future, once again thank you so much. Wish you a great health!

    • @YG-jb2in
      @YG-jb2in 10 месяцев назад +1

      Hey for which position you cleared the interview. And you cleared it as a fresher or experienced. Please reply.

  • @suman3316
    @suman3316 2 года назад +2

    Very Useful...I hope part2 will come soon

  • @gourabnandy826
    @gourabnandy826 2 года назад +1

    Hi Ankit, loved your all videos. Looking forward to see a video on subqueries,

  • @abdulwahab-rw1yq
    @abdulwahab-rw1yq 2 года назад

    Thanks Ankit its very helpful in interivews wish i had come across your videos early.. thnks much

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

    keep doing more videos like it. It really helped me in my job interview today. I am able to answer the question of how to remove duplicates from a table because of your videos.

  • @puneeth74
    @puneeth74 2 года назад +1

    Thanks for this video.

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

    Just loving your content.. Very well explained.

  • @happyheart9431
    @happyheart9431 6 месяцев назад

    Million thanks

  • @fog2640
    @fog2640 6 месяцев назад

    finished watching

  • @nitinnagpalofficial
    @nitinnagpalofficial 2 года назад +2

    Ankit, I love your educational content. Is it possible for you to record the whole PL/SQL course for beginner/Intermediates?

    • @ankitbansal6
      @ankitbansal6  2 года назад +1

      Thank you. I will plan in future 🙂

  • @user-mz5dn4el7j
    @user-mz5dn4el7j 2 дня назад

    Ankit sir added humour silently in this video with q10 😃

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

    Superb video..liked every second of the video 💖

  • @diptaganguly2346
    @diptaganguly2346 2 года назад +1

    Very Good explanation!

  • @itsme1674
    @itsme1674 2 года назад

    Thanks 👍

  • @lokeshsharma2852
    @lokeshsharma2852 2 года назад +1

    Thanks sir for this amazing video

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

    Thanks a lot, Learned lots of new concepts.

  • @prakharsrivastava6571
    @prakharsrivastava6571 2 года назад +1

    revised today for deloiite interview and suscribed too

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

    I have subscribed and liked . you are doing wonderful job

  • @shuvo9131
    @shuvo9131 2 года назад

    Thanks brother, nice explanation

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

    Very helpful sir, thank you!

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

    Beautiful presentation

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

    Amazing video, tomorrow I have an interview, I was clueless how to start and where to start, now I know what to do for tomorrow :))
    Thanks for sharing :)

  • @LogicQuest
    @LogicQuest 2 года назад +1

    thanks Ankit..good tutorial..

  • @dineshpanda5804
    @dineshpanda5804 2 года назад

    Love your valuable contents. I have few question sets from facing different screening. Can I share with you for help with solutions? Your way of explanation helps a lot

    • @ankitbansal6
      @ankitbansal6  2 года назад

      Sure send me on ankitbansal1988@gmail.com

  • @agirmaus-lh9zi
    @agirmaus-lh9zi Год назад

    very helpful ..thanks

  • @yashdhas8202
    @yashdhas8202 2 года назад

    I am watching your one video each morning.
    So one day I will work as data engineer in good product based company.

    • @ankitbansal6
      @ankitbansal6  2 года назад

      Thats a great way of preparing yourself 😊🙏

  • @ririraman7
    @ririraman7 2 года назад +1

    Thank you so much.
    Make vidoes on JOINS.

  • @prajjwaljaiswal3419
    @prajjwaljaiswal3419 2 года назад

    You are doing really awesome. Please keep doing this.
    One suggestion: Please don't forget to add create table script.

    • @ankitbansal6
      @ankitbansal6  2 года назад +1

      Thank you. Scripts are there in most of the video description box. Might have missed few in my initial videos. Will put them soon.

    • @prajjwaljaiswal3419
      @prajjwaljaiswal3419 2 года назад

      @@ankitbansal6 Cool

  • @suryanshsinghkarchuli9892
    @suryanshsinghkarchuli9892 2 года назад +2

    for better reach, keep creating content

  • @namanverma6509
    @namanverma6509 2 года назад

    Please make a playlist for sql for the beginners which includes everything like joins, Subquery, functions which used in ms sql..

  • @yashsoni2113
    @yashsoni2113 2 года назад +7

    DDL and Insert values for emp table.
    create table emp(
    emp_id int,
    emp_name varchar(20),
    department_id int,
    salary int,
    manager_id int,
    emp_age int);
    insert into emp
    values
    (1, 'Ankit', 100,10000, 4, 39),
    (2, 'Mohit', 100, 15000, 5, 48),
    (3, 'Vikas', 100, 10000,4,37),
    (4, 'Rohit', 100, 5000, 2, 16),
    (5, 'Mudit', 200, 12000, 6,55),
    (6, 'Agam', 200, 12000,2, 14),
    (7, 'Sanjay', 200, 9000, 2,13),
    (8, 'Ashish', 200,5000,2,12),
    (9, 'Mukesh',300,6000,6,51),
    (10, 'Rakesh',300,7000,6,50);

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

    Wow such a nice content. Please zoom a bit while making videos. Because most audience watch it over phone it strain the eyes

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

    please make a part 2 of this video Ankit.
    thank you for your efforts

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

    Thanks

  • @dhirajsharma1199
    @dhirajsharma1199 2 года назад +2

    Wonderful crisp and short explanation Ankit.
    I have my interviews lined up can you share resources for SQL interview questions, Data Modelling and Normalization scenario based questions?
    I know all basics and all theories but I want to practice on questions which have answers as well.

    • @ankitbansal6
      @ankitbansal6  2 года назад

      Thanks Dhiraj. You can practice more from leetcode.

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

    5/123
    Stuck with 2 ques , coz i'm using mysql

  • @gameply347
    @gameply347 3 месяца назад

    I guess we can use subquery table as a normal table to display information using alias and where clause , but when it comes to comparison it needs to return only 1 value :) !!

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

    hi Ankit , can you please make some videos for product based companies. Thank yoou for your effort. Appriciatable

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

      I have a lot of them. Check out complex SQL playlist

  • @shwetadubey8880
    @shwetadubey8880 10 месяцев назад

    Just wanted to know can we use left anti join for the 5th question?

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

    Thank you bro

  • @Ks-yi8ky
    @Ks-yi8ky 5 месяцев назад

    Sir pls make latest interview sql quetions

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

    Ankit bhai if you have time can you solve some hacker rank test questions for better understanding for people who are learning sql newly..that would be helpfull

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

      Do you have some links to the good problems?

  • @abhishek_grd
    @abhishek_grd 2 года назад +1

    @Ankit , Requesting you to add more scenario based SQL questions mostly asked in NICHE Product based companies, would be helpful.

  • @adityabaha
    @adityabaha 2 года назад +1

    Yes, you are absolutely right, Many questions are based on your teaching. Thanks again for this great help Ankit!!

  • @ritikajaiswal3824
    @ritikajaiswal3824 2 года назад +1

    can you make a video on stored procedures.. from basic to everything needed to know

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

    you don't need the motivation from others because, you yourself is a motivation 🤗

  • @abb_raj1107
    @abb_raj1107 2 года назад

    what if i wanna to swap from row 4 and 5 value , I think 'case' only do for the first occurrences of match value.Thus why, only the first two rows are evaluated with case clause and rest remain the same. Is it true bhai? I am not clear about it. Plz shed some light .

  • @abhishek_grd
    @abhishek_grd 2 года назад +1

    Hello Ankit, I have onre request along with the explanation if you can share the create table command as well , will be helpful to dummy it to my own schema.
    Like here employee table

    • @ankitbansal6
      @ankitbansal6  2 года назад

      I have create and insert in most of the problems description. I will make sure I don't miss in future. Thanks for pointing out 😊

  • @kunalgaurav3301
    @kunalgaurav3301 10 месяцев назад

    Hi, Ankit. you made them look so easy. Thank you💌.
    it would be great if you could provide the code of the creation of tables so i can practice it on my workbench.

    • @ankitbansal6
      @ankitbansal6  10 месяцев назад

      It's there in the comments section

  • @fired_developer
    @fired_developer 10 месяцев назад

    Sir please raise the editor font more than 130% while recording , coz it's very hard to watch on the phone

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

    1m likes 👍

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

    Hello ankit,
    Seems like you have lots of videos but not in a playlist, for ex: I want to start from the beginner level and then moved to medium then hard queries. I have seen your playlist but lots of videos aren't there where you are explaining things like the date function, and rank function, If it's in a playlist/series then it would be easier for us to go through step by step. Let me know if you already have or i have missed something.

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

    I asked a question a employee enters and leaves office and he swipes in and swipes out in multiple instances, so I want to find the total office hours he spent in the office( he may come at 10 PM and take a break at 12:30 AM in that case it shows that he is spending 2 hours in that day but that's not true right), so now I have to calculate total time he spent
    employee id, Office_swipe_record given

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

    Thanks for this Video. I have one doubt, Question number 2. How to delete duplicates from a table? Shall we do it in mysql? I tried but I didn't get correct result.

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

    Performance wise why joins are better than subqurey??

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

    @Ankit Bansal bhai if we have left whats the use of right join ?

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

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

    Delete duplicate records query in not working in databricks notebook for deleting duplicate records from a table.. is there any way to do this in databricks notebook table?
    @ankit

  • @sandeepkumar-ol5lg
    @sandeepkumar-ol5lg Год назад

    Hi Ankit, till now I don’t know we can even delete the records from cte rather from actual table, could you please tell more about this

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

    #For swap gender :
    update orders
    set customer_gender=IF(customer_gender='Male','Female','Male');

  • @k.hariharasudan9335
    @k.hariharasudan9335 3 месяца назад

    Q7. MSSQL does not depend on case-sensitive but in the Oracle is depend on the case-sensitive

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

    Helpful video, Thanks.
    could you please share the dataset used in the video, to practice please.

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

      It's there in the comments section

  • @RK-wf7re
    @RK-wf7re 6 месяцев назад

    Good content, i have a question why table name used as emp1, it should be emp right?

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

    In the 2 question, delete from cte is written so how the records got deleted from original table

  • @user-re7xo7nw8q
    @user-re7xo7nw8q Год назад

    Your approach to Delete duplicate valuse from the table is not working in my sql (gettting this pop up "The target table cte1 of the DELETE is not updatable")

  • @user-ur6ot2xl8y
    @user-ur6ot2xl8y 9 месяцев назад

    Hi, I've got a query here.
    In the 2nd question, we are deleting the duplicate values from cte, how is it getting reflected in emp1 table?

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

      +1 to the question. Also @AnkitBansal, why did we go ahead and use Partiton concept to find and delete duplicate and why couldnt we have used the first logic of count(1) and use it in where clause and delete the entries cause thats what we actually did with rownumber as well. isn't it?

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

    Hi Ankit , i start following your tutorial , it is really helpful . nut i am not able to connect SSMS at my local computer , can you please help me what should be server name . i am using SSMS 2019

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

      Localhost

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

      Make sure you have installed SQL server as well. ssms is just a client to access data base

  • @NitishKumar-xr9tx
    @NitishKumar-xr9tx 3 месяца назад

    In 2nd Question of removing duplicates: We are deleting values from the CTE table which is a TEMP table. Then how it is deleting values from the MAIN table?

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

    Done

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

    What is the difference between union and union distinct

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

    Can you please tell me how to delete duplicates in mysql?