Adding new changes
This commit is contained in:
parent
672836afd8
commit
e91a21cfaa
5 changed files with 222 additions and 0 deletions
BIN
.DS_Store
vendored
Normal file
BIN
.DS_Store
vendored
Normal file
Binary file not shown.
57
03_MyProjects/1.12_KenyanSalaries/1.12Salaries_ke.sql
Normal file
57
03_MyProjects/1.12_KenyanSalaries/1.12Salaries_ke.sql
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
SELECT LIMIT 100;
|
||||
FROM job_postings_fact
|
||||
WHERE job_country = 'Kenya';
|
||||
|
||||
|
||||
SELECT
|
||||
jpf.job_title_short,
|
||||
jpf.job_country,
|
||||
MIN(job_posted_date) as earliestjob,
|
||||
MAX(job_posted_date) as lastestjob,
|
||||
MIN(salary_year_avg),
|
||||
MAX(salary_year_avg),
|
||||
COUNT (job_title_short) as jobs_available,
|
||||
FROM job_postings_fact as jpf
|
||||
WHERE
|
||||
job_title_short IN ('Data Analyst', 'Data Engineer', 'Data Scientist', 'Business Analyst', 'Senior Data Analyst', 'Senior Data Scientist')
|
||||
AND job_country = 'Kenya'
|
||||
AND salary_year_avg is NOT NULL
|
||||
GROUP BY job_title_short,job_country
|
||||
ORDER BY jobs_available DESC;
|
||||
|
||||
|
||||
SELECT COUNT(*)
|
||||
FROM
|
||||
job_postings_fact,
|
||||
WHERE job_country = 'Kenya'
|
||||
;
|
||||
|
||||
|
||||
SELECT COUNT(*)
|
||||
FROM
|
||||
job_postings_fact,
|
||||
WHERE job_country = 'Kenya'
|
||||
AND
|
||||
salary_year_avg IS NULL
|
||||
;
|
||||
|
||||
|
||||
|
||||
SELECT
|
||||
job_title_short,
|
||||
COUNT(*),
|
||||
MIN(salary_year_avg) AS Minimun_Annual$,
|
||||
MAX(salary_year_avg) AS Maximum_Annual$,
|
||||
ROUND(AVG(salary_year_avg)) AS average_salary
|
||||
FROM
|
||||
job_postings_fact,
|
||||
WHERE job_country = 'Kenya'
|
||||
AND
|
||||
salary_year_avg
|
||||
AND
|
||||
job_title_short NOT IN ('Software Engineer ')
|
||||
GROUP BY
|
||||
job_title_short
|
||||
ORDER BY
|
||||
average_salary DESC
|
||||
;
|
||||
42
Lessons/1.10/1.10_DataModelling.sql
Normal file
42
Lessons/1.10/1.10_DataModelling.sql
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
SELECT
|
||||
job_id,
|
||||
job_title_short,
|
||||
salary_year_avg,
|
||||
company_id
|
||||
FROM
|
||||
job_postings_fact
|
||||
LIMIT 10;
|
||||
|
||||
SELECT
|
||||
company_id,
|
||||
name
|
||||
FROM
|
||||
company_dim
|
||||
LIMIT 100;
|
||||
|
||||
SELECT *
|
||||
FROM information_schema.tables
|
||||
WHERE
|
||||
table_catalog='data_jobs';
|
||||
|
||||
SELECT *
|
||||
FROM information_schema.columns
|
||||
WHERE
|
||||
table_catalog='data_jobs';
|
||||
|
||||
|
||||
SELECT *
|
||||
FROM information_schema.table_constraints
|
||||
WHERE
|
||||
table_catalog= 'data_jobs'
|
||||
AND
|
||||
constraint_type IN ('PRIMARY KEY', 'FOREIGN KEY');
|
||||
|
||||
SELECT *
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE
|
||||
table_catalog= 'data_jobs';
|
||||
|
||||
PRAGMA show_tables_expanded;
|
||||
|
||||
DESCRIBE job_postings_fact;
|
||||
122
Lessons/1.11/1.11_Joins.sql
Normal file
122
Lessons/1.11/1.11_Joins.sql
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
SELECT *
|
||||
FROM job_postings_fact
|
||||
LIMIT 100;
|
||||
|
||||
SELECT *
|
||||
FROM company_dim
|
||||
LIMIT 100;
|
||||
|
||||
SELECT
|
||||
jdf.job_title_short,
|
||||
jdf.job_location,
|
||||
jdf.job_via,
|
||||
cdm.name
|
||||
FROM job_postings_fact as jdf
|
||||
JOIN company_dim as cdm
|
||||
ON jdf.company_id AND cdm.company_id
|
||||
LIMIT 100;
|
||||
|
||||
SELECT COUNT(*)
|
||||
FROM company_dim
|
||||
WHERE name = 'CELEBe Korea Co., LTD.';
|
||||
|
||||
SELECT
|
||||
COUNT(company_id)
|
||||
FROM job_postings_fact
|
||||
WHERE company_id = 638608;
|
||||
|
||||
SELECT
|
||||
jdf.job_title_short,
|
||||
jdf.job_location,
|
||||
jdf.job_via,
|
||||
jdf.company_id,
|
||||
cdm.company_id,
|
||||
cdm.name AS companyname
|
||||
FROM job_postings_fact as jdf
|
||||
LEFT JOIN company_dim as cdm
|
||||
ON jdf.company_id AND cdm.company_id
|
||||
LIMIT 10;
|
||||
|
||||
SELECT *
|
||||
FROM company_dim
|
||||
LIMIT 10;
|
||||
|
||||
SELECT *
|
||||
FROM job_postings_fact
|
||||
LIMIT 10;
|
||||
|
||||
SELECT
|
||||
jdm.job_id,
|
||||
jdm.job_title_short,
|
||||
jdm.job_location,
|
||||
jdm.job_via,
|
||||
cd.company_id,
|
||||
cd.name
|
||||
FROM job_postings_fact as jdm
|
||||
JOIN company_dim as cd
|
||||
ON jdm.company_id = cd.company_id
|
||||
LIMIT 20;
|
||||
|
||||
|
||||
SELECT * FROM skills_job_dim
|
||||
LIMIT 10;
|
||||
|
||||
SELECT * FROM job_postings_fact
|
||||
LIMIT 20;
|
||||
|
||||
SELECT *
|
||||
FROM information_schema.tables
|
||||
WHERE table_catalog='data_jobs';
|
||||
|
||||
SELECT *
|
||||
FROM information_schema.columns
|
||||
WHERE table_catalog='data_jobs';
|
||||
|
||||
|
||||
SELECT *
|
||||
FROM information_schema.columns
|
||||
WHERE table_catalog = 'data_jobs';
|
||||
|
||||
|
||||
SELECT
|
||||
jdm.*,
|
||||
FROM job_postings_fact as jdm
|
||||
LIMIT 10;
|
||||
|
||||
SELECT
|
||||
sjm.*
|
||||
FROM skills_job_dim as sjm
|
||||
LIMIT 10;
|
||||
|
||||
|
||||
-- ////////
|
||||
|
||||
SELECT
|
||||
sd.*
|
||||
FROM skills_dim as sd
|
||||
LIMIT 10;
|
||||
|
||||
|
||||
SELECT
|
||||
cd.*
|
||||
FROM company_dim as cf;
|
||||
|
||||
|
||||
|
||||
SELECT
|
||||
jpf.job_id,
|
||||
cd.name,
|
||||
jpf.job_title_short,
|
||||
jpf.job_location,
|
||||
jpf.job_country,
|
||||
sd.skills,
|
||||
sjd.skill_id
|
||||
FROM job_postings_fact as jpf
|
||||
LEFT JOIN skills_job_dim as sjd
|
||||
ON jpf.job_id = sjd.job_id
|
||||
LEFT JOIN skills_dim as sd
|
||||
ON sd.skill_id = sd.skill_id
|
||||
LEFT JOIN company_dim AS cd
|
||||
on jpf.company_id = cd.company_id
|
||||
ORDER BY RANDOM()
|
||||
LIMIT 20;
|
||||
1
Lessons/1.9/1.9_VScode_Intro.sql
Normal file
1
Lessons/1.9/1.9_VScode_Intro.sql
Normal file
|
|
@ -0,0 +1 @@
|
|||
|
||||
Loading…
Reference in a new issue