In This Post we will see the Revising the Select Query 1 HackerRank Solution
The Question:
We have to query all columns from CITY table for all American Cities whose
population count is more than 100000.
Information Provided In the Question:
CountryCode="USA"
Population Count= 100000
Table Schema:
Solution for Revising the Select Query 1 HackerRank Question:
It is a basic SQL question that tests our knowledge of WHERE clause with AND operator.
Note: WHERE clause is used to filter records and AND Operator is used to filter records on the basis of more than 1 conditions.
Approach:
To select all columns we will use "*"
Use the WHERE clause with AND operator.
First filter will be on the Country Code, and Second filter will be on the
population.
SQL Statement:
SELECT * FROM CITY WHERE COUNTRYCODE='USA' AND POPULATION > 100000;
Result:
Conclusion:
In this post we have successfully solved the Revising the Select Query 1 Hackerrank Question. And we have seen the use of WHERE clause with AND operator.
Also See:
Please Let me Know, If you have any doubts.
Please Let me Know, If you have any doubts.