SQL Solutions
SQL Solutions
FROM STATION
FROM STATION
FROM STATION
WHERE (CITY LIKE 'A%' OR CITY LIKE 'E%' OR CITY LIKE 'I%' OR CITY LIKE 'O%' OR CITY LIKE 'U%')
AND (CITY LIKE '%a' OR CITY LIKE '%e' OR CITY LIKE '%i' OR CITY LIKE '%o' OR CITY LIKE '%u');
FROM STATION
FROM STATION
FROM STATION
WHERE CITY NOT LIKE 'A%' AND
FROM STATION
SELECT Name
FROM STUDENTS
SELECT name
FROM Employee
ORDER BY name;
SELECT name
FROM Employee
ORDER BY employee_id;
SELECT
CASE
ELSE 'Scalene'
END AS TriangleType
FROM TRIANGLES;
ORDER BY NAME;
SELECT 'There are a total of ' || COUNT(Occupation) || ' ' || LOWER(Occupation) || 's.'
FROM OCCUPATIONS
GROUP BY Occupation
Explanation:
First Query: Outputs the name followed by the first letter of the occupation in parentheses.
Second Query: Counts the number of each occupation, converts the occupation to lowercase, and
formats the output string as required (There are a total of [count] [occupation]s.).
Both queries should work correctly now without any function-related errors.
WITH Parents AS (
),
Children AS (
SELECT
N,
CASE
ELSE 'Inner'
END AS node_type
FROM BST
ORDER BY N;
Explanation :
Parents: This CTE extracts all distinct parent values from the P column. It identifies which nodes are
parents.
Children: This CTE extracts all distinct node values from the N column.
Main Query:
Output Order:
SELECT FLOOR(AVG(Population))
FROM CITY;