This Article 
 Bibliographic References 
 Add to: 
RQL: A Recursive Query Language
June 1993 (vol. 5 no. 3)
pp. 451-461

Different classes of recursive queries in the relational databases are identified. It is shown that existing proposals to extend the relational query languages are either not powerful enough to express queries in many of these classes or use nonfirst normal form constructs. RQL, a recursive database query language that can be used to express recursive queries on all the classes identified, is presented. RQL is based on the relational algebra. In addition to functions that correspond to the standard and extended relational algebra operators, RQL supports functions required to express general recursive queries. The elements of RQL and the ways in which they are used to formulate complicated, but useful, recursive queries are described. The effects of the extensions embodied in RQL on the termination of recursive query evaluation are discussed.

[1] R. Agrawal, "Alpha: An Extension of Relational Algebra to Express a Class of Recursive Queries,"Proc. Third Int'l Conf. Data Eng., CS Press, Los Alamitos, Calif., Order No. FN762, 1987, pp. 580-590.
[2] A. Aho and J. Ullman, "Universality of data retrieval languages," inProc. 6th ACM Symp: Principles of Programming Languages, San Antonio, TX, Jan. 1979.
[3] F. Bancilhon and R. Ramakrishnan, "An amateur's introduction to recursive query processing strategies," inProc. 1986 ACM-SIGMOD Conf. Management of Data(Washington, DC), May 1986, pp. 16-52.
[4] B. Carre,Graphs and NetworksNew York: Oxford University, 1979.
[5] D. Chamberlinet al., "Sequel 2: A unified approach to data definition, manipulation, and control,"IBM J. Res. Develop., Nov. 1976.
[6] A. K. Chandra and D. Harel, "Horn clauses and the fixpoint query hierarchy," inProc. 1st Symp. Principles of Database Syst., 1982, pp. 158-163.
[7] E. Clemons, "Design of an external schema facility to define and process recursive structures,"ACM Trans. Database Syst., vol. 6, no. 2, pp. 295-311, 1981.
[8] E. F. Codd, "A relational model of data for large shared data banks,"Commun. ACM, pp. 377-387, June 1970.
[9] G. Gardarin and P. Valduriez,Relational Databases and Knowledge Bases. New York: Addison-Wesley, 1989.
[10] H. Gallaire, J. Minker, and J. Nicolas, "Logic and databases: A deductive approach,"ACM Comput. Surveys, vol. 16, pp. 153-185,1984.
[11] A. Guttman, "New features for a relational database system to support computer aided design," UCB/ERL Memo M84/52, June 1984
[12] S. Heiler and A. Rosenthal, "G-whiz, A visual interface for the functional model with recursion," inProc. Int. Conf. on Very Large Databases, 1985.
[13] T. Imielinski and S. Naqvi, "Explicit control of logic programs through rule algebra." inProc., ACM Symp. Principles of Database Syst., 1988, pp. 103-116.
[14] Y. Ioannidis, "Transforming Nonlinear Recursion into Linear Recursion," inProc. Int. Workshop on Expert Database Systems, Washington, D.C., March 1988.
[15] H. V. Jagadish and R. Agrawal, "A study of transitive closure as a recursion mechanism," inProc. 1987 ACM SIGMOD Conf. (San Francisco, CA), 1987, pp. 331-334.
[16] A. Klug, "Equivalence of Relational Algebra and Relational Calculus Query Languages Having Aggregate Functions,"J. ACM, Vol. 29, No. 3, July 1982, pp. 699-717.
[17] S. Naqvi and S. Tsur,A Logical Language for Data and Knowledge Bases. New York: Computer Sci. Press, 1989.
[18] "Tree-structured information in tables," inORACLE SQL*Users Guide. Menlo Park, CA: Relational Software, 1986, ch.13.
[19] A. Rosenthal, S. Heiler, U. Dayal, and F. Manola, "Traversal recursion: a practical approach to supporting recursive applications," inProc. 1986 ACM SIGMOD Conf.(Washington, DC), 1986, pp. 166-176.
[20] M. Stonebraker,et al., "The design and implementation of INGRES,"ACM Trans. Database Syst., vol. 1, no. 3, Sept. 1976.
[21] A. Tarski, "A lattice theoretical fixpoint theorem and its applications,"Pacific J. Math., vol. 5, 1955.
[22] J.W. Dolter, P. Ramanathan, and K.G. Shin, "A Microprogrammable VLSI Routing Controller for HARTS,"Proc. Int'l Conf. Computer Design: VLSI in Computers, Computer Society Press, Order No. 1971, Oct. 1989, pp. 160-163.
[23] D. Troy and C. Yu, "Transforming nonlinear recursive rules to linear recursive rules," Tech. Rep., Univ. Illinois at Chicago, 1986.
[24] J. D. Ullman, "Implementation of logical query languages for databases,"ACM TODS, vol. 10, no. 3, pp. 289-321, 1985.
[25] J. D. Ullman,Database and Knowledge-base Systems. Rockville, MD: Computer Science Press, 1988.
[26] XDB:Extended Database System, User's ManualXDB Systems, Inc., College Park, MD, 1989.
[27] W. Zhang and C. T. Yu, "A necessary condition for a doubly recursive rule to be equivalent to a linear recursive rule," inProc. 1987 ACM-SIGMOD Conf. Management of Data, San Francisco, CA, May 1987, pp. 345-356.
[28] M. Zloof, "Query by example: Operations on the transitive closure," Res. Rep. RC 5526, IBM Res. Cent., Yorktown Heights, NY, 1984.

Index Terms:
RQL; recursive query language; relational databases; relational query languages; nonfirst normal form constructs; recursive database query language; relational algebra; recursive query evaluation; query languages; relational databases
R. Ahad, S. Bing Yao, "RQL: A Recursive Query Language," IEEE Transactions on Knowledge and Data Engineering, vol. 5, no. 3, pp. 451-461, June 1993, doi:10.1109/69.224197
Usage of this product signifies your acceptance of the Terms of Use.