Purpose | Statement |
Create a new database. | CREATE DATABASE |
Show all databases defined in the metadata. | SHOW DATABASES |
View database attributes. | DESCRIBE DATABASE |
Change database attributes. | ALTER DATABASE SET DBPROPERTIES |
Delete a database. | DROP DATABASE |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Purpose | Statement |
Create a new data table. | CREATE TABLE |
Query data table creation information. | SHOW CREATE TABLE |
Query table attributes. | SHOW TBLPROPERTIES |
Query all tables in the database. | SHOW TABLES |
View column information and metadata information on data table. | DESCRIBE TABLE |
Add columns to the data table. | ALTER TABLE ADD COLUMNS |
Add new columns to the data table. | ALTER TABLE ADD COLUMN AFTER/FIRST |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Chang field name. | ALTER TABLE ... RENAME COLUMN |
Delete a specific column from the data table. | ALTER TABLE DROP COLUMN |
Add partition information to the data table. | ALTER TABLE ADD PARTATION |
List table partitions. | SHOW PARTITIONS |
Delete partition information from the data table. | ALTER TABLE DROP PARTITION |
Add partition fields to the Iceberg table. | ALTER TABLE ADD PARTITION FIELD |
Delete partition fields from the Iceberg table. | ALTER TABLE DROP PARTITION FIELD |
Change data table attributes. | ALTER TABLE SET TBLPROPERTIES |
Change the storage location of the data table. | ALTER TABLE SET LOCATION |
Modify the sorting method of the table data. | ALTER TABLE ... WRITE ORDERED BY |
Modify the allocation policy of the partitioned table. | ALTER TABLE ... WRITE DISTRIBUTED BY PARTITION |
Update partition information. | MSCK REPAIR TABLE |
Delete the metadata table. | DROP TABLE |
Show the logical or physical execution plan of SQL. | EXPLAIN |
Call the table stored procedure. | CALL STATEMENT |
Purpose | Statement |
Create a view from the select results. | CREATE VIEW AS |
Query views in the database. | SHOW VIEWS |
View the column information of a view. | DESCRIBE VIEW |
Show the view creation statement. | SHOW CREATE VIEW |
View column information of the view. | SHOW COLUMNS IN VIEW |
Rename the view. | ALTER VIEW RENAME TO |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Modify view attributes. | ALTER VIEW SET TBLPROPERTIES |
Delete the view. | DROP VIEW |
Purpose | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Create a function. | CREATE FUNCTION |
| |
| |
View function creation statement. | SHOW FUNCTION |
Delete function. | DROP FUNCTION |
Purpose | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Insert a row of data. | INSERT STATEMENT |
| |
Replace a row of data. | INSERT OVERWRITE |
Row-level data update operations, which can be used to replace INSERT OVERWRITE operations. | MERGE INTO |
Query Iceberg table metadata. | TABLE METADATA |
Insert query results into a data table. | INSERT INTO |
| |
Delete data from an Iceberg table. | DELETE STATEMENT |
Update specific rows. | UPDATE |
Purpose | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Query data. | SELECT STATEMENT |
| |
| |
Was this page helpful?