Object Query Language
{{Short description|Query language for object-oriented databases}}
{{inline|date=March 2025}}
Object Query Language (OQL) is a query language standard for object-oriented databases modeled after SQL and developed by the Object Data Management Group (ODMG). Because of its overall complexity the complete OQL standard has not yet been fully implemented in any software. The OQL standard influenced the design of later query languages such as JDOQL and EJB QL, though none are considered to be any version of OQL.
General rules
The following rules apply to OQL statements:
- All complete statements must be terminated by a semi-colon.
- A list of entries in OQL is usually separated by commas but not terminated by a comma(,).
- Strings of text are enclosed by matching quotation marks.
Examples
=Simple query=
=Query with grouping and aggregation=
The following example illustrates how one might retrieve the average amount of RAM on a PC, grouped by manufacturer:
SELECT manufacturer, AVG(SELECT part.pc.ram FROM partition part)
FROM PCs pc
GROUP BY manufacturer: pc.manufacturer;
Note the use of the keyword partition
, as opposed to aggregation in traditional SQL.
References
{{refbegin}}
- {{cite book |last1=Dietrich |first1=Suzanne |last2=Urban |first2=Susan |title=Fundamentals of Object Databases |date=31 May 2022 |publisher=Springer Nature |isbn=978-3-031-01844-2 |pages=31–52 |chapter-url=https://books.google.com/books?id=JYdyEAAAQBAJ&dq=%22Object+Query+Language%22+-wikipedia&pg=PA31 |language=en |chapter=2.4 The ODMG Query Language}}
- {{cite book |last1=Cattell |first1=Roderic Geoffrey Galton |last2=Barry |first2=Douglas K. |last3=Berler |first3=Mark |title=The Object Data Standard: ODMG 3.0 |date=2000 |publisher=Morgan Kaufmann |isbn=978-1-55860-647-0 |pages=89–152 |url=https://books.google.com/books?id=2-FF-aQ_twQC |access-date=31 March 2025 |language=en |chapter=Object Query Language}}
{{refend}}
See also
- Object Data Management Group (ODMG)
- Object Definition Language