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

edit

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

edit

Simple query

edit

The following example illustrates how one might retrieve the CPU-speed of all PCs with more than 64MB of RAM from a fictional PC database:

SELECT pc.cpuspeed
FROM PCs pc
WHERE pc.ram > 64;

Query with grouping and aggregation

edit

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.

See also

edit

References

edit
  • Dietrich, Suzanne; Urban, Susan (31 May 2022). "2.4 The ODMG Query Language". Fundamentals of Object Databases. Springer Nature. pp. 31–52. ISBN 978-3-031-01844-2.


📚 Artikel Terkait di Wikipedia

Object Data Management Group

Language (OQL). The ODMG OQL was a declarative (nonprocedural) language for query and updating. It used SQL as a basis, where possible, though OQL supports

Database

varying degrees of conformance) by all mainstream commercial relational DBMSs. OQL is an object model language standard (from the Object Data Management Group)

Object database

at standardization was made by the ODMG with the Object Query Language, OQL. Access to data can be faster because an object can be retrieved directly

.QL

also their corresponding packages and the number of methods each class has. OQL (Object Query Language) Hervé Gallaire and Jack Minker. Logic and Databases

Qantas Flights 7 and 8

Special livery sported on the inaugural A380 service (VH-OQL)

Odaba

Interface (OSI). Object Definition Language (ODL) and Object Query Language (OQL) provided with OSI are ODMG 3.0 conform. Beside standard models (object model

Niki Trigoni

Scientific career Institutions University of Oxford Birkbeck, University of London Cornell University Thesis Semantic optimization of OQL queries (2002)

Db4o

match the schema changes. Rather than using string-based APIs (such as SQL, OQL, JDOQL, EJB QL, and SODA), Native Queries (NQ) allow developers to simply