SQL 2 simple solutions
Using having\n\n\nselect class\nfrom courses \nhaving count(distinct student) >= 5\n\n\nUsing sub query\n\n\nselect class\nfrom \n    (select class, count(disti
**Using having**\n\n```\nselect class\nfrom courses \nhaving count(distinct student) >= 5\n```\n\n**Using sub query**\n\n```\nselect class\nfrom \n    (select class, count(distinct student) as num\n    from courses\n    group by class) as temp\nwhere num >= 5;\n```\n\n**Like it ? please upvote !**
['MySQL']