As explained in the
samples/xsql/scripts/README.txtfile, the SQL sample files*.sqlin 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.batis 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.batthat 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 tablestatementarray Demonstrates inserting values into an array field (column) using two different methods: with “{}”and “[]”syntax as Demonstrates the use of the asqualifier to convert the result of a query columnasof_join Demonstrates the use of the asofqualifier to perform joins with specified conditionsbetween Demonstrates the use of the betweenoperatorbulk 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 a1anda2to form a self-join and use of theexplainoperator 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 a1anda2to form a self-join and use of theexplainoperator to display the execution planscreate_index Demonstrates the create indexstatement. Note the use of thetracecommand to display performance statistics for the queriesdecimal Demonstrates the use of the decimalfield (column) typedelete Demonstrates the deletestatementdisgroup Demonstrates the use of the distinctqualifier. Note the use of theechocommand to display each SQL statement as it is executed andexplainto display the execution plandistinct Demonstrates the use of the distinctqualifierdistinctsum Demonstrates the use of the distinctqualifier with thesum()function. Note the use of theexplaincommand to display the execution plandrop Demonstrates the use of the drop indexstatement. Note the use of theexplaincommand to display the execution planexists Demonstrates the use of the existsoperatorfulltext Demonstrates the use of the containsoperator 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 byoperatorgroup_by_having Demonstrates the use of the group byoperator with ahavingclausegroup_by_substr Demonstrates the use of the group byoperator and thesubstr()functiongroup_order Demonstrates the use of the group byoperator and theorder byoperatorhashjoin Demonstrates how to perform a hash join operation. Note the use of explainto display the execution planin Demonstrates the use of the inoperatorindexjoin Demonstrates the use of an indexto optimize a lookup operation. Note how theexplaincommand displays different execution plans depending on the order of conjunctions in thewhereclauseinsert Demonstrates different forms of the insertoperationjoin Demonstrates a joinoperation joining two tables by date field (column) valuesjoin_compound Demonstrates a joinoperation joining two tables by date field (column) values using a compound indexlike Demonstrates the use of the likeoperatornullable Demonstrates the use of the nulldeclaration to define a field (column) as nullable. Note the use ofexplainto display the execution plannumeric Demonstrates the use of the numericfield (column) typeorder_by Demonstrates the use of the order byoperatorround Demonstrates the use of the round()functions_p Demonstrates the use of the various unionandjoinoperationss_p_j_sp Demonstrates the use of the various exists,anyandinoperations 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 explaincommand and the performance statistics displayed using thetracecommandselect_s Demonstrates a variety of lookup operations on table Swith relatively complex queriesselect_sp Demonstrates a lookup operation on table SPwith “>= AND <” operatorssp Demonstrates a variety of lookup operations on table SPwith relatively complex queriesstringagg Demonstrates the use of the string_agg()function. Note the difference in the execution plans displayed by theexplaincommandsystem Demonstrates the contents of system tables MetatableandStatistictrigram Demonstrates the use of a trigramindexunion Demonstrates some queries with the unionoperatorunionall Demonstrates the use of the union alloperatorupsert Demonstrates the use of the insertorupdateoperation to insert “horizontal” data into a sequence data type, which stores the data “vertically”with Demonstrates the use of the withoperator