Chapter Objectives
In this chapter, you will learn to:
• identify the shortcomings of the relational model;
• define and use triggers and stored procedures;
• understand how RDBMSs can be extended with OO concepts such as user-defined types, user-defined functions, inheritance, behavior, polymorphism, collection types, and large objects;
• define and use recursive SQL queries.
Opening Scenario
Now that Sober has decided to continue with its relational model, the company was wondering whether it could enrich it with some smart extensions. It wondered whether it would be possible to make the RDBMS more active so it can autonomously take initiative for action when casespecific situations occur. Although Sober was not entirely convinced about OODBMSs and decided not to continue with them, they appreciate some of the OO concepts introduced. They are wondering whether it would be possible to have a best-of-both-worlds approach, whereby they could enrich their relational model with some of the OO concepts they learned about.
In this chapter, we revisit RDBMSs, which are very popular in industry. We start by refreshing the key building blocks of the relational model and discuss its limitations. We then look at the ways of extending relational databases, starting with reviewing triggers and stored procedures as two key mechanisms to make RDBMSs more active. Next, we introduce object-relational DBMSs (ORDBMSs). In contrast to the OODBMSs in Chapter 8, ORDBMSs build on a relational engine, but they extend RDBMSs with object-oriented (OO) characteristics. We conclude with recursive queries, which are a powerful extension to the SQL language.
Limitations of the Relational Model
The relational data model, and the RDBMS implementations thereof, have been very successful for managing well-structured numerical and alphanumerical data. One of the major reasons for this is the mathematical simplicity and soundness of the relational model. As discussed in Chapter 6, its two key building blocks are tuples and relations. A tuple is a composition of values of attribute types that describe an entity. It can be created by using a tuple constructor. A relation is a mathematical set of tuples describing similar entities. It can be created by using a set constructor. As also mentioned in Chapter 6, the relational model requires all relations to be normalized. Data about entities can be fragmented across multiple relations, which are connected using primary–foreign key relationships.
Review the options below to login to check your access.
Log in with your Cambridge Higher Education account to check access.
If you believe you should have access to this content, please contact your institutional librarian or consult our FAQ page for further information about accessing our content.