Home Download ObjectDatabase++ GUI Editor Today
 

What is the difference between OQL and SQL?

Object Query Language (OQL) is a newer version of Structured Query Language (SQL) that has been build upon the newer type of Database Management System (DBMS). Traditionally SQL databases were written upon what has become referred to as Relational Database Management System (RDBMS). This system deployed a technique of relating data records to one another by using an incremental counter and joining all records that have the same header value, for example the SQL statement "Select * From OrderBody Where HeaderID = X" would create a temporary table of the selected records and this was done by either searching all records within the OrderBody table or by maintaining an B+-Tree index on the HeaderID field.

In the newer OQL databases, they are based upon an Object Orientated Database Management System (ODBMS), which have the added ability of referring directly to objects within the database by a persisted ObjectID that is guaranteed never to change value, for as long as the object is held within the table. This then gives the OQL database the ability to execute the same SQL statement as above, but it does so without having to maintain an additional index or having to read in every record within the table, as the data is now designed in a manner that can be read in order one efficiency (O(1)). So the speed of an OQL database is not impacted by the growth or size of the database as it is when based upon SQL.

The difference in the languages between both OQL and SQL is very slight, with the only really obvious difference is within the "where" section of the OQL statements, for example, a normal OQL statement may read "Select Street, Suburb, Postcode From Users, Addresses where Users.UserName = 'Me' and Users.AddressID = Adresses.ID"

Copyright © 2003-2007, Ekky Software Pty Ltd. | Privacy Statement | Legal Notice