Abstract
Standard SQL is incapable of handling recursive database queries and nested relations. A proposed solution to allow recursion in SQL was given in SQL * [KC93], while a solution to allow nested relations in SQL was given in SQL/N F [RKB87]. However, these two problems with SQL were handled separately, and an extended SQL that handles both recursive queries and nested relations is still lacking. To overcome this shortcoming, we propose an extended SQL, called SQL */NR, that not only can handle both recursive queries and nested relations, but also allows aggregate operators. A query Q in SQL */NR is processed by first transforming Q into rule expressions in LDL/NR, a logic database language for nested relations, and the transformed rule expressions are evaluated for retrieving the desired result of Q. Transforming Q into rule expressions in LDL/N R is desirable since LDL/NR handles recursion on nested relations with a built-in mechanism for recursive query processing. In this paper, we define SQL */NR and include an approach for transforming SQL */NR queries into rule expressions in LDL/NR. SQL */NR, as defined, enhances the expressive power of standard SQL and SQL/NF and has the expressive advantage over SQL *.
Preview
Unable to display preview. Download preview PDF.
References
Q. Chen and W. Chu. Deductive and Object-Oriented Database, chapter HILOG: A High-order Logic Programming Language for Non-1NF Deductive Databases, pages 431–452. Elsevier Science Publishers, 1990. W. Kim, et al. (Editors).
Q. Chen and Y. Kambayashi. Nested Relation Based Database Knowledge Representation. In Proceedings of 1991 ACM SIGMOD International Conference on Management of Data, pages 328–337. ACM, 1991.
A. V. Gelder. Foundation of Aggregation in Deductive Databases. In Proceedings of the 3rd Intl. Conference on Deductive and Object-Oriented Databases, pages 13–33. Springer-Verlag, 1993. Lecture Notes in Computer Science, 470.
J. Grant and J. Minker. The Impact of Logic Programming on Databases. Communications of ACM, 35(3):67–81, March 1992.
H. Gallaire and J.-M. Nicolas. Logic and databases: An assessment. In the Third International Conference on Database Theory, pages 177–186. Springer-Verlag, December 1990. Lecture Notes in Computer Science, 470.
Richard Hull. Four Views of Complex Objects: A Sophisticate's Introduction. In S. Abiteboul, P. Fischer, and H. Schek, editors, Nested Relations and Complex Objects in Databases, pages 87–116. Springer-Verlag, New York, 1989. Lecture Notes in Computer Science, 361.
K. Koymen and Q. Cai. SQL *: A Recursive SQL. Information Systems, 18(2):121–128, 1993.
H. Korth and A. Silberschatz. Database System Concepts, Second Edition. McGraw-Hill, Auckland, 1991.
G. M. Kuper. Logic Programming with Sets. Journal of Computer and System Sciences, 41:44–64, 1990.
J. W. Lloyd. Foundations of Logic Programming, Second, Extended Edition. Spring-Verlag, New York, 1987.
S. J. Lim and Y-K Ng. Set-Term Matching in a Logic Database Language. In Proceedings of the 4th International Conference on Database Systems for Advanced Applications, pages 189–196, Singapore, April 1995.
N. Qaraeen. SQL*/NR: A Recursive Query Language for Nested Relations. Master's thesis, Brigham Young University, Provo, Utah, July 1995. (Available via).
M. Roth, H. Korth, and D. Batony. SQL/NF: A Query Language for-1NF Relational Databases. Information Systems, 12(1):99–114, 1987.
M. Roth, H. Korth, and A. Silberschatz. Extended Algebra and Calculus for Nested Relational Databases. ACM Transactions on Database Systems, 13(4):389–417, December 1988.
S. Sudarshan and R. Ramakrishman. Aggregation and Relevance in Deductive Databases. In Proceedings of 17th VLDB., pages 501–511, Barcelona, Spain, 1991.
O. Shmueli, S. Tsur, and C. Zaniolo. Compilation of Set Terms in the Logic Data Language (LDL). Logic Programming, 12(1):89–119, 1992.
UniSQL. UniSQL/X Database Management System User's Manual. UniSQL Inc., Austin, Texas, 1991.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1995 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Ng, YK., Qaraeen, N. (1995). Data retrieval and aggregates in SQL */NR . In: Bhalla, S. (eds) Information Systems and Data Management. CISMOD 1995. Lecture Notes in Computer Science, vol 1006. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-60584-3_39
Download citation
DOI: https://doi.org/10.1007/3-540-60584-3_39
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-60584-3
Online ISBN: 978-3-540-47799-0
eBook Packages: Springer Book Archive