Database Programming

Database Programming

The following topics 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 "Relational Algebra" with an abstract treatment of queries in the relational model, introducing the family of operators on relations that form "relational algebra."

These topics i.e. "The Database Language SQL", "Constraints and Triggers" and "System Aspects of SQL" are devoted to SQL programming. As we mentioned, SQL is the dominant query language of the day. "The Database Language SQL" introduces basic ideas regarding queries in SQL and the expression of database schemas in SQL. "Constraints and Triggers" covers aspects of SQL concerning constraints and triggers on the data.

"System Aspects of SQL" covers certain advanced aspects of SQL programming. First, while the simplest model of SQL programming is a stand-alone, generic query interface, in practice most SQL programming is embedded in a larger program that is written in a conventional language, such as C. In "System Aspects of SQL" we learn how to connect SQL statements with a surrounding program and to pass data from the database to the program's variables and vice versa. This portion also covers how one uses SQL features that specify transactions, connect clients to servers, and authorize access to databases by nonowners.

In "Object-Orientation in Query Languages" we turn our attention to standards for object-oriented database programming. Here, we consider two directions. The first, OQL (Object Query Language), can be seen as an attempt to make C++, or other object-oriented programming languages, compatible with the demands of high-level database programming. The second, which is the object-oriented features recently adopted in the SQL standard, can be viewed as an attempt to make relational databases and SQL compatible with object-oriented programming.

Finally, in "Logical Query Languages", we return to the study of abstract query languages that we began in "Relational Algebra". Here, we study logic-based languages and see how they have been used to extend the capabilities of modern SQL.