-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path04.Startups.sql
54 lines (34 loc) · 1.01 KB
/
04.Startups.sql
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
SELECT COUNT(DISTINCT(name)) AS 'Total No. of Companies'
FROM startups;
SELECT SUM(valuation) AS 'Total Valuation'
FROM startups;
SELECT MAX(raised) AS 'Highest Amount Raised'
FROM startups
WHERE stage = 'Seed';
SELECT MIN(founded) AS 'Oldest Founding Year'
FROM startups;
SELECT AVG(valuation)
FROM startups;
SELECT category, ROUND(AVG(valuation),2) AS 'Mean Valuation'
FROM startups
WHERE category IS NOT NULL
GROUP BY category
ORDER BY ROUND(AVG(valuation),2) DESC ;
SELECT category, COUNT(name) AS 'Companies'
FROM startups
GROUP BY category
ORDER BY COUNT(name) DESC;
SELECT category, COUNT(name) AS 'Competitive Companies'
FROM startups
GROUP BY category
HAVING COUNT(name) > 3
ORDER BY COUNT(name) DESC;
SELECT location, ROUND(AVG(employees), 0) AS 'Average Employee Count'
FROM startups
GROUP BY location
ORDER BY AVG(employees) DESC;
SELECT location, ROUND(AVG(employees), 0) AS 'Average Employee Count'
FROM startups
GROUP BY location
HAVING ROUND(AVG(employees), 0) > 500
ORDER BY AVG(employees) DESC;