SQL Commands
While Hyper API provides convenience functions for the common use cases (such as insertion), the most powerful way to interact with Hyper is by using SQL commands. Those SQL commands can be sent to Hyper as shown in the Using SQL commands tutorial.
In general, the available SQL commands can be grouped into different categories:
- The query commands (SELECT, VALUES, and TABLE): Those commands compute some query results based on some input data. They are at the heart of computing, e.g., the data shown in a Tableau visualization or to transform data via joins, aggregations and other function applications.
- Data modification commands: Using INSERT, UPDATE, DELETE, and TRUNCATE), one can change the data stored inside a table. Furthermore, COPY FROM copies data directly from an external file (e.g., a CSV or Parquet file) into a Hyper table. When combined with SELECT queries, one can also use those commands to, e.g., materialize the results of complex analytical computations.
- Data definition commands: Hyper supports commands to create databases, tables and modify ("alter") and delete ("drop") them.
- Support statements for prepared statements: PREPARE can pre-compile a query, including placeholder parameters. A prepared query can later on be executed through EXECUTE, giving specific values for hte parameters. [DEALLOCATE] deallocates a given query.
Below the full list of supported statements:
📄️ SELECT
— retrieve rows from a table or view
📄️ TABLE
— retrieve rows from a table or view (short-hand)
📄️ VALUES
— retrieve a hardcoded set of rows
📄️ INSERT
— create new rows in a table
📄️ UPDATE
— update rows in a table
📄️ DELETE
— delete rows of a table
📄️ TRUNCATE
— empty a table
📄️ COPY FROM
— copy data from a file into a table
📄️ COPY TO
— copy data from a SQL query to a file
📄️ CREATE DATABASE
— create a new database
📄️ CREATE SCHEMA
— define a new schema
📄️ CREATE TABLE
— define a new table
📄️ CREATE TABLE AS
— define a new table from the results of a query
📄️ CREATE EXTERNAL TABLE
— define a new external table
📄️ ALTER SCHEMA
— change properties of a schema
📄️ ALTER TABLE
— change the definition of a table
📄️ DROP TABLE
— remove a table
📄️ DROP SCHEMA
— remove a schema
📄️ DROP DATABASE
— remove a database
📄️ EXPLAIN
— show the query plan for a query
📄️ PREPARE
— prepare a statement for execution
📄️ EXECUTE
— execute a prepared statement
📄️ DEALLOCATE
— deallocate a prepared statement