본문 바로가기

SQL101

Hacker rank The Blunder 1 2 select ceil( avg(salary)-avg(replace(salary,0,'')) ) from employees Colored by Color Scripter cs 문제 요약을 해보면 salary가 1420 2006 2210 3000 에서 0이 고장나서 142 26 221 3 으로 인식해서 잘못 계산했다네요 replace함수 쓰면 되고 오버로딩 돼있어서 string만 되는게 아니라 숫자도되네요 2021. 10. 21.
Hacker rank Population Density Difference 1 2 select max(population)-min(population) from city cs 2021. 10. 21.
Hacker rank Japan Population 1 2 3 select sum(population) from city where countrycode='jpn' cs 2021. 10. 21.
Hacker rank Average Population 1 2 select round(avg(population)) from city cs 2021. 10. 21.
Hacker rank -Revising Aggregations - Averages 1 2 3 select avg(population) from city where district ='California' cs 2021. 10. 21.
Hackerrank Revising Aggregations - The Sum Function 1 2 3 select sum(population) from city where district='California' cs 2021. 10. 21.
Hacker rank Revising Aggregations - The Count Function 1 2 3 select count(name) from city where population>100000 cs 2021. 10. 21.
Hacker rank African Cities 1 2 3 4 select city.name from city join country on city.countrycode=country.code where country.continent='Africa' cs 2021. 10. 21.
Hacker rank Population Census 1 2 3 4 5 select sum(city.population) from city join country on city.countrycode=country.code where country.continent='Asia' cs 2021. 10. 21.
Hacker rank Employee Salaries 1 2 3 4 select name from employee where salary >2000 and months 2021. 10. 21.
Hacker rank Employee Names 1 2 3 select name from employee order by name cs 2021. 10. 21.
Hacker rank Higher Than 75 Marks 1 2 3 4 select name from students where marks>75 order by right(name,3) , id cs 2021. 10. 21.