Definition
The conjunctive queries are simply the fragment of first-order logic given by the set of formulae that can be constructed from atomic formulae using conjunction and existential quantification, but not using disjunction, negation, or universal quantification . Each such formula can be rewritten (efficiently) into an equivalent formula in prenex normal form, thus this form is usually simply assumed.
Thus conjunctive queries are of the general form
- ,
with the free variables being called distinguished variables, and the bound variables being called undistinguished variables. are atomic formulae. Conjunctive queries without distinguished variables are called boolean conjunctive queries.
Conjunctive queries can express a large part of queries, which are frequently issued on relational databases. To give an example, imagine a relational database for storing information about students, their address, the courses they visit and their gender. Finding all male students and their addresses who attend a course that is also attended by a female student is expressed by the following conjunctive query:
(student, address) . (student2, course) . attends(student, course) gender(student, 'male') attends(student2, course) gender(student2, 'female') lives(student, address)
Note that since the only entity of interest is the male student and his address, these are the only distinguished variables, while the variables course
, student2
are only existentially quantified, i.e. undistinguished.
Read more about this topic: Conjunctive Query
Famous quotes containing the word definition:
“Although there is no universal agreement as to a definition of life, its biological manifestations are generally considered to be organization, metabolism, growth, irritability, adaptation, and reproduction.”
—The Columbia Encyclopedia, Fifth Edition, the first sentence of the article on life (based on wording in the First Edition, 1935)
“According to our social pyramid, all men who feel displaced racially, culturally, and/or because of economic hardships will turn on those whom they feel they can order and humiliate, usually women, children, and animalsjust as they have been ordered and humiliated by those privileged few who are in power. However, this definition does not explain why there are privileged men who behave this way toward women.”
—Ana Castillo (b. 1953)
“... if, as women, we accept a philosophy of history that asserts that women are by definition assimilated into the male universal, that we can understand our past through a male lensif we are unaware that women even have a historywe live our lives similarly unanchored, drifting in response to a veering wind of myth and bias.”
—Adrienne Rich (b. 1929)