Skip to content

Commit

Permalink
Add files via upload (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
daria-petrenko authored and mergify[bot] committed Oct 2, 2019
1 parent 7fc135b commit e45ec6f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions task1/Petrenko_1_1.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
SELECT
customer_rk,
CASE
WHEN middle_nm LIKE '%ИЧ' THEN 'M'
WHEN middle_nm LIKE '%НА' THEN 'F'
END AS gender
FROM srcdt.cd_customers
WHERE valid_to_dttm = '5999-01-01 00:00:00'

9 changes: 9 additions & 0 deletions task1/Petrenko_1_2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
SELECT
monthly_income_amt
FROM
srcdt.cd_customers
WHERE
YEAR(valid_from_dttm) <= 2014
AND YEAR(valid_to_dttm) >= 2014
ORDER BY monthly_income_amt DESC
LIMIT 10
7 changes: 7 additions & 0 deletions task1/Petrenko_1_3.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SELECT DISTINCT
CONCAT(YEAR(birth_dt) DIV 10, '0-е') AS generation
FROM
srcdt.cd_customers
WHERE
valid_to_dttm = '5999-01-01 00:00:00'
ORDER BY generation DESC

0 comments on commit e45ec6f

Please sign in to comment.