Last active
February 15, 2023 22:55
-
-
Save cfigueiroa/24e643f448a1142b30f3df528da3ba1e to your computer and use it in GitHub Desktop.
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
-- 1 | |
SELECT COUNT("endDate") AS "currentExperiences" FROM experiences; | |
-- SELECT COUNT(*) AS "currentExperiences" FROM experiences WHERE "endDate" IS NOT NULL; | |
-- 2 | |
SELECT "userId" AS id, COUNT(*) AS educations FROM educations GROUP BY "userId" ORDER BY id ASC; | |
-- 3 | |
SELECT users.name as writer, COUNT(*) as "testimonialCount" from testimonials JOIN users ON users.id = testimonials."writerId" GROUP BY users.name ORDER BY users.name ASC; | |
-- 4 | |
SELECT MIN(jobs.salary) AS "maximumSalary", roles.name AS "role" FROM roles JOIN jobs ON roles.id = jobs."roleId" WHERE jobs.active = true GROUP BY roles.name ORDER BY "maximumSalary"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment