Skip to content

Commit

Permalink
Add Kholodov solutions (dated Oct 2 10:43) (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
CrafterKolyan authored Oct 3, 2019
1 parent 80da889 commit 76b9a52
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions task1/Kholodov_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 'M'
WHEN middle_nm LIKE '' THEN 'F'
END) AS gender
FROM cd_customers
WHERE valid_to_dttm = '5999-01-01'
5 changes: 5 additions & 0 deletions task1/Kholodov_1_2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SELECT monthly_income_amt
FROM cd_customers
WHERE valid_to_dttm >= '2014.01.01' AND valid_from_dttm < '2015.01.01'
ORDER BY monthly_income_amt DESC
LIMIT 10;
5 changes: 5 additions & 0 deletions task1/Kholodov_1_3.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SELECT DISTINCT
CONCAT(SUBSTRING(birth_dt, 1, 3), '0-e') as generation
FROM cd_customers
WHERE valid_to_dttm = '5999-01-01'
ORDER BY generation DESC;

0 comments on commit 76b9a52

Please sign in to comment.