Classes More Than 5 Students


  • 0

    Click here to see the full article post


  • 0

    Looks like this piece of code

    SELECT
    Employee.name, Bonus.bonus
    FROM
    Employee
    LEFT JOIN
    Bonus ON Employee.empid = Bonus.empid
    WHERE
    bonus < 1000 OR bonus IS NULL
    ;

    should not be in this post.
    Right?


  • 0

    Right. It has been removed. And thanks for the feedback.


  • 0
    G

    SELECT
    class
    FROM
    courses
    GROUP BY class
    HAVING COUNT(student) >= 5
    ;

    what is the difference with or without distinct, I think any one even the same name can be counted, and it's not a major problem.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.