Skip to content

Instantly share code, notes, and snippets.

@codecademydev codecademydev/project.sqlite Secret

Created May 17, 2020
Embed
What would you like to do?
Codecademy export
--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
You can’t perform that action at this time.