Skip to content

Instantly share code, notes, and snippets.

View IndigoW0lf's full-sized avatar
:octocat:
Learning

Kai Indigo Wolf IndigoW0lf

:octocat:
Learning
View GitHub Profile
SELECT
CASE
WHEN A + B <= C or A + C <= B or B + C <= A THEN 'Not A Triangle'
WHEN A = B and B = C THEN 'Equilateral'
WHEN A = B or A = C or B = C THEN 'Isosceles'
WHEN A != B and B != C THEN 'Scalene'
END tuple
FROM TRIANGLES;
Write a query identifying the type of each record in the TRIANGLES table using
@IndigoW0lf
IndigoW0lf / MySQL substr method
Created March 30, 2022 13:48
MySQL substr method
SELECT name FROM students
WHERE marks > 75
ORDER BY substr(name, -3, 3), id;