Skip to content

Commit

Permalink
Update assignment3-infs
Browse files Browse the repository at this point in the history
  • Loading branch information
mfzeidan committed Nov 9, 2016
1 parent 536e645 commit 8d303c4
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions assignment3-infs
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,30 @@ return $x.s
)
let $search_classes := $doc("transcript")[][$$.s eq $jsmith_no].co
for $class in $search_classes
where $class eq "CS52"
return $class = $class
where $class = $search_classes
return $class = $class

e. Every student has satisfied all prerequisites each class she is
enrolled in.

//not right

let $students := distinct-values($doc("student")[].s)
let $transcript_s := $doc("transcript")[].s
for $s in $transcript_s
where $doc("transcript")[].s = $s
return $doc("transcript")[].co


f. Every student who majors in “CS” has satisfied all prerequisites for
each class she is enrolled in.

//not right

let $students := distinct-values($doc("student")[][$$.major = "CS"].s)
for $stud in $doc("transcript")[].s
where $stud = $students
return $stud = $stud

g. A student named “John Smith” is enrolled in a class for which he
did satisfied all prerequisites.
Expand Down Expand Up @@ -132,6 +146,7 @@ return $prereqs = $course
j. Some students received only grades “A” or “B” in every course
they have taken (must appear in Transcripts)

//CHECK BEFORE SUBMISSION

k. All students currently involved in classes taught by professor
Brodsky (instructor = “Brodsky”) major in “CS”
Expand Down Expand Up @@ -185,16 +200,17 @@ return $transcripts
c. All students who satisfied all prerequisites each class they are
enrolled in.



//unsure

d. All students who are enrolled in a class for which they have not
satisfied all its prerequisites.

//unsure

e. All students named “John Smith” who are enrolled in a class for
which they have not satisfied all its prerequisites.

//unsure

f. All courses that do not have prerequisites

Expand Down Expand Up @@ -245,7 +261,7 @@ return $A_or_B
j. All CS students who are currently enrolled in a class taught by
professor Brodsky (instructor = “Brodsky”).

//CORRRECT
//CORRECT

let $q2 := $doc.("class")[][$$.instructor = "Brodsky"]
let $classes_taught_by_teach := $q2.co
Expand Down

0 comments on commit 8d303c4

Please sign in to comment.