APPENDIX Other Relational Query Languages In Chapter 6 we presented the relational algebra,which forms the basis of the widely used SQL query language.SQL was covered in great detail in Chapters 3 and 5.We also presented two more formal languages,the tuple relational calculus and the domain relational calculus,which are declarative query languages based on mathematical logic.These two formal languages form the basis for two more user-friendly languages,QBE and Datalog,that we study in this chapter. Unlike SQL,QBE is a graphicallanguage,where queries look like tables.QBE and its variants are widely used in database systems on personal computers.Datalog has a syntax modeled after the Prolog language.Although not used commercially at present,Datalog has been used in several research database systems. For QBE and Datalog,we present fundamental constructs and concepts rather than a complete users'guide for these languages.Keep in mind that individual implementations of a language may differ in details,or may support only a subset of the full language. In this chapter we illustrate our concepts using a bank enterprise with the schema shown in Figure 2.15. c.1 Query-by-Example Query-by-Example(QBE)is the name of both a data-manipulation language and an early database system that included this language. The QBE data-manipulation language has two distinctive features: 1.Unlike most query languages and programming languages,QBE has a two- dimensional syntax.Queries look like tables.A query in a one-dimensional language(for example,SQL)can be written in one(possibly long)line.A two- dimensional language requires two dimensions for its expression.(There is a one-dimensional version of QBE,but we shall not consider it in our discussion.) 1APPENDIX C Other Relational Query Languages In Chapter 6 we presented the relational algebra, which forms the basis of the widely used SQL query language. SQL was covered in great detail in Chapters 3 and 5. We also presented two more formal languages, the tuple relational calculus and the domain relational calculus, which are declarative query languages based on mathematical logic. These two formal languages form the basis for two more user-friendly languages, QBE and Datalog, that we study in this chapter. Unlike SQL, QBE is a graphical language, where queries look like tables. QBEand its variants are widely used in database systems on personal computers. Datalog has a syntax modeled after the Prolog language. Although not used commercially at present, Datalog has been used in several research database systems. For QBE and Datalog, we present fundamental constructs and concepts rather than a complete users’ guide for these languages. Keep in mind that individual implementations of a language may differ in details, or may support only a subset of the full language. In this chapter we illustrate our concepts using a bank enterprise with the schema shown in Figure 2.15. C.1 Query-by-Example Query-by-Example (QBE) is the name of both a data-manipulation language and an early database system that included this language. The QBE data-manipulation language has two distinctive features: 1. Unlike most query languages and programming languages, QBE has a twodimensional syntax. Queries look like tables. A query in a one-dimensional language (for example, SQL) can be written in one (possibly long) line. A twodimensional language requires two dimensions for its expression. (There is a one-dimensional version of QBE, but we shall not consider it in our discussion.) 1