Skip to content

Commit

Permalink
update my files and add Demin (#53)
Browse files Browse the repository at this point in the history
* Add files via upload

* Add files via upload
  • Loading branch information
aredosbyk authored and CrafterKolyan committed Oct 2, 2019
1 parent 569f67e commit 0cf93f5
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
9 changes: 9 additions & 0 deletions task1/Demin_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'
ELSE NULL
END AS gender
FROM cd_customers
WHERE valid_to_dttm = '5999-01-01 00:00:00'
5 changes: 5 additions & 0 deletions task1/Demin_1_2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SELECT monthly_income_amt as the_most_income
FROM cd_customers
WHERE valid_from_dttm >= '2014-01-01 00:00:00' AND valid_from_dttm < '2015-01-01 00:00:00'
ORDER BY monthly_income_amt DESC
LIMIT 10
4 changes: 4 additions & 0 deletions task1/Demin_1_3.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SELECT CONCAT(SUBSTR(birth_dt, 1, 3), '0-e') as generation
FROM cd_customers
WHERE valid_to_dttm = '5999-01-01 00:00:00'
GROUP BY generation DESC
2 changes: 0 additions & 2 deletions task1/Popov_1_1.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
USE srcdt;

SELECT
customer_rk,
CASE
Expand Down
2 changes: 0 additions & 2 deletions task1/Popov_1_2.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
USE srcdt;

SELECT
monthly_income_amt AS monthly_income2014
FROM
Expand Down
2 changes: 0 additions & 2 deletions task1/Popov_1_3.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
USE srcdt;

SELECT DISTINCT
CONCAT(YEAR(birth_dt) - YEAR(birth_dt) % 10, '') AS generation
FROM
Expand Down

0 comments on commit 0cf93f5

Please sign in to comment.