Skip to main content

Data retrieval and aggregates in SQL */NR

  • Invited Papers
  • Conference paper
  • First Online:
Information Systems and Data Management (CISMOD 1995)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1006))

Included in the following conference series:

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 *.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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).

    Google Scholar 

  2. 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.

    Google Scholar 

  3. 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.

    Google Scholar 

  4. J. Grant and J. Minker. The Impact of Logic Programming on Databases. Communications of ACM, 35(3):67–81, March 1992.

    Article  Google Scholar 

  5. 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.

    Google Scholar 

  6. 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.

    Google Scholar 

  7. K. Koymen and Q. Cai. SQL *: A Recursive SQL. Information Systems, 18(2):121–128, 1993.

    Article  Google Scholar 

  8. H. Korth and A. Silberschatz. Database System Concepts, Second Edition. McGraw-Hill, Auckland, 1991.

    Google Scholar 

  9. G. M. Kuper. Logic Programming with Sets. Journal of Computer and System Sciences, 41:44–64, 1990.

    Article  Google Scholar 

  10. J. W. Lloyd. Foundations of Logic Programming, Second, Extended Edition. Spring-Verlag, New York, 1987.

    Google Scholar 

  11. 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.

    Google Scholar 

  12. N. Qaraeen. SQL*/NR: A Recursive Query Language for Nested Relations. Master's thesis, Brigham Young University, Provo, Utah, July 1995. (Available via).

    Google Scholar 

  13. M. Roth, H. Korth, and D. Batony. SQL/NF: A Query Language for-1NF Relational Databases. Information Systems, 12(1):99–114, 1987.

    Article  Google Scholar 

  14. 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.

    Article  Google Scholar 

  15. S. Sudarshan and R. Ramakrishman. Aggregation and Relevance in Deductive Databases. In Proceedings of 17th VLDB., pages 501–511, Barcelona, Spain, 1991.

    Google Scholar 

  16. O. Shmueli, S. Tsur, and C. Zaniolo. Compilation of Set Terms in the Logic Data Language (LDL). Logic Programming, 12(1):89–119, 1992.

    Article  MathSciNet  Google Scholar 

  17. UniSQL. UniSQL/X Database Management System User's Manual. UniSQL Inc., Austin, Texas, 1991.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Subhash Bhalla

Rights and permissions

Reprints 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

Publish with us

Policies and ethics