SQL to ReQL cheat sheet
This document has not been updated for Java. The API documentation for Java is complete, but many ReQL articles still have examples in other languages. We’ll be updating each article after the Java driver is officially released.
Terminology
SQL and RethinkDB share very similar terminology. Below is a table of terms and concepts in the two systems.
SQL | RethinkDB |
---|---|
database | database |
table | table |
row | document |
column | field |
table joins | table joins |
primary key | primary key (by default id ) |
index | index |
INSERT
This is a list of queries for inserting data into a database.
SQL | ReQL |
---|---|
SELECT
This is a list of queries for selecting data out of a database.
SQL | ReQL |
---|---|
If you have a secondary index built on the field |
|
If you have a secondary index built on the field |
|
If you have a secondary index built on the field age , you can run a more efficient query: |
|
UPDATE
This is a list of commands for updating data in the database.
SQL | ReQL |
---|---|
DELETE
This is a list of queries for deleting data from the database.
SQL | ReQL |
---|---|
JOINS
This is a list of queries for performing joins between multiple tables.
SQL | ReQL |
---|---|
Note: If you have an index (primary key or secondary index) built on the field of the right table, you can perform a more efficient join with eqJoin. |
|
Note: You can perform more efficient |
|
AGGREGATIONS
This is a list of queries for performing data aggregation.
SQL | ReQL |
---|---|
TABLE and DATABASE manipulation
This is a list of queries for creating and dropping tables and databases.
SQL | ReQL |
---|---|
Note: RethinkDB is a NoSQL database and does not enforce schemas. Note: The default primary key is |
|
Read More
Browse the following resources to learn more about ReQL:
© RethinkDB contributors
Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
https://rethinkdb.com/docs/sql-to-reql/java/