LeetCode 1633: Percentage of Users Attended a Contest [SQL]

Поделиться
HTML-код
  • Опубликовано: 3 дек 2024

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

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

    I like the way he thinks
    1. get the feilds you want to print out
    2.see what are they showing without any filter
    3.then filter the things and check the output again
    4/now use the output to get the result
    although looks likes an obvious approach at first but if didn't applied and if directly faced the problem head on then it starts looking tough/complex but by his method it is easier to breakdown the problem , so more than sql he's teaching to breakdown the problem in chunks

  • @YASHKUMARJAIN
    @YASHKUMARJAIN 3 года назад

    Thanks ,
    Before this tutorial i had no clue we can use subquery in "Select" statement like that also.
    Can you suggest any article which tell us more about this type of subquery usage in select Statement

  • @Aravindkumar-b8p
    @Aravindkumar-b8p 6 месяцев назад

    just 2 line !!! great
    select contest_id,round(count(user_id) * 100.0/(select count(user_id) from users),2) as percentage
    from register
    group by contest_id
    order by percentage desc,contest_id
    when i try this, Time Limit Exceeded

  • @BonnyLee-c2m
    @BonnyLee-c2m 4 месяца назад

    Why should we use subquery instead of 3😮