Average Time of Process per Machine | Leetcode 1661 | Crack SQL Interviews in 50 Qs

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ย. 2024

ความคิดเห็น • 22

  • @learnwithchirag
    @learnwithchirag  5 หลายเดือนก่อน +1

    Hey there! 👋 For more interesting content, tutorials, and updates, Feel free to connect with me on
    Instagram Handles :-
    @createwithchirag - instagram.com/createwithchirag/
    @learn.with.chirag - instagram.com/learn.with.chirag/
    LinkedIn: www.linkedin.com/in/chirag-sehgal-9200111b8/
    Let's stay connected and keep the creativity flowing! 💡

  • @baivabsarkar
    @baivabsarkar 23 ชั่วโมงที่ผ่านมา

    Great explanation! I was trying a new approach and came across this query, the runtime of 197ms, beating 87.71%
    SELECT a1.machine_id,
    ROUND(AVG(a2.timestamp - a1.timestamp), 3) AS processing_time
    FROM Activity a1
    JOIN Activity a2
    ON a1.machine_id = a2.machine_id
    AND a1.process_id = a2.process_id
    AND a1.activity_type = 'start'
    AND a2.activity_type = 'end'
    GROUP BY a1.machine_id;

  • @Still_standing418
    @Still_standing418 10 หลายเดือนก่อน +3

    Another Problem made easy, thanks.

  • @akhilpratapsingh3223
    @akhilpratapsingh3223 9 หลายเดือนก่อน +2

    Nice explanation bhaiya

    • @learnwithchirag
      @learnwithchirag  9 หลายเดือนก่อน

      Thanks brother ! Keep Learning :)

  • @AmandeepSingh-gv8gg
    @AmandeepSingh-gv8gg 4 หลายเดือนก่อน +1

    but sir why group by

    • @yashrodge3050
      @yashrodge3050 4 หลายเดือนก่อน

      Because we have duplicate machine id

  • @jeevananuragi6500
    @jeevananuragi6500 6 หลายเดือนก่อน +1

    sir i want ot be data analyst..guide me plz..
    what topics
    what project
    where to find job
    where to practice and which topic problems
    which oyutube channel or source is good

    • @learnwithchirag
      @learnwithchirag  6 หลายเดือนก่อน +2

      For becoming a good Data Analyst , these are the steps you need to follow-
      1) Understand Business - how they work , how data is important for them , which type of data can increase their revenue.
      2) Learn Relevant Skills & tools - excell , SQL , Power BI or tabelue , also research for tools which are in demand these days and learn them too.
      3) Profile Building - Make real time projects , take data from websites like kaggle , also take data from some real business and try to implement them , make dashboard ....make advance projects , see the people already in this industry , what projects are they making.... make ATS Friendly resume , do internship or freelancing projects
      4) Build Network & Apply for Job - Use Platforms like Linked In , Twitter ...showcase your skills their and tag recruiters from your dream company....if your work will be good they will definitely reach back to you. At last apply for 100s of jobs , you will get reply from atleast 4-5 of them.

  • @Krishnaeagle-ex4zj
    @Krishnaeagle-ex4zj 3 หลายเดือนก่อน +1

    Hi @learnwithchirag how did you able to run the code to get output int grid format at 5:30

  • @GuruVamshi
    @GuruVamshi 2 หลายเดือนก่อน

    Excellent Bhai 😍

    • @learnwithchirag
      @learnwithchirag  หลายเดือนก่อน

      Glad it was helpful to you....If you really liked the content, do share with your friends too 😄 💯

  • @cricmizz2526
    @cricmizz2526 7 หลายเดือนก่อน

    thanks bhayia

    • @learnwithchirag
      @learnwithchirag  7 หลายเดือนก่อน

      Always welcome. Keep watching 🎉

  • @nimbu_03
    @nimbu_03 10 หลายเดือนก่อน +1

    Nice Explaination!

    • @learnwithchirag
      @learnwithchirag  10 หลายเดือนก่อน

      Thanks! Keep Watching 🎉

  • @vanshika7243
    @vanshika7243 6 หลายเดือนก่อน

    please explain how ON is working here!!!!!

    • @learnwithchirag
      @learnwithchirag  6 หลายเดือนก่อน +2

      The "ON" clause in this query specifies the conditions for joining records from the Activity table with itself (a1 and a2 instances) based on matching process_id and machine_id, and ensuring that the activities are ordered correctly in terms of time.
      If its still not clear , I will request you to dry run the query once. And no need to worry , you will get the clarity of concept when you will complete the playlist.
      Start from video 1 and go till video 50. You will be a champ in SQL.💯

    • @rahulshaw7457
      @rahulshaw7457 หลายเดือนก่อน

      😢​@@learnwithchirag

  • @DollyDhote-wi9cs
    @DollyDhote-wi9cs 7 หลายเดือนก่อน

    why we created a1 and a2

    • @learnwithchirag
      @learnwithchirag  7 หลายเดือนก่อน +1

      It's called self join. We created two instances of a single table in order to return the required result.
      Please do watch all the videos you will get this concept more clearly! Keep Learning 💯