Conjunctive query
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)