본문 바로가기

SQL101

leetcode 181. Employees Earning More Than Their Managers 1 2 3 4 5 /* Write your PL/SQL query statement below */ select e1.name as employee from employee e1, employee e2 where e1.managerId=e2.id and e1.salary>e2.salary cs 2022. 3. 17.
leetcode 175. Combine Two TablesEasy 1 2 3 4 5 6 7 /* Write your PL/SQL query statement below */ select p.firstname,p.lastname,a.city,a.state from person p, address a where p.personid=a.personid(+) cs 2022. 3. 17.
leetcode 595. Big Countries 1 2 3 4 5 /* Write your PL/SQL query statement below */ select name, population, area from world where area>=3000000 or population>=25000000 cs 2022. 3. 17.
Hacker rank Type of Triangle 1 2 3 4 5 6 7 SELECT CASE WHEN A = B AND B = C THEN 'Equilateral' WHEN A >=B+C OR B>=A+C OR C>=A+B THEN 'Not A Triangle' WHEN A = B OR A = C OR B = C THEN 'Isosceles' ELSE 'Scalene' END FROM TRIANGLES Colored by Color Scripter cs 2021. 10. 23.
Hacker rank Average Population of Each Continen 1 2 3 4 select country.continent, truncate (avg(city.population),0) from city join country on city.countrycode=country.code group by country.continent Colored by Color Scripter cs 2021. 10. 23.
Hacker rank Weather Observation Station 17 1 2 3 4 select round(long_w,4) from station where lat_n>38.7780 order by lat_N limit 1 cs 2021. 10. 21.
Hacker rank Weather Observation Station 16 1 2 3 select round(min(lat_n),4) from station where lat_n>38.7780 cs 2021. 10. 21.
Hacker rank Weather Observation Station 15 1 2 3 4 select round (long_w,4) from station where lat_n 2021. 10. 21.
Hacker rank Weather Observation Station 14 1 2 3 select truncate (max(lat_n), 4 ) from station where lat_n 2021. 10. 21.
Hacker rank Weather Observation Station 13 1 2 3 select truncate (sum(lat_n) ,4) from station where lat_n>38.7880 and lat_n 2021. 10. 21.
Hacker rank Weather Observation Station 2 1 2 select round(sum(lat_n), 2) as lat , round(sum(long_w) ,2) as lon from station Colored by Color Scripter cs round 함수 쓰면되고 round(반올림할 대상, 반올림할 자리) 반올림할 자리는 . 소숫점을 기준으로 오른쪽은 + 왼쪽은 - 라고 입력하시면 됩니다 ^^7 2021. 10. 21.
Hacker rank Top Earners 1 2 3 4 select salary*months as earnings , count(employee_id) from employee group by earnings desc limit 1 Colored by Color Scripter cs 2021. 10. 21.