Sort 174 Discussions, By:
Please Login in order to post a comment
Here is Oracle solution from my HackerrankPractice repository:
COUNTRYCODE = 'USA'
AND POPULATION > 100000;
Feel free to ask if you have any questions :)
select * from city where population >10000 AND countrycode='USA';
see above query i have tried lots of time but i am not able to solve so plz help me
You have a typo: population >10000 instead of population >100000
i had the same problem.....
change the order of conditions.. your code will be run successfully..
I had the same issue, but surprisingly after I changed select into SELECT, from into FROM, etc. the query passed.
what the problem in this
Let me know if you have any questions!
WHERE POPULATION > 100000
AND COUNTRYCODE = 'USA';
(From my HackerRank repo on GitHub.)
SELECT * FROM CITY WHERE POPULATION > 100000 AND COUNTRYCODE = 'USA';
MS SQL Server:
why USA not in double quotes as it is a string? that is , "USA"?
This is the case in oracle. why?
For Oracle, strings within double quotes are regarded as column names, not string literals.
Both quotes are same, we can use any one of them.
The editor is starting from line 7. There is some code on line 4 which is causing the error. Not sure what that code is as it is not visible.
I ended the invisible statement with a ; and though the result is giving an error , it is also executing my query.
select * from CITY
where POPULATION > 100000
ORACLE SIMPLE SOLUTION
where population > 100000 and countrycode = 'USA';
SELECT * FROM CITY
WHERE COUNTRYCODE='USA' AND POPULATION>100000
SELECT * FROM City WHERE POPULATION>100000 AND COUNTRYCODE = 'USA';
Why this is NOT working?
select * from city where name='american' any(select name from city where name='american') and population>100000 order by name;
Need to add ; at the end....