query
A query is a list of one or more goals typed to the Prolog interpreter's ?- prompt, separated by commas, and terminated with a full stop (.). For example,
?- lectures(john, Subject), studies(Student, Subject).
is a query comprising two goals. Prolog tries to satisfy the goals, and if it manages to do this, the query is said to succeed. If not, the query fails.

If the query fails, Prolog types "false.". If it succeeds, Prolog either types the list of variable bindings it had to assume in order to make the query succeed, or, if no variable bindings were necessary, it types "true.".

If several variable bindings allow the query to succeed, then normally (i.e. in the absence of cuts) all the bindings will be typed out, one after the other, with the Prolog user typing a ; to let the Prolog system know that they are ready to see the next set of bindings.