.

A relational database is a collection of data items organized as logically related tables.

The software required to handle/manipulate the tables/relations is known as Relational Database Management System (RDBMS). Example - Oracle , Sybase, DB2, MSSQL, etc.

A group of rows and columns form a table. The horizontal subset of the Table is known as a** Row/Tuple**. The vertical subset of the Table is known as a **Column/an Attribute**.

A relation in a database has the following characteristics:

• Names of columns are distinct and order of columns is immaterial

• The rows in the relation are not ordered

No.of columns of Table.

No.of rows of Table.

• Defination - The domain of a database attribute is the set of all allowable values that attribute may assume.

• Examples: A field for gender may have the domain {male, female, unknown} where those three values are the only permitted entries in that column.

An Attribute/group of attributes in a table that identifies a tuple uniquely is known as a key. A table may have more than one such attribute/group of attributes that identifies a tuple uniquely, all such attributes(s) are known as** Candidate Keys** . Out of Candidate keys, one is selected as ** Primary key** and others become** Alternate Keys** .

A** Foreign Key** is defined in a second table, but it refers to the primary key in the first table.

**Relational algebra **is a formal system for manipulating relations. Set of operations that can be carried out on a relation:

•** Selection :** To select a horizontal subset of a relation

•** Projection :** To select vertical subset of a relation

•**Cartesian product:** It operates on two relations and is denoted by X. for example Cartesian product of two relation R1 and R2 is represented by R=R1X R2. The degree of R is equal to sum of degrees of R1 and R2. The cardinality of R is product of cardinality of R1 and cardinality of R2
Example Cartesian Product