UnQL
Encyclopedia
UnQL is a specification for a query language
Query language
Query languages are computer languages used to make queries into databases and information systems.Broadly, query languages can be classified according to whether they are database query languages or information retrieval query languages...

 for NoSQL
Nosql
In computing, NoSQL is a broad class of database management systems that differ from the classic model of the relational database management system in some significant ways. These data stores may not require fixed table schemas, usually avoid join operations, and typically scale horizontally...

 databases, developed by the creators of SQLite
SQLite
SQLite is an ACID-compliant embedded relational database management system contained in a relatively small C programming library. The source code for SQLite is in the public domain and implements most of the SQL standard...

 and CouchDB
CouchDB
Apache CouchDB, commonly referred to as CouchDB, is an open source document-oriented database written mostly in the Erlang programming language. It is part of the NoSQL group of data stores and is designed for local replication and to scale horizontally across a wide range of devices...

 database management systems, based on SQL
SQL
SQL is a programming language designed for managing data in relational database management systems ....

 used in relational database
Relational database
A relational database is a database that conforms to relational model theory. The software used in a relational database is called a relational database management system . Colloquial use of the term "relational database" may refer to the RDBMS software, or the relational database itself...

s with the elements of JSON
JSON
JSON , or JavaScript Object Notation, is a lightweight text-based open standard designed for human-readable data interchange. It is derived from the JavaScript scripting language for representing simple data structures and associative arrays, called objects...

. It is built to query collection
Collection (computing)
In computer science, a collection is a grouping of some variable number of data items that have some shared significance to the problem being solved and need to be operated upon together in some controlled fashion. Generally, the data items will be of the same type or, in languages supporting...

s (versus table
Table (database)
In relational databases and flat file databases, a table is a set of data elements that is organized using a model of vertical columns and horizontal rows. A table has a specified number of columns, but can have any number of rows...

s) of document
Document-oriented database
A document-oriented database is a computer program designed for storing, retrieving, and managing document-oriented, or semi structured data, information...

s (versus row
Row (database)
In the context of a relational database, a row—also called a record or tuple—represents a single, implicitly structured data item in a table. In simple terms, a database table can be thought of as consisting of rows and columns or fields...

s) with loosely defined field
Field (computer science)
In computer science, data that has several parts can be divided into fields. Relational databases arrange data as sets of database records, also called rows. Each record consists of several fields; the fields of all records form the columns....

s (versus column
Column (database)
In the context of a relational database table, a column is a set of data values of a particular simple type, one for each row of the table. The columns provide the structure according to which the rows are composed....

s). UnQL is a superset of SQL within which SQL is a very constrained type of UnQL for which the queries always return the same fields (same number, names and types). However, UnQL does not cover the data definition language
Data Definition Language
A data definition language or data description language is a syntax similar to a computer programming language for defining data structures, especially database schemas.-History:...

(DDL) SQL statements like CREATE TABLE or CREATE INDEX.

Examples

Inserting values:


INSERT INTO abc VALUE 1234;
INSERT INTO abc VALUE 3.141592653;
INSERT INTO abc VALUE "This is a string";
INSERT INTO abc VALUE ["this", "is", "an", "array"];
INSERT INTO abc VALUE {type: "message", content: "This is an object"};

INSERT INTO abc VALUE {
type: "nested",
content: {
content: "nested object",
x: 1,
y: {str: "hi", str2: "there"},
z: true
}
};


Querying the database:


SELECT FROM abc;


An example query result:


1234
3.141592653
"This is a string"
["this","is","an","array"]
{"type":"message","content":"This is an object"}
{"type":"nested","content":{"content":"nested object","x":1,"y":{"str":"hi","str2":"there"},"z":true}}


More specific query:


SELECT { x:abc.type, y:abc.content.x, z:abc.content.x+50 } FROM abc;

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK