DBMS/Query Languages

Query Languages

 * query : the retrieval of tuples from the relations of a relational schema
 * query language : a language used to retrieve information (tuples) from the relations of a relational schema.

types of query language
 * procedural language
 * non-procedural language

Mathematical query languages
 * Relational algebra
 * Tuple relational calculus
 * Domain relational calculus

Relational algebra
relational algebra is a procedural query language BY:NA
 * operations
 * selection (r σ s) -
 * projection (r ∏ s) -
 * union: (r ∪ s)
 * set difference: (r – s)
 * Cartesian product: (r X s)
 * rename: ( ρr )
 * intersection:
 * natural join:
 * division:
 * union:
 * intersection:
 * outer join

Tuple relational calculus
A tuple variable is variable that takes on tuples of a particular relation schema as values. That is, every value assigned to a given tuple variable has the same number and type of fields. A tuple relation calculus query has the form {T I p(t)} where T is a tuple variable and p(T) denotes a formula that describes T; The result of this query is the set of all tuples t for which the formula p(T)evaluates to true with T=t.