View on GitHub

hackerrank

HackerRank personal solutions

SQL

A special-purpose language designed for managing data held in a relational database.

Basic Select

Name Preview Code Difficulty
Revising the Select Query I Query the data for all American cities with populations larger than 100,000. SQL Easy
Revising the Select Query II Query the city names for all American cities with populations larger than 120,000. SQL Easy
Select All Query all columns for every row in a table. SQL Easy
Select By ID Query the details of the city with ID 1661. SQL Easy
Japanese Cities’ Attributes Query the attributes of all the cities in Japan. SQL Easy
Japanese Cities’ Names In this challenge, you will query a list of all the Japanese cities’ names. SQL Easy
Weather Observation Station 1 Write a query to print the CITY and STATE for each attribute in the STATION table. SQL Easy
Weather Observation Station 3 Query a list of unique CITY names with even ID numbers. SQL Easy
Weather Observation Station 4 Find the number of duplicate CITY names in STATION. SQL Easy
Weather Observation Station 5 Write a query to print the shortest and longest length city name along with the length of the city names. SQL Easy
Weather Observation Station 6 Query a list of CITY names beginning with vowels (a, e, i, o, u). SQL Easy
Weather Observation Station 7 Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. SQL Easy
Weather Observation Station 8 Query CITY names that start AND end with vowels. SQL Easy
Weather Observation Station 9 Query an alphabetically ordered list of CITY names not starting with vowels. SQL Easy
Weather Observation Station 10 Query a list of CITY names not ending in vowels. SQL Easy
Weather Observation Station 11 Query a list of CITY names not starting or ending with vowels. SQL Easy
Weather Observation Station 12 Query an alphabetically ordered list of CITY names not starting and ending with vowels. SQL Easy
Higher Than 75 Marks Query the names of students scoring higher than 75 Marks. Sort the output by the LAST three characters of each name. SQL Easy
Employee Names Print employee names. SQL Easy
Employee Salaries Print the names of employees who earn more than $2000 per month and have worked at the company for less than 10 months. SQL Easy

Advanced Select

Name Preview Code Difficulty
Type of Triangle Query a triangle’s type based on its side lengths. SQL Easy
The PADS Query the name and abbreviated occupation for each person in OCCUPATIONS. SQL Medium
Occupations Pivot the Occupation column so the Name of each person in OCCUPATIONS is displayed underneath their respective Occupation. SQL Medium