SQL Problem Solving: Finding Longest Gym Streak | Step-by-Step Tutorial

Поділитися
Вставка
  • Опубліковано 14 жов 2024
  • Dive into the world of SQL problem-solving with our latest tutorial! In this session, we tackle the challenge of deciphering gym attendance logs, extracting entries for when users attended or skipped the gym. Join us on a step-by-step journey as we unravel the secret to finding the longest streak-identifying the maximum consecutive days a user attended the gym.
    📋 Problem Description:
    Explore the "gym_logs" table, showcasing user entries on gym attendance for specific dates. By leveraging SQL prowess, we navigate through the entries to pinpoint the longest streak, providing insights into a user's dedicated fitness journey.
    Table creation & insertion script:
    CREATE TABLE gym_logs(
    entry_date DATE,
    status CHAR(1)
    );
    INSERT INTO gym_logs VALUES('2023-01-01','N'),('2023-01-02','Y'),('2023-01-03','Y'),
    ('2023-01-04','N'),('2023-01-05','N'),('2023-01-06','Y'),('2023-01-07','Y'),
    ('2023-01-08','Y'),('2023-01-09','N');
    👉 Like, share, and subscribe for more SQL tutorials and problem-solving sessions! Explore additional challenges in our SQL playlist and become a SQL pro.
    #sql #interview #problemsolving #sqlprogramming #sqlqueries

КОМЕНТАРІ • 3

  • @vijaypalmanit
    @vijaypalmanit 11 місяців тому

    Super, saw many videos but yours is amazing

    • @rahul_upadhya
      @rahul_upadhya  10 місяців тому

      Thank you Vijay for the kind words 😊

  • @soumyaranjanrout2843
    @soumyaranjanrout2843 10 місяців тому

    Hello Sir, I got the logic behind grouping the consecutive days. But I am trying to do it in another approach but after so many tries I didn't able to find any such logic apart from yours in whicu we can group the consecutive days. If possible could you please tell me other approach apart from the one which you discussed in the video?