Created
February 3, 2013 02:22
-
-
Save epok07/4700304 to your computer and use it in GitHub Desktop.
To the Question: List the "Name" and "Salary" of the Profs who teach more than
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
SELECT | |
professors.`name`, | |
SUM(profs.professors.`salary`) AS salary #, count(profs.students.`name`) as "student count" | |
FROM | |
professors, | |
students | |
CROSS JOIN courses | |
WHERE | |
professors.`name` = prof_name | |
AND students.`name` = stud_name | |
GROUP BY | |
professors. NAME #having salary > 20000 #// avg salary( 10000 ) * 20 | |
HAVING | |
count(profs.students.`name`) > 20 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment