Slamsql Reference Cheat Sheet

ADVERTISEMENT

The SQL Standard for NoSQL Databases
100% Open Source - 100% In-Database
SlamData is a 100% open source solution for native analytics and reporting on NoSQL databases.
Type
Literal Examples
Description
Object ID
OID(”507f1f77bcf86cd799439011”)
Object IDs, which uniquely identify values in
Easily create interactive reporting dashboards that can be viewed and embedded in web sites, web
sets.
apps, and mobile apps.
Ordered Set*
(1, 2, 3)
Ordered set literals.
Explore and re ne data using a high-level GUI
Execute any query using SQL², a subset of ANSI SQL
Array
[1, 2, 3]
Arrays of values.
Pushes 100% of queries into the database(no relocation or streaming)
Emulates data types, operators, and functions not supported by the database
Object
{“foo”: 123}
Maps of values.
Both API and GUI interfaces for programmatic and interactive use cases
Natively supports nesting, arrays, and heterogeneous data (no ETL)
*Denotes a type not natively supported by MongoDB and emulated by SlamData.
Basic Selection
Notebooks
Simple selection of all values from a path
Notebooks allow the creation of complex, optionally interactive data pipelines (including visualization).
SELECT
*
FROM
`/col`
Notebooks are built from individual cells, each of which has a well-de ned purpose. Notebooks can be edited, or
they can be published, which results in a URL that presents a nal interactive report, which hides all the details of
Selection of elds from a path:
the data pipeline.
SELECT
name, age
FROM
`/users`
Cells
Giving a path an alias to refer to in the query
SELECT
c.name, c.age
FROM
`/users`
AS
c
SlamData supports a variety of cell types, including the following:
Filtering a Result Set
Markdown - Create interactive forms and annotations
SELECT
c.name, c.age
FROM
`/users`
AS
c
Explore - Graphically explore any data set
Query - Write and execute SQL²
Filtering the result set by a boolean predicate
Visualize - Create charts that render data from a query
SELECT
c.name
FROM
`/users`
AS
c
WHERE
c.age > 40
Search - Perform semi-structured search on any data set
Filtering the result set by a string literal
These cell types let you build rich data pipleines that can be published to URLs, which can be shared with
SELECT
*
FROM
`/users`
AS
c
colleagues or embedded in web sites, web apps, and mobile apps.
WHERE
c.name = “Sherlock Holmes”
Filtering by multiple boolean predicates
SlamSQL Reference
SELECT
*
FROM
`/users`
AS
c
WHERE
c.name
= “Sherlock Holmes”
AND
SQL² is a subset of ANSI SQL, which support for every major SQL SELECT clause (AS, WHERE, JOIN,
c.street = “Baker Street”
GROUP BY, HAVING, LIMIT, OFFSET, CROSS, etc.), and many SQL functions and operators. It follows
Other relational and boolean operators
Postgres where SQL dialects diverge.
Relational - =, >=, <=, <>, BETWEEN, IN, NOT IN
Boolean - AND, OR, NOT
SQL² Data Types
Numbers
Type
Literal Examples
Description
All standard math operators are supported
Null
null
A sentinel value indicating missing information.
SELECT
c.age + 2 * 1 / 4 % 2
FROM
`/users`
AS
c
Strings
Boolean
true, false
Boolean values.
Concatenating string values together
SELECT
c.firstName || ‘ ‘ || c.lastName
AS
name
Integer
1, -2
Integers (no fractional component).
FROM
`/users`
AS
c
Decimal
1., -2.19743
Decimal numbers (optional fractional
Filtering a set by fuzzy string comparison
components)
SELECT
*
FROM
`/users`
AS
c
WHERE c.LIKE
= “%Joan%”
String
Raw text.
“221B Baker Street”
Filtering a set by regular expression
DateTime
TIMESTAMP(”2004-10-19 10:23:54”)
Date / time values (ISO8601)
SELECT
*
FROM
`/users`
AS
c
WHERE c.LIKE
~ “[sS]h+”
Time*
TIME(”10:23:54”)
Time values.
Other string functions
LOWER - Convert to lowercase
Date*
DATE(”2004-10-19”)
Date values.
UPPER - Convert to uppercase
SUBSTRING - Extract a substring
Repeating intervals (ISO8601).
Interval*
INTERVAL(”P1Y2M3DT4H5M6S”)
LENGTH - Compute length of string

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 2