This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
ELSE 'Scalene' | |
END | |
FROM TRIANGLES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT name FROM Employee | |
WHERE salary > 2000 AND months < 10 | |
ORDER BY employee_id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT name FROM Employee ORDER BY name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT Name FROM STUDENTS WHERE Marks > 75 | |
ORDER BY RIGHT(Name, 3), ID; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DISTINCT CITY FROM STATION | |
WHERE NOT REGEXP_LIKE(CITY, "^[aeiou]") | |
AND NOT REGEXP_LIKE(CITY, "[aeiou]$"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DISTINCT CITY FROM STATION | |
WHERE NOT REGEXP_LIKE(CITY, "^[aeiou]") | |
OR NOT REGEXP_LIKE(CITY, "[aeiou]$"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DISTINCT CITY FROM STATION | |
WHERE NOT REGEXP_LIKE(CITY, "[aeiou]$"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DISTINCT CITY FROM STATION | |
WHERE NOT REGEXP_LIKE(CITY, "^[aeiou]"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DISTINCT CITY FROM STATION | |
WHERE REGEXP_LIKE(CITY, "^[aeiou]") | |
AND REGEXP_LIKE(CITY, "[aeiou]$"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DISTINCT CITY FROM STATION | |
WHERE REGEXP_LIKE(CITY, "[aeiou]$"); |