Skip to content

Commit

Permalink
Problem set 1 solutions added by Maksim Eremeev (#52)
Browse files Browse the repository at this point in the history
* Problem set 1 solutions added

* Problem set 1 solutions added

* minor
  • Loading branch information
maks5507 authored and CrafterKolyan committed Oct 2, 2019
1 parent 303e8a9 commit 569f67e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions task1/Eremeev_1_1.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SELECT
customer_rk,
CASE
WHEN middle_nm LIKE '' THEN 'F'
WHEN middle_nm LIKE '' THEN 'M'
END AS Gender
FROM cd_customers WHERE YEAR(valid_to_dttm) = 5999
6 changes: 6 additions & 0 deletions task1/Eremeev_1_2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SELECT
monthly_income_amt
FROM cd_customers
WHERE YEAR(valid_from_dttm) <= 2014 AND YEAR(valid_to_dttm) >= 2014
ORDER BY monthly_income_amt DESC
LIMIT 10
5 changes: 5 additions & 0 deletions task1/Eremeev_1_3.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SELECT DISTINCT
CONCAT(FLOOR(YEAR(birth_dt) / 10), '0-е') AS Generation
FROM cd_customers
WHERE YEAR(valid_to_dttm) = 5999
ORDER BY Generation DESC

0 comments on commit 569f67e

Please sign in to comment.