Previous Topic

Next Topic

The Relational View of Data

A relational database gives a perception of data as a collection of tables (also called relations). Each table is an unordered collection of rows (also called tuples or records). Each row in a table is a collection of column values.

Views are virtual tables derived from the real tables. Views are virtual tables because when a view is created, the view data is not derived and stored in the database. Instead, just the view definition is stored in the database. Once a view is created, it can be used in the same way as using a table, for accessing the database.

A table column can optionally have an index associated with it. An index can be thought of as a list of pointers to the rows of a table, ordered based on the values of the associated column. Indices are created only for performance improvement.

SQL (Structured Query Language) is the most popular language for accessing relational databases. Commands in SQL specify what is to be done and not how it is to be done, leaving all the details of query processing to the language implementation. All these have made SQL the de facto standard in the relational database world.

Most of the SQL implementations provide two types of interfaces for accessing the database. The first interface is the Embedded SQL Interface. This interface supports embedding of SQL statements in a third generation programming language like C or COBOL. The second interface is the Interactive SQL Facility which enables ad hoc queries to be performed on the database in an interactive fashion.

In addition to the language support for querying the database, SQL also supports constructs for handling transactions. A transaction is a sequence of operations on the database that has the properties of being atomic and durable. Atomicity refers to the property that either all the operations in a transaction are done (if the transaction is committed) or none are done (if the transaction is rolled back). Durability refers to the property that once a transaction is committed, the changes done by the transaction are permanent.