SQL(35)
-
[HackerRank] Revising Aggregations - The Sum Function
Query the total population of all cities in CITY where District is California. Input Format The CITY table is described as follows: SELECT SUM(POPULATION) FROM CITY WHERE DISTRICT = 'California';
2021.01.25 -
[HackerRank] Revising Aggregations - The Count Function
Query a count of the number of cities in CITY having a Population larger than 100,000. Input Format The CITY table is described as follows: SELECT COUNT(*) FROM CITY WHERE POPULATION > 100000;
2021.01.25 -
[HackerRank] Employee Salaries
Write a query that prints a list of employee names (i.e.: the name attribute) for employees in Employee having a salary greater than $2000 per month who have been employees for less than 10 months. Sort your result by ascending employee_id. Input Format The Employee table containing employee data for a company is described as follows: where employee_id is an employee's ID number, name is their n..
2021.01.25 -
[HackerRank] Higher Than 75 Marks
Query the Name of any student in STUDENTS who scored higher than 75 Marks. Order your output by the last three characters of each name. If two or more students both have names ending in the same last three characters (i.e.: Bobby, Robby, etc.), secondary sort them by ascending ID. Input Format The STUDENTS table is described as follows: The Name column only contains uppercase (A-Z) and lowercase..
2021.01.24 -
[HackerRank] Weather Observation Station 12
Query the list of CITY names from STATION that do not start with vowels and do not end with vowels. Your result cannot contain duplicates. Input Format The STATION table is described as follows: where LAT_N is the northern latitude and LONG_W is the western longitude. SELECT DISTINCT CITY FROM STATION WHERE CITY REGEXP '^[^aieou].*[^aieou]$';
2021.01.24 -
[HackerRank] Weather Observation Station 11
Query the list of CITY names from STATION that either do not start with vowels or do not end with vowels. Your result cannot contain duplicates. Input Format The STATION table is described as follows: where LAT_N is the northern latitude and LONG_W is the western longitude. SELECT DISTINCT CITY FROM STATION WHERE CITY REGEXP '^[^aieou]|[^aieou]$';
2021.01.24