Triangle Judgement
EasyLeetCodeSQL: CASE, String & Date Functions
Hint and exampleShowHide
Produce a label for each row with a CASE expression whose condition checks all the required comparisons at once.
Example: marks(student, theory, practical) — pass only if both are at least 40
student | theory | practical
Asha | 55 | 48
Ravi | 62 | 30
SELECT student,
CASE WHEN theory >= 40 AND practical >= 40
THEN 'Pass' ELSE 'Fail' END AS result
FROM marks; -- Asha | Pass, Ravi | Fail
More in SQL: CASE, String & Date Functions
| # | Problem | Platform | Difficulty | Open | 1st1st Visit | 2nd2nd Visit | RevRevise |
|---|---|---|---|---|---|---|---|
| 1 | Triangle Judgement | LeetCode | Easy | Solve Triangle Judgement on LeetCode (opens in a new tab) | |||
| 2 | Fix Names in a Table | LeetCode | Easy | Solve Fix Names in a Table on LeetCode (opens in a new tab) | |||
| 3 | Rising Temperature | LeetCode | Easy | Solve Rising Temperature on LeetCode (opens in a new tab) | |||
| 4 | Group Sold Products By The Date | LeetCode | Easy | Solve Group Sold Products By The Date on LeetCode (opens in a new tab) | |||
| 5 | Monthly Transactions I | LeetCode | Medium | Solve Monthly Transactions I on LeetCode (opens in a new tab) | |||
| 6 | Confirmation Rate | LeetCode | Medium | Solve Confirmation Rate on LeetCode (opens in a new tab) |