diff --git a/task1/Eremeev_1_1.sql b/task1/Eremeev_1_1.sql new file mode 100644 index 00000000..a61a0d1c --- /dev/null +++ b/task1/Eremeev_1_1.sql @@ -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 diff --git a/task1/Eremeev_1_2.sql b/task1/Eremeev_1_2.sql new file mode 100644 index 00000000..4023de65 --- /dev/null +++ b/task1/Eremeev_1_2.sql @@ -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 diff --git a/task1/Eremeev_1_3.sql b/task1/Eremeev_1_3.sql new file mode 100644 index 00000000..6403f558 --- /dev/null +++ b/task1/Eremeev_1_3.sql @@ -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