-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProjet_sql.sql
More file actions
81 lines (43 loc) · 1.4 KB
/
Projet_sql.sql
File metadata and controls
81 lines (43 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
SELECT * FROM layoffs
--- etat en pourcentages des licencement
select max(percentage_laid_off ) ,min(percentage_laid_off )
from layoffs
--- les industries qui ont licencie tous les employes
select company, percentage_laid_off ,funds_raised_millions
from layoffs
where percentage_laid_off=1
-- etat financier des industries qui licencie de plus
select company, percentage_laid_off ,funds_raised_millions
from layoffs
where percentage_laid_off=1 and funds_raised_millions is not null
order by funds_raised_millions desc
---par industrie
select company , sum(total_laid_off) as total_laid_off
from layoffs
where total_laid_off is not null
group by company
order by total_laid_off desc
---par emplacement
select location , sum(total_laid_off) as total_laid_off
from layoffs
where total_laid_off is not null
group by location
order by total_laid_off desc
--par les dernier annees
SELECT EXTRACT(YEAR FROM TO_DATE(date, 'MM/DD/YYYY')) AS year, SUM(total_laid_off) as total_laid_off
FROM layoffs
WHERE TO_DATE(date, 'MM/DD/YYYY') IS NOT NULL
GROUP BY year
ORDER BY year ;
---par pays
select country , sum(total_laid_off) as total_laid_off
from layoffs
where total_laid_off is not null
group by country
order by total_laid_off desc
---par stage
select stage , sum(total_laid_off) as total_laid_off
from layoffs
where total_laid_off is not null
group by stage
order by total_laid_off desc