Revising Aggregations - The Count Function-MySQL HackerRank Solution

1

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:




Solution

 

 
  
SELECT COUNT(NAME)

  FROM CITY 

  WHERE POPULATION>100000


 

SELECT is the SQL keyword that lets the database know that you want to retrieve data.


COUNT() function is used to returns the count of an expression. It allows us to count all rows or only some rows of the table that matches a specified condition. It is a type of aggregate function whose return type is BIGINT. This function returns 0 if it does not find any matching rows.

Post a Comment

1 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.
  1. Top 3 casinos in Washington state - MapyRO
    Where is the closest casino to Washington? 천안 출장샵 You can find information about all 광양 출장샵 3 nearest casinos in Washington state, including the casinos What 서산 출장안마 are the nearest casinos to Washington?Where can I play near 울산광역 출장샵 DC? 아산 출장마사지

    ReplyDelete
Post a Comment
Our website uses cookies to enhance your experience. Learn More
Accept !