Browse Source

adding another question (2 left)

tarfeef101 7 years ago
parent
commit
3e3f28cec4
1 changed files with 9 additions and 0 deletions
  1. 9 0
      a2/a2.sql

+ 9 - 0
a2/a2.sql

@@ -146,6 +146,15 @@ section. (Note that a section is identified by a term and a section number.
 Also assume that sorting by section means sorting by term and then by
 section number. The result will therefore have a total of six columns.)
 */
+select (select pname from professor where pnum = c.pnum), c.pnum, c.cnum, c.term, c.section,
+  (select count(distinct snum) from mark where snum in
+  (
+    select snum from student where year between 3 and 4
+  ) and deptcode = c.deptcode and cnum = c.cnum and term = c.term and section = c.section)
+from class c where pnum in
+(
+  select pnum from professor where deptcode = "PM"
+) and term != 1185
 
 /*
 The ratio of professors in pure math (PM) to professors in applied math