목록분류 전체보기 (31)
Studying data

A median is defined as a number separating the higher half of a data set from the lower half. Query the median of the Northern Latitudes (LAT_N) from STATION and round your answer to decimal places. Input Format The STATION table is described as follows: where LAT_N is the northern latitude and LONG_W is the western longitude. [MySQL Solution 1] SELECT ROUND(AVG(S.LAT_N), 4) FROM STATION S WHERE..

Query the Western Longitude (LONG_W) for the largest Northern Latitude (LAT_N) in STATION that is less than . Round your answer to decimal places. Input Format The STATION table is described as follows: where LAT_N is the northern latitude and LONG_W is the western longitude. [MySQL Solution 1] select round(long_w, 4) from station where lat_n = (select max(lat_n) from station where lat_n < 137.2..

We define an employee's total earnings to be their monthly worked, and the maximum total earnings to be the maximum total earnings for any employee in the Employee table. Write a query to find the maximum total earnings for all employees as well as the total number of employees who have maximum total earnings. Then print these values as 2 space-separated integers. Input Format The Employee table..

Amber's conglomerate corporation just acquired some new companies. Each of the companies follows this hierarchy: Given the table schemas below, write a query to print the company_code, founder name, total number of lead managers, total number of senior managers, total number of managers, and total number of employees. Order your output by ascending company_code. Note: The tables may contain dupl..

You are given a table, BST, containing two columns: N and P, where N represents the value of a node in Binary Tree, and P is the parent of N. Write a query to find the node type of Binary Tree ordered by the value of the node. Output one of the following for each node: Root: If node is root node. Leaf: If node is leaf node. Inner: If node is neither root nor leaf node. Sample Input Sample Output..

Pivot the Occupation column in OCCUPATIONS so that each Name is sorted alphabetically and displayed underneath its corresponding Occupation. The output column headers should be Doctor, Professor, Singer, and Actor, respectively. Note: Print NULL when there are no more names corresponding to an occupation. Input Format The OCCUPATIONS table is described as follows: Occupation will only contain on..

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. [MySQL Solution] SELECT DISTINCT CITY FROM STATION WHERE CITY REGEXP '^[^aeiou]|[^aeiou]$'; -- REGEXP 대신 RLIKE도 가능 문제 링크: h..

Weather Observation Station 6 Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION. 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. [MySQL Solution] SELECT DISTINCT CITY FROM STATION WHERE CITY RLIKE '^[aeiouAEIOU]' 문제 링크: https://www.hackerr..