Cortex - Cortex (AI / ML)

The Intern has been very glad lately with his new position together with Professor Frosty. Before joining F_F, he was stuck at a job that had a particularly nasty manager.

Using the tools Snowflake Cortex and Top_insights, can you figure out which manager was causing so much trouble?

CREATE OR REPLACE TABLE employees (employee_id INT AUTOINCREMENT,level VARCHAR(2) DEFAULT 'L1',manager_id INT,base_salary INT,time_with_company INT,measurement_date DATE);
INSERT INTO employees (manager_id, base_salary,time_with_company, measurement_date)WITH emp_data_control AS (SELECTUNIFORM(1, 20, RANDOM()) AS manager_id,CASEWHEN RANDOM() < 0.3 THEN UNIFORM(3500, 4499, RANDOM())ELSE UNIFORM(4500, 5500, RANDOM())END AS base_salary,UNIFORM(6, 20, RANDOM()) AS time_with_company,DATE_FROM_PARTS(2024, 1, 1) AS measurement_dateFROMTABLE(GENERATOR(ROWCOUNT => 1000)))SELECT * FROM emp_data_control;
INSERT INTO employees (manager_id, base_salary,time_with_company, measurement_date)WITH managers AS (SELECTSEQ4() AS manager_id,CASEWHEN SEQ4() IN (10) THEN 'high_negative'ELSE 'high_positive'END AS impactFROMTABLE(GENERATOR(ROWCOUNT => 20))),emp_data AS (SELECTm.manager_id AS manager_id,CASEWHEN RANDOM() < 0.3 THEN UNIFORM(4000, 4999, RANDOM())ELSE UNIFORM(5000, 6000, RANDOM())END AS base_salary,CASEWHEN m.impact = 'high_negative' THEN UNIFORM(1, 5, RANDOM())ELSE UNIFORM(6, 20, RANDOM())END AS time_with_company,DATE_FROM_PARTS(2024, 10, 10) AS measurement_dateFROMTABLE(GENERATOR(ROWCOUNT => 1000))JOINmanagers AS m ON trueORDER BY RANDOM())SELECT * FROM emp_data;

Intern has given you 2 pieces of data inside of a single table. One of them is control data, and the other is testing data.

  • Control data is from 2024-01-01 when everything seemed normal
  • Testing data from 2024-10-10.

Can you point out which manager seems to be having a very high turnover rate?

Previous
Previous

Cortex - Cortex (AI / ML)

Next
Next

Week 96 - Administration