Google SQL Interview Question | Step By Step Solution

Поделиться
HTML-код
  • Опубликовано: 20 окт 2024
  • In this video, we are going to solve SQL questions asked on Google for Data Analyst, Data Engineer, and Data Science positions.
    Practice more questions here (Interview Query) - bit.ly/3w41nCJ
    Join Data With Darshil Discord Server: / discord
    👦🏻 My Linkedin - / darshil-parmar
    📷 Instagram - / darshilparmarr
    🎯Twitter - / parmardarshil07
    🌟 Please leave a LIKE ❤️ and SUBSCRIBE for more AMAZING content! 🌟
    3 Books You Should Read
    📈Principles: Life and Work: amzn.to/3HQJDyP
    👀Deep Work: amzn.to/3IParkk
    💼Rework: amzn.to/3HW981O
    Tech I use every day
    💻MacBook Pro M1: amzn.to/3CiFVwC
    📺LG 22 Inch Monitor: amzn.to/3zk0Dts
    🎥Sony ZV1: amzn.to/3hRpSMJ
    🎙Maono AU-A04: amzn.to/3Bnu53n
    ⽴Tripod Stand: amzn.to/3tA7hu7
    🔅Osaka Ring Light and Stand: amzn.to/3MtLAEG
    🎧Sony WH-1000XM4 Headphone: amzn.to/3sM4sXS
    🖱Zebronics Zeb-War Keyboard and Mouse: amzn.to/3zeF1yq
    💺CELLBELL C104 Office Chair: amzn.to/3IRpiL2
    👉Data Engineering Complete Roadmap: • Data Engineer Complete...
    👉Data Engineering Project Series: • Data Engineering Proje...
    👉Become Full-Time Freelancer: • Best Freelancer Series...
    👉Data With Darshil Podcast: • Podcast Series - Data ...
    ✨ Tags ✨
    google interview question, google SQL interview, how to prepare for data science interview, data engineer interview question, data analyst SQL question
    ✨ Hashtags ✨
    #faang #inteview #sql

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

  • @DarshilParmar
    @DarshilParmar  2 года назад +16

    If you want more videos like this then let me know and don't forget to hit that LIKE button :D

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

      Yes, keep up the good work!!!

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

      Darshil … good video content and great explanation….I have a question….Is the syntax you typed for sql server OR Oracle DB???

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

    It's so easier to learn SQL from your video the way you explain step wise.
    In other videos, people try to solve question themselve but you try to solve exactly like how someone learning sql would do. Highly appreciated.

  • @surojit6315
    @surojit6315 2 года назад +12

    Create this type of SQL interview ques video more👍

  • @Ronak-Data-Engineer
    @Ronak-Data-Engineer 2 года назад +3

    Please create a complete playlist for all top most SQL Interview questions generally asked in most of product based, this video is very helpful 😊

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

      Yes I’ll try my best to create this

    • @sanjeevkumar-iw2lz
      @sanjeevkumar-iw2lz 2 года назад

      @@DarshilParmar Yes, please create playlist of sql questions, that will be unique, i am not finding any such playlist on YT

  • @sandeepgaur98223
    @sandeepgaur98223 2 года назад +6

    Hi. I think dense_rank() should be used instead of rank(). Rank() function skips the rank when there are duplicate values.
    So assuming if engineering department has the salary as 8000, 8000, 8000, 7000, 6000, 5000.
    The rank function will only give the employee output as 8000,8000,8000 (For the top 3 salaries).
    Whereas dense_rank will give the employee info output for the salary of 8000, 7000,6000. (Total 5 Rows of output)

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

      Logic does look correct but question says top 3 employee salary to be returned, if top 3 employee salary has 8000 and those should be printed because 7000, 6000 does not come
      If question said print top 3 different salary for each department then we can use this and get distinct value for top 3 different

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

      @@DarshilParmar I read the question again, and here is my thought on that:
      Question is not clear. It doesn't specify if the duplicate should be allowed. So if we generalize it to a real life scenario on school ranking... then each student who gets the same marks are assigned with the same rank.
      But I do get your point as your query passed all the test cases and your assumption worked in this question.
      It was nice connecting to you.
      Thanks!

    • @krishnavasani26
      @krishnavasani26 5 месяцев назад +1

      @DarshilParmar, for the case that you mentioned where top 3 salaries has same salary of 8000, we should use row_number() instead of rank(). Any thoughts?

  • @SandipTiwari-lr8hf
    @SandipTiwari-lr8hf 3 месяца назад

    This is the best video I have ever seen

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

    Can use qualify row_number() over (partition by department_id order by salary desc)

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

    This was amazing.. keep doing this type of videos

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

    absotuley amazing. Please do come up with more such complex problems and explain us.

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

    This is very good detailed explanation.

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

    Why you use cte??using alias table we can do

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

    Great content , looking forward to see more such e.g for Amazon

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

    We need more video like this 👍

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

    Hi Darshil Bhai please tell me how to build logical thinking for writing this kind of questions in SQL.
    waiting for reply...

  • @as-youtuber6215
    @as-youtuber6215 2 года назад

    Wow Amazing content man

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

    Recently came across your content and it really is super helpful and amazing Darshil! As someone who is looking to get into DE, do you feel we would be ready for an entry level position after completing DataQuests track? I really like the text based content rather than video

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

      Thank you Matthew
      I'd say try it by yourself whatever is comfortable, I also read books sometimes to learn things because I find it more insightful so if you like text based content, try it.
      Worst that can happen is you will learn something new

  • @SrideviChoudhury-n7g
    @SrideviChoudhury-n7g 3 месяца назад

    Very helpful

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

    Great

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

    Great work, man

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

    Hey darshi , I love the video ..... Before your video i see some other youtubers video the solve the problem but they didn't explain it well😓🥲. But you explain it in such a easy way 😁😍 please make this type of videos more 🥺. Can you tell us which website u use for this 🤔can we practice there this type of questions?

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

      I used InterviewQuery for this, I have added link in description if you want to practice more

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

      @@DarshilParmar ok thanks

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

    okay, that was amazing

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

    Cant we use GROUP BY department and then get the top 3 values by LIMIT 3?

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

      If you use limit 3, it will only return 3 rows, we want to return 3 rows for each department
      Try writing a query and executing it

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

      @@DarshilParmar Thank you

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

    We can also use subquery instead of cte right?

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

    Hi Darshil, we could use dense_rank() to avoid skipped rank. Right?
    According to me dense_rank() is more appropriate.

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

      Question says, highest top 3 employees salary by department, if we use dense rank and and if we have salary duplicates then we might not get expected output
      Your assumption is correct and if question said something like "Find top the different salary by department" then we could have use dense_rank()

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

    More such videos, bro.

  • @kk-ud6ue
    @kk-ud6ue 2 года назад

    Good one

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

    Ur helping alot

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

    Sir tell the best sites to practice SQL questions

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

      You can use InterviewQuery, I have added link on description

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

      Thank you sir 😀

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

    This is best video i have ever seen.