Friday, March 5, 2021

Weather Observation Station 12 | Basic Select | SQL | HackerRank | Solution



Problem : https://www.hackerrank.com/challenges/weather-observation-station-12/problem

Solution :

/*

Enter your query here.

*/


SELECT DISTINCT CITY FROM STATION WHERE LEFT(CITY,1) NOT IN ('a','e','i','o','u') AND RIGHT(CITY,1) NOT IN ('a','e','i','o','u');












Weather Observation Station 11 | Basic Select | SQL | HackerRank | Solution



Problem : https://www.hackerrank.com/challenges/weather-observation-station-11/problem

Solution : 


/*

Enter your query here.

*/


SELECT DISTINCT CITY FROM STATION WHERE LEFT(CITY,1) NOT IN ('a','e','i','o','u') OR RIGHT(CITY,1) NOT IN ('a','e','i','o','u');












Weather Observation Station 10 | Basic Select | SQL | HackerRank | Solution



Problem : https://www.hackerrank.com/challenges/weather-observation-station-10/problem

Solution :


/*

Enter your query here.

*/


SELECT DISTINCT CITY FROM STATION WHERE RIGHT(CITY,1) NOT IN ('a','e','o','u','i');











Weather Observation Station 9 | Basic Select | SQL | HackerRank | Solution



Problem : https://www.hackerrank.com/challenges/weather-observation-station-9/problem

Solution :


/*

Enter your query here.

*/


SELECT DISTINCT CITY FROM STATION WHERE LEFT(CITY,1) NOT IN ('a','e','i','o','u');











Weather Observation Station 8 | Basic Select | SQL | HackerRank | Solution



Problem : https://www.hackerrank.com/challenges/weather-observation-station-8/problem

Solution : 

/*

Enter your query here.

*/


SELECT DISTINCT CITY FROM STATION WHERE LEFT(CITY,1) IN ('a','e','i','o','u') AND RIGHT(CITY,1) IN ('a','e','i','o','u'); 

Weather Observation Station 7 | Basic Select | SQL | Practice | HackerRank | Solution

 


Problem : https://www.hackerrank.com/challenges/weather-observation-station-7/problem

Solution : 

/*

Enter your query here.

*/


SELECT DISTINCT CITY FROM STATION WHERE RIGHT(CITY,1) IN ('a','e','i','u','o');


Weather Observation Station 6 | Basic Select | SQL | HackerRank Solution

 


Problem : https://www.hackerrank.com/challenges/weather-observation-station-6/problem

Solution :


/*

Enter your query here.

*/


SELECT CITY FROM STATION WHERE LEFT(CITY,1) IN ('a','e','i','o','u');











Weather Observation Station 5 | SQL | Basic Select | HackerRank | Solution

 


Problem : https://www.hackerrank.com/challenges/weather-observation-station-5/problem

Solution :


/*

Enter your query here.

*/


(

SELECT CITY , LENGTH(CITY) FROM STATION ORDER BY LENGTH(CITY), CITY LIMIT 1

UNION

(

SELECT CITY , LENGTH(CITY) FROM STATION ORDER BY LENGTH(CITY) DESC, CITY LIMIT 1

);














Weather Observation Station 4 | Basic Select | SQL | Easy | HackerRank | Solution

 


Problem : https://www.hackerrank.com/challenges/weather-observation-station-4/problem

Solution : 


/*

Enter your query here.

*/


SELECT COUNT(CITY) - COUNT(DISTINCT(CITY)) FROM STATION;











Weather Observation Station 3 | Basic Select | SQL | HackerRank Solution

 


Problem : https://www.hackerrank.com/challenges/weather-observation-station-3/problem

Solution : 


/*

Enter your query here.

*/


SELECT DISTINCT(CITY) FROM STATION WHERE ID%2=0; 










Weather Observation Station 1 | Basic Select | SQL | HackerRank | Solution


Problem : https://www.hackerrank.com/challenges/weather-observation-station-1/problem

Solution : 

/*

Enter your query here.

*/


SELECT CITY , STATE FROM STATION;

























Japanese Cities' Attributes | Basic Select | SQL | Hackerrank | Solution


Problem : https://www.hackerrank.com/challenges/japanese-cities-attributes/problem

Solution : 


SELECT * FROM CITY WHERE COUNTRYCODE="JPN";











Thursday, March 4, 2021

Select All | Hackerrank | Basic Select | SQL | Basic Select | Solution

 


Problem : https://www.hackerrank.com/challenges/select-all-sql/problem

Solution : 


SELECT * FROM CITY;











Japanese Cities' Names | Hackerrank | Basic Select | SQL | Solution

 



Problem : https://www.hackerrank.com/challenges/japanese-cities-name/problem

Solution : 

SELECT NAME FROM CITY WHERE COUNTRYCODE = "JPN";









Select By ID | Basic Select | Hackerrank | Solution | SQL

 



Problem : https://www.hackerrank.com/challenges/select-by-id/problem

Solution : 

SELECT * FROM CITY WHERE ID = 1661;












Revising the Select Query II | Hackerrank | SQL | Basic Select | Solution

 



Problem : https://www.hackerrank.com/challenges/revising-the-select-query-2/problem

Solution : 

SELECT NAME FROM CITY WHERE POPULATION > 120000 AND COUNTRYCODE = "USA";






Revising the Select Query I | HackerRank | Basic Select | SQL | Complete Playlist




 PROBLEM : https://www.hackerrank.com/challenges/revising-the-select-query/problem

SOLUTION : 

SELECT * FROM CITY WHERE POPULATION > 100000 AND COUNTRYCODE = "USA";