Jump to content

Conjunctive query

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Brezenbene (talk | contribs) at 15:38, 28 September 2007 (Created page with 'In database theory, conjunctive queries are a restricted form of first-order queries, which are said to be particularly easy to grasp for ...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

In database theory, conjunctive queries are a restricted form of first-order queries, which are said to be particularly easy to grasp for novice users. A large part of queries issued on relational databases can be written as conjunctive queries, and large parts of other first-order queries can be written as conjunctive queries.

Conjunctive queries are of the general form , with the variables being called distinguished variables, and the variables being called undistinguished variables.

Conjunctive queries can express a large part of queries, which are frequently issued on relational data bases. To give an example, imagine a relational data base 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) . \exists(student2, course) . & &\\

 attends(student, course) & \wedge & gender(student, 'male') \wedge attends(student2, course) \wedge \\
 gender(student2, 'female') & \wedge & lives(student, address)