
Object Query Language is a query language for databases that store objects rather than only rows. A query can follow a reference from one object to another and can return objects, not only columns of values. It was written as the query companion to a standard for object databases.
The systems it queries are an Object-Oriented Database Management System (OODBMS). The language is how a program asks that system a question. The system stores the objects and runs the query.
What a Query Can Ask
- An object. Select objects of a given type that meet a condition.
- A path. Follow a reference from one object to the next inside the query.
- A result that is still an object. The answer need not be flattened into scalar columns.
Object Queries and Table Queries
| Compared | This Language | A Table Query Language |
| What is stored | Objects with references | Rows in tables |
| How related data is reached | A path along references | A join between tables |
| The result | Objects or values | Rows of values |