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
;