Skip to content

2072. The Winner University 👍

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
WITH
  NY AS (
    SELECT COUNT(student_id) AS `count`
    FROM NewYork
    WHERE score >= 90
  ),
  CA AS (
    SELECT COUNT(student_id) AS `count`
    FROM California
    WHERE score >= 90
  )
SELECT
  CASE
    WHEN NY.`count` > CA.`count` THEN 'New York University'
    WHEN NY.`count` < CA.`count` THEN 'California University'
    ELSE 'No Winner'
  END AS Winner
FROM NY, CA;