CSC 4710 Lecture Notes - Lecture 19: Asteroid Family, Datalog, Query Language
Document Summary
Csc 4710 lecture 19: problem: list students who took a course from every professor in the computer science. Csprof = {p. profid | professor(p) and p. deptid = cs"} P csprof t teaching r transcript ( And p. id = t. profid and s. id = r. studid and. T. crscode = r. crscode and t. semester = r. semester: queries with implication, did not need views in the previous query, but doing it without a view has its pitfalls: need the implication (if-then): Contrast this with a tuple variable, whose value is an entire tuple. Example: the domain of a domain variable crs might be the set of all possible values of the crscode attribute in the relation teaching: queries in drc. X teaching. crscode ( ) i. e. , there is x in teaching. crscode, such that condition is true. This is similar to the trc query: {t | teaching(t) and t. semester = f1997": query result. Xi can be a constant, c, in which case xi = c.