-
-
Save codecademydev/6d09ab19443569ef6b8390d552332e38 to your computer and use it in GitHub Desktop.
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--2 | |
SELECT COUNT(*) AS 'Total No. Of Companies' FROM startups; | |
--3 | |
SELECT SUM(valuation) AS 'Total Valuation Of All Companies' FROM startups; | |
--4 & 5 | |
SELECT MAX(raised) AS 'Max Amount Of Money Raised' FROM startups | |
WHERE stage = 'Seed'; | |
--6 | |
SELECT MIN(founded) AS 'Oldest Company Foundation Year' FROM startups; | |
--7 | |
SELECT AVG(valuation) AS 'Total Average Valuation' FROM startups; | |
--8 & 9 & 10 | |
SELECT category, ROUND(AVG(valuation),2) AS 'Average Valuation' FROM startups | |
GROUP BY 1 | |
ORDER BY 2 DESC; | |
--11 & 12 | |
SELECT category, COUNT(*) AS 'Total No. Of Companies' FROM startups | |
GROUP BY 1 | |
HAVING COUNT(*) > 3 | |
ORDER BY 2 DESC; | |
--13 | |
SELECT location, AVG(employees) AS 'Size Of A Startup' FROM startups | |
GROUP BY 1 | |
HAVING AVG(employees) > 500 | |
ORDER BY 2 DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment