본문 바로가기

열정가득한 개발자의 이야기/hacker Rank SQL 문제

Hacker Rank (Mysql) Basic

 

this is really simple question. 

I solved the two query question which can study aggregation method SUM and COUNT.

 

first of question : To learn COUNT.

 

summarize the statement :  just count cities where have a population lager than 100,000.

 

 

checking point : before writting the SQL, need to think how can I solve this problem.

so, to count the cities, I need to use COUNT method and for checking the population, I need to use WHERE statement.

 

so this is my answer.

 

 

second of all : study SUM method.

 

summarize the statement : this question is same with before question.

but different point is that I need to use SUM method for getting total population about all citities especally California.

 

checking point :  for solving this problem, I need to use SUM method.

so my answer is that 

 

 

 

those are really simple questions.

just conside how to aggregate the column, and how to make the output on condition. 

 

I will solve all of the questions in Hacker Rank cite step by step and I will explain it by Korean or English.

I will improve my skill every day.

 

jia you~!