Database Programming

The following categories cover database programming. a) Relational Algebra b) The Database Language SQL c) Constraints and Triggers d) System Aspects of SQL e) Object-Orientation in Query Languages f) Logical Query Languages We start in category “Relational Algebra” with an abstract treatment of queries in the

Other Data Models

The entity-relationship and relational models are just two of the models that have importance in database systems today. In this section we shall introduce you to various other models of rising importance.

The Database Language SQL

The most frequently used relational DBMSs query and modify the database through a language called SQL (often pronounced sequel). SQL stands for "Structured Query Language". The portion of SQL that supports queries has capabilities very close to that of relational algebra, as

Projection in SQL

We can, if we wish, remove some of the components of the selected tuples; that is, we can project the relation created by an SQL query onto some of its attributes. In place of the * of the SELECT clause, we may list some of the attributes of the relation mentioned in the FROM

Comparison of Strings

Two strings are equal if they are the same sequence of characters. SQL allows declarations of different types of strings, for instance fixed-length arrays of characters and variable-length lists of characters. If so, we can expect reasonable

Tags : strings, arrays, sql
Dates and Times

Implementations of SQL normally support dates and times as special data types. These values are often representable in a variety of formats such as 5/14/1948 or 14 May 1948. Here we shall explain only the SQL standard notation, which is very specific about format.

Null Values and Comparisons Involving NULL

SQL allows attributes to have a special value NULL, which is called the null value. There are many different interpretations that can be put on null values. Here are some of the most common:

The Truth-Value UNKNOWN

In Selection in SQL we assumed that the result of a comparison was either TRUE or FALSE, and these truth-values were combined in the obvious way using the logical operators AND, OR and NOT. We have just seen that when NULL values occur, comparisons can yield a third

Queries Involving More Than One Relation

Much of the power of relational algebra comes from its ability to combine two or more relations through joins, products, unions, intersections, and differences. We get all of these operations in SQL. The set-theoretic operations - union, intersection, and difference - appear directly in

Disambiguating Attributes

Sometimes we ask a query involving many relations, and among these relations are two or more attributes with the same name. If so, we need a way to indicate which of these attributes is meant by a use of their shared name. SQL solves this problem by allowing us to place a

Page 0 of 2 « Previous 1 2 Next »