Skip to content

Instantly share code, notes, and snippets.

@magi196502
Forked from codecademydev/project.sqlite
Created November 8, 2018 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magi196502/1076ce99457c4d7e5c29ec8d95c6f6a7 to your computer and use it in GitHub Desktop.
Save magi196502/1076ce99457c4d7e5c29ec8d95c6f6a7 to your computer and use it in GitHub Desktop.
Codecademy export
SELECT *
FROM startups;
SELECT COUNT(name)
FROM startups;
SELECT SUM(valuation)
FROM startups;
SELECT MAX(raised)
FROM startups;
SELECT MAX(raised)
FROM startups
WHERE stage = 'Seed';
SELECT MIN(founded)
FROM startups;
SELECT AVG(valuation)
FROM startups;
SELECT category, ROUND(AVG(valuation),2) AS 'Average Valuation'
FROM startups
GROUP BY category
ORDER BY ROUND(AVG(valuation),2) DESC;
SELECT category, COUNT(*) AS 'Companies'
FROM startups
GROUP BY category;
SELECT category, COUNT(*) AS 'Companies'
FROM startups
GROUP BY category
HAVING COUNT(name) > 3;
SELECT location, AVG(employees) AS 'Size'
FROM startups
GROUP BY location;
SELECT location, AVG(employees) AS 'Size'
FROM startups
GROUP BY location
HAVING AVG(employees) > 500;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment