View Updating and Relational Theory

Author: C. J. Date
Publisher: O'Reilly, 2013
Pages: 260
ISBN: 978-1449357849
Audience: Database programmers who want to improve their handling of Views
Rating: 4
Reviewed by: Kay Ewbank

Chris Date proposes an interesting idea for how database systems could achieve updatable views.

Author: C. J. Date
Publisher: O'Reilly, 2013
Pages: 260
ISBN: 978-1449357849
Audience: Database programmers who want to improve their handling of Views
Rating: 4
Reviewed by: Kay Ewbank

Subtitled ‘Solving the View Update problem’, this book is by Chris Date, famous for his work on the relational database model. In it, Date is putting forward an interesting idea for how database systems could achieve the goal of having updatable views.

The problem Date addresses in this book is how a database system could let users update views. A view is a virtual table built by selecting data from one or more real tables. For example, if you have a table that holds customer details, and a related table showing orders placed by customers, you could have a view showing customers who have placed orders this month with the details of what they’ve ordered. That’s all easy to do; what is harder is working out what should happen if the user wants to update the information; maybe they see an error in a customer’s name or address, and want to change it. This can be problematic, and for some views it isn’t possible to make updates.  Date’s position is that views are just virtual tables, and as such they should be updatable, just as real tables are, so what he discusses in the book is the problem and his proposal for overcoming it.

Banner

Date starts with a chapter laying out what he describes as a ‘motivating example’ that is then used throughout the book. He uses suppliers, parts and shipments as his example, with the user seeing a view showing London suppliers and another showing non-London suppliers. He shows how a user might want to (but be unable to) update the view.

The next chapter looks at the parts of relational theory that affect updating. Here, Date moves away from using SQL as the language for examples, and instead uses the language (Tutorial D) that he and Hugh Darwen described in the book Databases, Types and the Relational Model.  This book put forward a theoretical idea about database modeling, and a language that would fit completely with the theory. The theory itself sticks to the rules as laid out by Codd, so prohibits the storage of Null values. You can see from this that we really are talking theoretical here.  You don’t need to worry too much, as Tutorial D is similar enough to SQL to be understandable, it just has some different rules and grammar.  

 

 

In Chapter 3 Date looks in details at views and what they mean conceptually. This chapter would be a good useful read for anyone wanting to know all about views. The next nine chapters then look at different views based on standard operators - restriction, projection, the various joins, intersection, union, difference, group and ungroup, extension and summarization.  In each case, the difficulties posed for updating the view are explained, along with examples of how to get around the difficulties using a set of rules, expressed using Tutorial D. One of the main ways the updating is achieved is by defining compensatory actions; so you’d have cascading rules along the lines of:

On Insert j into LS : Insert j into S ;

(where LS is a view and S is the table it is based on).

After looking at the different types of view and how to carry out updates on them, Date considers what happens when you combine operations, so try updating a union of two joins, say. Finally, he looks at what could be done to overcome ambiguities.

This is very much a theoretical book that will make you think about the problems presented when working with Views, and ways that those problems might be overcome.  In practical terms, it will make you really think deeply about the importance of predicates and constraints, and give you some ideas on how you can write your own code to give you ways to update views safely and successfully.

Date is an excellent writer, and though the academic nature of the material means it’s never going to be an easy read, he makes it as readable as possible.

Banner


The Art of Computer Programming, Volume 4, Fascicle 5

Author: Donald Knuth
Publisher: Addison-Wesley
Pages: 320
ISBN: 978-0134671796
Print: 0134671791
Audience: Knuth fans
Rating: 4
Reviewer: Mike James
Another portion of TAoCP. Do you need to read it?



Seriously Good Software

Author: Marco Faella
Publisher: Manning
Date: March 2020
Pages: 328
ISBN: 978-1617296291
Print: 1617296295
Kindle: B09782DKN8
Audience: Relatively experienced Java programmers
Rating: 4.5
Reviewer: Mike James
Don't we all want to write seriously good software?


More Reviews

Last Updated ( Thursday, 28 February 2013 )