Selaa lähdekoodia

another question down

tarfeef101 6 vuotta sitten
vanhempi
commit
866e84880e
1 muutettua tiedostoa jossa 7 lisäystä ja 3 poistoa
  1. 7 3
      a2/a2.sql

+ 7 - 3
a2/a2.sql

@@ -137,10 +137,14 @@ more than a single course in any given term. (Note that a percentage
 should be a number between 0 and 100.)
 */
 
-select pnum from class where term as old_term not in
+select (select count(*) from professor p where deptcode = "PM" and pnum in
 (
-  select pnum from class where term = old_term
-)
+  select c.pnum, c.deptcode, c.cnum, c.term, c.section from class c where c.pnum = p.pnum and c.pnum not in
+  (
+    select c1.pnum, c1.deptcode, c1.cnum, c1.term, c1.section from class c1 where pnum = p.pnum and c1.term = c.term and (c1.deptcode != c.deptcode or c1.cnum != c.cnum)
+  )
+))
+/ (select count(*) from professor where deptcode = "PM") as percentage
 
 /*
 The number of different third or fourth year students in each section of