Use | Syntax |
New database | CREATE DATABASE |
Display all databases in the Metadata Definition | SHOW DATABASES |
View database attributes | DESCRIBE DATABASE |
Database attribute changes | ALTER DATABASE SET DBPROPERTIES |
Dropping a Database | DROP DATABASE |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Use | Syntax |
New Data Table | CREATE TABLE |
Query Table Creation Information | SHOW CREATE TABLE |
Query Table Attributes | SHOW TBLPROPERTIES |
Query All Tables in Database | SHOW TABLES |
View Data Table Column Information and Metadata | DESCRIBE TABLE |
Add Column to Data Table | ALTER TABLE ADD COLUMNS |
Add New Column to Data Table | ALTER TABLE ADD COLUMN AFTER/FIRST |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Rename Field | ALTER TABLE ... RENAME COLUMN |
Delete a Field from Data Table | ALTER TABLE DROP COLUMN |
Add Partition Information to Data Table | ALTER TABLE ADD PARTITION |
List Table Partitions | SHOW PARTITIONS |
Delete Partition Information from Data Table | ALTER TABLE DROP PARTITION |
Add Partition Field to Iceberg Table | ALTER TABLE ADD PARTITION FIELD |
Delete Partition Field from Iceberg Table | ALTER TABLE DROP PARTITION FIELD |
Data Table Attribute Changes | ALTER TABLE SET TBLPROPERTIES |
Data Table Storage Location Changes | ALTER TABLE SET LOCATION |
Modify Table Data Sorting Method | ALTER TABLE ... WRITE ORDERED BY |
Modify Partition Table Allocation Policy | ALTER TABLE ... WRITE DISTRIBUTED BY PARTITION |
Update Partition Information (Iceberg table version V2 is not supported.) | MSCK REPAIR TABLE |
Delete Metadata Table | DROP TABLE |
Display the logical or physical plan of executing SQL | EXPLAIN |
Call table stored procedure | CALL STATEMENT |
Use | Syntax |
Create a view from the select result | CREATE VIEW AS |
Query views in the database | SHOW VIEWS |
View column information of the view | DESCRIBE VIEW |
Show view creation statement | SHOW CREATE VIEW |
View column information of the view | SHOW COLUMNS IN VIEW |
Modify view name | ALTER VIEW RENAME TO |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Modify view attribute | ALTER VIEW SET TBLPROPERTIES |
Delete View | DROP VIEW |
Use | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Creating function | CREATE FUNCTION |
| |
| |
View create function syntax | SHOW FUNCTION |
Deleting function | DROP FUNCTION |
Use | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Insert a row of data | INSERT STATEMENT |
| |
Replace a row of data | INSERT OVERWRITE |
Row-level data update operation, which can be used to replace the INSERT OVERWRITE Operation | MERGE INTO |
Iceberg Table Metadata Query | TABLE METADATA |
Insert query results into a data table | INSERT INTO |
| |
Delete data from Iceberg Table | DELETE STATEMENT |
Update specified row | UPDATE |
Use | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Data Query | SELECT STATEMENT |
| |
| |
Feedback