Object Query Language
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.
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.
SELECT pc.cpuspeed FROM PCs pc WHERE pc.ram > 64;
Query with grouping and aggregation
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.
- Object Data Management Group (ODMG)
- Object Definition Language