









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of database theory, focusing on logic, processing, and query languages. It covers topics such as logic in database theory, logic processing, conjunctive queries, and universal relation data model. The document also mentions applications in data mining and materialized views.
Typology: Study notes
1 / 15
This page cannot be seen from the preview
Don't miss anything!










What is Database Theory?
A collecti on of studies, often connected to the relational mo del of data.
Restricted forms of logic, b etween SQL and full rst-order.
Dep endency theory: generalizing functional dep endencies.
Conjunctive queries (CQ's): useful, decidable sp ecial case.
\Universal relations" tting a database schema into a single (virtual) relation.
Why Care?
A lot of this work was, quite frankly, done \for the fun of it." However, it turns out to have unexp ected applicati ons, as natural ideas often do:
Information integration:
F Logic, CQ's, etc., used for expressing how information sources t together. F Recent work using universal-relati on to o | eliminates requirement that user understand a lot ab out the integrated schema.
More p owerful query languages.
F Recursion needed in rep ositories, other applicati ons. F Database logic provided some imp ortant ideas used in SQL3 standard: seminaive evaluati on, strati ed negation.
Potential application: constraints and triggers are inherently recursive. When do they converge?
a) Data mining of databases. b) Materiali zed views, warehouses, data cub es.
Course Requirements
F Each student should attempt to implement an algorithm for one of the problems discussed in the class. F Your choice, but you should pick something that is combinatorially hard, i.e., the problem is dealing eciently with large cases.
F I'll suggest some problems as we go, and keep a list on the Web page.
Rules
Head :- Bo dy
:- is read \if "
Atom = predicate applied to arguments.
Head is atom.
Bo dy is logical AND of zero or more atoms.
Atoms of b o dy are called subgoals.
Head predicate is IDB intensional database = predicate de ned by rules. Bo dy subgoals may have IDB or EDB predicates.
Datalog program = collecti on of rules. One IDB predicate is distinguished and represents result of program.
Meaning of Rules
The head is true for its arguments whenever there exist values for any local variables (those that app ear in the b o dy, but not the head) that make all the subgoals true.
Extensions
cycle(F) :- req(F,F) & NOT source(F)
req(F,"stdio.h") :- type(F,"cCode")
composite(A) :- divides(B,A) & B > 1 & B <> A
F Opp osite of an arithmetic atom is a relational atom.
Seminaive Evaluation
More ecient approach to evaluating rules.
Based on principle that if at round i a fact is inferred for the rst time, then we must have used a rule in which one or more subgoals were instantiated to facts that were inferred on round i 1.
Thus, for each IDB predicate p, keep b oth relation P and relation P ; the latter represents the new facts for p inferred on the most recent round.
Outline of SNE Algorithm
a) Compute new P by applying each rule for p, but with one subgoal treated as a -IDB relation and the others treated as the correct IDB or EDB relation. (Do for al l p ossible choices of the -subgoal.) b) Remove from new P all facts that are already in P. c) P := P [ P.
Mo dels
Mo del of rules + EDB facts = set of atoms selected to b e true such that
Minimal model = mo del + no prop er subset is a mo del.
For a Datalog program with only nonnegated, relational atoms in the b o dies, the unique minimal mo del is what naive or seminaive evaluation pro duces, i.e., the IDB facts we are forced to deduce.
Moreover, this LFP is reached after a nite numb er of rounds, if the EDB is nite.
Function Symb ols
Terms built from
F Example:
addr
str eet(mapl e); number (101)