find all majors of all students who minor in spoken english
Entity Entity Entity Entity
m.04rjg m.01mkq m.05qjt m.01lj9
Mathematics Computer Science Physics Chemistry
class class entity
education.field_of_study education.education m.02h40lc
education.field_of_study education.education education.field_of_study
Field of study Education spoken english
none none none
education.education.major_field_of_study education.education.minor
Major/Field Of Study Minor
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX : <http://rdf.freebase.com/ns/> 
SELECT (?x0 AS ?value) WHERE {
SELECT DISTINCT ?x0  WHERE { 
?x0 :type.object.type :education.field_of_study . 
?x1 :type.object.type :education.education . 
VALUES ?x2 { :m.02h40lc } 
?x1 :education.education.major_field_of_study ?x0 . 
?x1 :education.education.minor ?x2 . 
FILTER ( ?x0 != ?x1 && ?x0 != ?x2 && ?x1 != ?x2  )
}
}
(AND education.field_of_study (JOIN (R education.education.major_field_of_study) (JOIN education.education.minor m.02h40lc)))