Basic Commands
Basic commands cover object identifier conventions, comment syntax, session parameter settings, and general DDL commands (CREATE, ALTER, DROP, UNDROP, DESC, SHOW) that apply to all object types.
In This Chapter
Common Operations
Object Identifiers
-- Three-part fully qualified name (cross-schema reference)
SELECT * FROM my_workspace.public.orders;
-- Two-part name (current workspace)
SELECT * FROM public.orders;
-- Backtick quoting for names with special characters
SELECT * FROM `my-schema`.`order-table`;
Session Parameters
-- Set query timeout (seconds)
SET QUERY_TIMEOUT = 300;
-- Set timezone
SET TIME_ZONE = 'Asia/Shanghai';
General DDL
-- View object details (table as example)
DESC TABLE public.orders;
-- View object version history
DESC HISTORY public.orders;
-- List all tables (supports pattern matching)
SHOW TABLES LIKE 'order%';
-- List all schemas
SHOW SCHEMAS;
-- Drop an object (IF EXISTS prevents errors)
DROP TABLE IF EXISTS public.temp_table;
-- Restore a dropped table (within retention period)
UNDROP TABLE public.temp_table;