As explained in the
samples/xsql/scripts/README.txt
file, the SQL sample files*.sql
in this directory are designed to demonstrate eXtremeSQL engine capabilities. They can be run by starting xSQL with the following command from directoryeXtremeDB/samples/xsql/scripts
:..\..\..\target\bin\xsql -iOr, to facilitate running the sample scripts, the command file
sqltest.bat
is provided. For example, using this command file from directoryeXtremeDB/samples/xsql/scripts
(in a Windows console window), the following is a minimal command to run xSQL as a server and execute scriptarray.sql
:xsqltest array(Note that eXtremeDB for HPC packages provide an additional subdirectory financial which includes command file
xsql.bat
that is preferable for launching samples demonstrating analytics features.)The following table lists the sample scripts available in directory
eXtremeDB/samples/xsql/scripts
:
alter Demonstrates the alter table
statementarray Demonstrates inserting values into an array field (column) using two different methods: with “{}”and “[]”syntax as Demonstrates the use of the as
qualifier to convert the result of a query columnasof_join Demonstrates the use of the asof
qualifier to perform joins with specified conditionsbetween Demonstrates the use of the between
operatorbulk Demonstrates the use of the array syntax “[]” to insert multiple values into scalar fields (columns) in a single insert operation compound Demonstrates the use of a compound index. Note also the use of aliases a1
anda2
to form a self-join and use of theexplain
operator to display the execution plancompound_nullable Demonstrates the use of a compound index and a null (nullable) field (column). Note also the use of aliases a1
anda2
to form a self-join and use of theexplain
operator to display the execution planscreate_index Demonstrates the create index
statement. Note the use of thetrace
command to display performance statistics for the queriesdecimal Demonstrates the use of the decimal
field (column) typedelete Demonstrates the delete
statementdisgroup Demonstrates the use of the distinct
qualifier. Note the use of theecho
command to display each SQL statement as it is executed andexplain
to display the execution plandistinct Demonstrates the use of the distinct
qualifierdistinctsum Demonstrates the use of the distinct
qualifier with thesum()
function. Note the use of theexplain
command to display the execution plandrop Demonstrates the use of the drop index
statement. Note the use of theexplain
command to display the execution planexists Demonstrates the use of the exists
operatorfulltext Demonstrates the use of the contains
operator to perform a text search. Note the use of the trace command to display performance statistics for the queriesfunctions Demonstrates the use of several built-in functions including: sum()
,substr()
,length()
,upper()
,lower()
,format()
andcount()
. Note the use of the trace command to display performance statistics for the queriesgroup_by Demonstrates the use of the group by
operatorgroup_by_having Demonstrates the use of the group by
operator with ahaving
clausegroup_by_substr Demonstrates the use of the group by
operator and thesubstr()
functiongroup_order Demonstrates the use of the group by
operator and theorder by
operatorhashjoin Demonstrates how to perform a hash join operation. Note the use of explain
to display the execution planin Demonstrates the use of the in
operatorindexjoin Demonstrates the use of an index
to optimize a lookup operation. Note how theexplain
command displays different execution plans depending on the order of conjunctions in thewhere
clauseinsert Demonstrates different forms of the insert
operationjoin Demonstrates a join
operation joining two tables by date field (column) valuesjoin_compound Demonstrates a join
operation joining two tables by date field (column) values using a compound indexlike Demonstrates the use of the like
operatornullable Demonstrates the use of the null
declaration to define a field (column) as nullable. Note the use ofexplain
to display the execution plannumeric Demonstrates the use of the numeric
field (column) typeorder_by Demonstrates the use of the order by
operatorround Demonstrates the use of the round()
functions_p Demonstrates the use of the various union
andjoin
operationss_p_j_sp Demonstrates the use of the various exists
,any
andin
operations with relatively complex queriessearch Demonstrates a variety of lookup operations with different orders of comparison operators and order by clauses. Note the difference in the execution plans displayed by the explain
command and the performance statistics displayed using thetrace
commandselect_s Demonstrates a variety of lookup operations on table S
with relatively complex queriesselect_sp Demonstrates a lookup operation on table SP
with “>= AND <
” operatorssp Demonstrates a variety of lookup operations on table SP
with relatively complex queriesstringagg Demonstrates the use of the string_agg()
function. Note the difference in the execution plans displayed by theexplain
commandsystem Demonstrates the contents of system tables Metatable
andStatistic
trigram Demonstrates the use of a trigram
indexunion Demonstrates some queries with the union
operatorunionall Demonstrates the use of the union all
operatorupsert Demonstrates the use of the insert
orupdate
operation to insert “horizontal” data into a sequence data type, which stores the data “vertically”with Demonstrates the use of the with
operator