Skip to content

Commit 5dc86a8

Browse files
committed
Add Basic Sql solutions
1 parent b7b290a commit 5dc86a8

File tree

13 files changed

+31
-1
lines changed

13 files changed

+31
-1
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div align="center">
22
<img src="https://github.com/alexprut/HackerRank/raw/master/hackerrank-logo.png" width="450" height="auto"/>
33

4-
[![Solutions](https://img.shields.io/badge/solutions-434-green.svg?style=flat-square)](https://github.com/alexprut/HackerRank#table-of-contents)
4+
[![Solutions](https://img.shields.io/badge/solutions-446-green.svg?style=flat-square)](https://github.com/alexprut/HackerRank#table-of-contents)
55
[![Languages](https://img.shields.io/badge/languages-c%2B%2B%2Cjava%2Chaskell-yellow.svg)](https://github.com/alexprut/HackerRank#table-of-contents)
66
[![Author](https://img.shields.io/badge/author-alexprut-brightgreen.svg?style=flat-square)](https://www.hackerrank.com/alexprut)
77
[![MIT](https://img.shields.io/dub/l/vibe-d.svg?style=flat-square)](https://github.com/alexprut/HackerRank/blob/master/LICENSE)
@@ -532,15 +532,27 @@ platform tests of a given problem.
532532
|Basic Select|[Weather Observation Station 7](https://www.hackerrank.com/challenges/weather-observation-station-7)|Easy|10|[Solution.txt](Sql/Basic%20Select/Weather%20Observation%20Station%207/Solution.txt)|
533533
|Basic Select|[Weather Observation Station 8](https://www.hackerrank.com/challenges/weather-observation-station-8)|Easy|15|[Solution.txt](Sql/Basic%20Select/Weather%20Observation%20Station%208/Solution.txt)|
534534
|Basic Select|[Weather Observation Station 9](https://www.hackerrank.com/challenges/weather-observation-station-9)|Easy|10|[Solution.txt](Sql/Basic%20Select/Weather%20Observation%20Station%209/Solution.txt)|
535+
|Basic Select|[Weather Observation Station 10](https://www.hackerrank.com/challenges/weather-observation-station-10)|Easy|10|[Solution.txt](Sql/Basic%20Select/Weather%20Observation%20Station%2010/Solution.txt)|
535536
|Basic Select|[Weather Observation Station 11](https://www.hackerrank.com/challenges/weather-observation-station-11)|Easy|15|[Solution.txt](Sql/Basic%20Select/Weather%20Observation%20Station%2011/Solution.txt)|
536537
|Basic Select|[Weather Observation Station 12](https://www.hackerrank.com/challenges/weather-observation-station-12)|Easy|15|[Solution.txt](Sql/Basic%20Select/Weather%20Observation%20Station%2012/Solution.txt)|
537538
|Basic Select|[Higher Than 75 Marks](https://www.hackerrank.com/challenges/more-than-75-marks)|Easy|15|[Solution.txt](Sql/Basic%20Select/Higher%20Than%2075%20Marks/Solution.txt)|
538539
|Basic Select|[Employee Names](https://www.hackerrank.com/challenges/name-of-employees)|Easy|10|[Solution.txt](Sql/Basic%20Select/Employee%20Names/Solution.txt)|
539540
|Basic Select|[Employee Salaries](https://www.hackerrank.com/challenges/salary-of-employees)|Easy|10|[Solution.txt](Sql/Basic%20Select/Employee%20Salaries/Solution.txt)|
541+
|Aggregation|[Revising Aggregations - The Count Function](https://www.hackerrank.com/challenges/revising-aggregations-the-count-function)|Easy|10|[Solution.txt](Sql/Aggregation/Revising%20Aggregations%20-%20The%20Count%20Function/Solution.txt)|
540542
|Aggregation|[Revising Aggregations - The Sum Function](https://www.hackerrank.com/challenges/revising-aggregations-sum)|Easy|10|[Solution.txt](Sql/Aggregation/Revising%20Aggregations%20-%20The%20Sum%20Function/Solution.txt)|
541543
|Aggregation|[Revising Aggregations - Averages](https://www.hackerrank.com/challenges/revising-aggregations-the-average-function)|Easy|10|[Solution.txt](Sql/Aggregation/Revising%20Aggregations%20-%20Averages/Solution.txt)|
542544
|Aggregation|[Average Population](https://www.hackerrank.com/challenges/average-population)|Easy|10|[Solution.txt](Sql/Aggregation/Average%20Population/Solution.txt)|
543545
|Aggregation|[Japan Population](https://www.hackerrank.com/challenges/japan-population)|Easy|10|[Solution.txt](Sql/Aggregation/Japan%20Population/Solution.txt)|
546+
|Aggregation|[The Blunder](https://www.hackerrank.com/challenges/the-blunder)|Easy|15|[Solution.txt](Sql/Aggregation/The%20Blunder/Solution.txt)|
547+
|Aggregation|[Top Earners](https://www.hackerrank.com/challenges/earnings-of-employees)|Easy|20|[Solution.txt](Sql/Aggregation/Top%20Earners/Solution.txt)|
548+
|Aggregation|[Weather Observation Station 2](https://www.hackerrank.com/challenges/weather-observation-station-2)|Easy|15|[Solution.txt](Sql/Aggregation/Weather%20Observation%20Station%202/Solution.txt)|
549+
|Aggregation|[Weather Observation Station 13](https://www.hackerrank.com/challenges/weather-observation-station-13)|Easy|10|[Solution.txt](Sql/Aggregation/Weather%20Observation%20Station%2013/Solution.txt)|
550+
|Aggregation|[Weather Observation Station 15](https://www.hackerrank.com/challenges/weather-observation-station-15)|Easy|15|[Solution.txt](Sql/Aggregation/Weather%20Observation%20Station%2015/Solution.txt)|
551+
|Aggregation|[Weather Observation Station 16](https://www.hackerrank.com/challenges/weather-observation-station-16)|Easy|10|[Solution.txt](Sql/Aggregation/Weather%20Observation%20Station%2016/Solution.txt)|
552+
|Aggregation|[Weather Observation Station 17](https://www.hackerrank.com/challenges/weather-observation-station-17)|Easy|15|[Solution.txt](Sql/Aggregation/Weather%20Observation%20Station%2017/Solution.txt)|
553+
|Basic Join|[Asian Population](https://www.hackerrank.com/challenges/asian-population)|Easy|10|[Solution.java](Sql/Basic%20Join/Asian%20Population/Solution.java)|
554+
|Basic Join|[African Cities](https://www.hackerrank.com/challenges/african-cities)|Easy|10|[Solution.java](Sql/Basic%20Join/African%20Cities/Solution.java)|
555+
|Basic Join|[Average Population of Each Continent](https://www.hackerrank.com/challenges/average-population-of-each-continent)|Easy|10|[Solution.java](Sql/Basic%20Join/Average%20Population%20of%20Each%20Continent/Solution.java)|
544556

545557
License
546558
=======
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
select count(*) from city where population > 100000
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SELECT CEIL(AVG(Salary) - AVG(REPLACE(SALARY, '0', ''))) FROM EMPLOYEES
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
select salary*months, count(*) from employee
2+
group by 1
3+
order by 1 desc limit 1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SELECT ROUND(SUM(LAT_N), 4) FROM STATION WHERE LAT_N > 38.788 AND LAT_N < 137.2345
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SELECT ROUND(LONG_W, 4) FROM STATION WHERE LAT_N < 137.2345 ORDER BY LAT_N DESC LIMIT 1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SELECT ROUND(MIN(LAT_N), 4) FROM STATION WHERE LAT_N > 38.778
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SELECT ROUND(LONG_W, 4) FROM STATION WHERE LAT_N > 38.778 ORDER BY LAT_N ASC LIMIT 1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SELECT ROUND(SUM(LAT_N), 2), ROUND(SUM(LONG_W),2) FROM STATION
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
select ci.name from city ci
2+
JOIN country ca on ci.countrycode = ca.code
3+
where ca.continent = "africa"

0 commit comments

Comments
 (0)