OrientDB Display Records - OrientDB

What is OrientDB Display Records?

Similar to RDBMS, OrientDB supports special types of SQL queries to retrieve the records from the database. While reclaiming the records we have diverse variations or choices of queries along with the select statement.

The subsequent statement is the basic syntax of the SELECT command.
Subsequent are the details about the options in the above syntax.
<Projections> − Specifies the data you want to extract from the query as a result records set.
FROM − Specifies the object to query. This can be a class, cluster, single Record ID, set of Record IDs. You can specify all these objects as target.
WHERE − Specifies the condition to filter the result-set.
LET − Specifies the context variable which are used in projections, conditions or sub queries.
GROUP BY − Specifies the field to group the records.
ORDER BY − Specify the filed to arrange a record in order.
UNWIND − selects the field on which to unwind the collection of records.
SKIP − Specifies the number of records you want to skip from the start of the result-set.
LIMIT − Specifies the maximum number of records in the result-set.
FETCHPLAN − Specifies the strategy defining how you want to fetch results.
TIMEOUT − Specifies the maximum time in milliseconds for the query.
LOCK − Specifies the locking strategy. DEFAULT and RECORD are the available lock strategies.
PARALLEL − Executes the query against ‘x’ concurrent threads.
NOCACHE − Specifies whether you want to use cache or not.

Example

Let’s consider the subsequent Customer table created in the previous chapter.

Sr.No.
Name
Age
1
Satish
25
2
Krishna
26
3
Kiran
29
4
Javeed
21
5
Raja
29

Try diverse select queries to retrieve the data records from the Customer table.
Method 1 − You can use the subsequent query to select all records from the Customer table.
If the above query is executed productively, you will get the subsequent output.
Method 2 − Select all records whose name starts with the letter 'k'.
OR you can use the subsequent query for the above example.
If the above query is executed productively, you will get the subsequent output.
Method 3 − Select id, name records from the Customer table with names in uppercase letters.
If the above query is executed productively, you will get the next output.
Method 4 − Select all records from the Customer table where age is in the range of 25 to 29.
If the above query is executed productively, you will get the subsequent output.
Method 5 − Select all records from the Customer table where any field contains the word ‘sh’.
If the above query is executed productively, you will get the subsequent output.
Method 6 − Select all records from the Customer table, ordered by age in descending order.
If the above query is executed productively, you will get the subsequent output.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

OrientDB Topics