docs/src/main/sphinx/language/sql-support.md
The SQL statement support in Trino can be categorized into several topics. Many
statements are part of the core engine and therefore available in all use cases.
For example, you can always set session properties or inspect an explain plan
and perform other actions with the {ref}globally available statements <sql-globally-available>.
However, the details and architecture of the connected data sources can limit
some SQL functionality. For example, if the data source does not support any
write operations, then a {doc}/sql/delete statement cannot be executed against
the data source.
Similarly, if the underlying system does not have any security concepts, SQL
statements like {doc}/sql/create-role cannot be supported by Trino and the
connector.
The categories of these different topics are related to {ref}read operations <sql-read-operations>, {ref}write operations <sql-write-operations>,
{ref}security operations <sql-security-operations> and {ref}transactions <sql-transactions>.
Details of the support for specific statements is available with the documentation for each connector.
(sql-globally-available)=
The following statements are implemented in the core engine and available with any connector:
/sql/call/sql/deallocate-prepare/sql/describe-input/sql/describe-output/sql/execute/sql/execute-immediate/sql/explain/sql/explain-analyze/sql/prepare/sql/reset-session/sql/set-session/sql/set-time-zone/sql/show-functions/sql/show-session/sql/use/sql/values(sql-catalog-management)=
The following statements are used to manage dynamic catalogs:
/sql/create-catalog/sql/drop-catalog(sql-read-operations)=
The following statements provide read access to data and metadata exposed by a connector accessing a data source. They are supported by all connectors:
/sql/select including {doc}/sql/match-recognize/sql/describe/sql/show-catalogs/sql/show-columns/sql/show-create-materialized-view/sql/show-create-schema/sql/show-create-table/sql/show-create-view/sql/show-grants/sql/show-roles/sql/show-schemas/sql/show-tables/sql/show-stats(sql-write-operations)=
The following statements provide write access to data and metadata exposed by a connector accessing a data source. Availability varies widely from connector to connector:
(sql-data-management)=
/sql/insert/sql/update/sql/delete/sql/truncate/sql/merge(sql-schema-table-management)=
/sql/create-table/sql/create-table-as/sql/drop-table/sql/alter-table/sql/create-schema/sql/drop-schema/sql/alter-schema/sql/comment(sql-view-management)=
/sql/create-view/sql/drop-view/sql/alter-view(sql-materialized-view-management)=
/sql/create-materialized-view/sql/alter-materialized-view/sql/drop-materialized-view/sql/refresh-materialized-view(udf-management)=
The following statements are used to manage :
(sql-security-operations)=
The following statements provide security-related operations to security configuration, data, and metadata exposed by a connector accessing a data source. Most connectors do not support these operations:
Connector roles:
/sql/create-role/sql/drop-role/sql/grant-roles/sql/revoke-roles/sql/set-role/sql/show-role-grantsGrants management:
/sql/deny/sql/grant/sql/revoke(sql-transactions)=
The following statements manage transactions. Most connectors do not support transactions:
/sql/start-transaction/sql/commit/sql/rollback