반응형
SELECT 
    x,
    y,
    z,
    CASE
        WHEN x + y > z AND x + z > y AND y + z > x THEN 'Yes'
        ELSE 'No'
    END AS 'triangle'
FROM
    triangle
;
반응형

'sql문제' 카테고리의 다른 글

574. Winning Candidate  (0) 2022.09.05
570. Managers with at Least 5 Direct Reports  (0) 2022.09.04
550. Game Play Analysis IV  (0) 2022.09.03
반응형
SELECT bb.name as name FROM (SELECT count(id) as vv, candidateId FROM Vote Group BY candidateId Order By vv desc limit 1) aa  JOIN Candidate bb on aa.candidateId = bb.id
반응형

'sql문제' 카테고리의 다른 글

610. Triangle Judgement  (0) 2022.09.05
570. Managers with at Least 5 Direct Reports  (0) 2022.09.04
550. Game Play Analysis IV  (0) 2022.09.03
반응형
SELECT cc.name as name FROM (SELECT count(id) as cnt, managerId FROM Employee GROUP BY managerId having cnt>=5) bb JOIN Employee cc ON cc.id = bb.managerId
반응형

'sql문제' 카테고리의 다른 글

610. Triangle Judgement  (0) 2022.09.05
574. Winning Candidate  (0) 2022.09.05
550. Game Play Analysis IV  (0) 2022.09.03
반응형

```

SELECT ROUND(COUNT(t2.player_id)/COUNT(t1.player_id),2) AS fraction
FROM
(SELECT player_id, MIN(event_date) AS first_login FROM Activity GROUP BY player_id) t1 LEFT JOIN Activity t2
ON t1.player_id = t2.player_id AND t1.first_login = t2.event_date - 1

```

반응형

'sql문제' 카테고리의 다른 글

610. Triangle Judgement  (0) 2022.09.05
574. Winning Candidate  (0) 2022.09.05
570. Managers with at Least 5 Direct Reports  (0) 2022.09.04

+ Recent posts