<P> An index is one way of providing quicker access to data . Indices can be created on any combination of attributes on a relation . Queries that filter using those attributes can find matching tuples randomly using the index, without having to check each tuple in turn . This is analogous to using the index of a book to go directly to the page on which the information you are looking for is found, so that you do not have to read the entire book to find what you are looking for . Relational databases typically supply multiple indexing techniques, each of which is optimal for some combination of data distribution, relation size, and typical access pattern . Indices are usually implemented via B+ trees, R - trees, and bitmaps . Indices are usually not considered part of the database, as they are considered an implementation detail, though indices are usually maintained by the same group that maintains the other parts of the database . It should be noted that use of efficient indexes on both primary and foreign keys can dramatically improve query performance . This is because B - tree indexes result in query times proportional to log (n) where n is the number of rows in a table and hash indexes result in constant time queries (no size dependency as long as the relevant part of the index fits into memory). </P> <P> Queries made against the relational database, and the derived relvars in the database are expressed in a relational calculus or a relational algebra . In his original relational algebra, Codd introduced eight relational operators in two groups of four operators each . The first four operators were based on the traditional mathematical set operations: </P> <Ul> <Li> The union operator combines the tuples of two relations and removes all duplicate tuples from the result . The relational union operator is equivalent to the SQL UNION operator . </Li> <Li> The intersection operator produces the set of tuples that two relations share in common . Intersection is implemented in SQL in the form of the INTERSECT operator . </Li> <Li> The difference operator acts on two relations and produces the set of tuples from the first relation that do not exist in the second relation . Difference is implemented in SQL in the form of the EXCEPT or MINUS operator . </Li> <Li> The cartesian product of two relations is a join that is not restricted by any criteria, resulting in every tuple of the first relation being matched with every tuple of the second relation . The cartesian product is implemented in SQL as the CROSS JOIN operator . </Li> </Ul> <Li> The union operator combines the tuples of two relations and removes all duplicate tuples from the result . The relational union operator is equivalent to the SQL UNION operator . </Li>

Sql database language is usually found in hierarchical databases