데이터베이스/SQL(42)
-
[HackerRank] The PADS
SELECT CONCAT(Name, '(', LEFT(Occupation, 1), ')') FROM OCCUPATIONS ORDER BY Name ASC; SELECT CONCAT('There are a total of ', COUNT(Occupation), ' ', LOWER(Occupation), 's.') FROM OCCUPATIONS GROUP BY Occupation ORDER BY Count(Occupation), Occupation ASC;
2021.02.08 -
[HackerRank] Weather Observation Station 13
SELECT ROUND(SUM(LAT_N),4) FROM STATION WHERE LAT_N BETWEEN 38.7880 AND 137.2345;
2021.02.08 -
[HackerRank] Weather Observation Station 2
SELECT ROUND(SUM(LAT_N), 2)AS lat, ROUND(SUM(LONG_W), 2) FROM STATION;
2021.02.08 -
[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