Yurttas/PL/DBL/postgres/F/01/Company-A/q04.sql

Revision as of 00:41, 5 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="sql" line start="1" enclose="div">/* REM REM q04.sql REM REM For each project, list the project name and REM the total hours per week (by all employees)...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
 1/*
 2REM
 3REM q04.sql
 4REM
 5REM For each project, list the project name and
 6REM the total hours per week (by all employees) spent
 7REM on that project.
 8REM
 9*/
10
11SELECT current_schema();
12SET search_path to "companya";
13
14SELECT pname, SUM(hours)
15FROM Project, WorksOn
16WHERE pnumber = pno
17GROUP BY pname;