
Statements
Attention
This page documents an earlier version. Go to the latest (v2.3) version.The following SQL statements are supported by the Yugabyte Structured Query Language (YSQL).
Statement | Description |
---|---|
ABORT |
Rolls back a transaction |
ALTER DATABASE |
Changes database definition |
ALTER DOMAIN |
Alters a domain |
ALTER TABLE |
Changes table definition |
BEGIN |
Starts a transaction |
COMMENT |
Adds a comment on a database object |
COMMIT |
Commits a transaction |
COPY |
Copy data between tables and files |
CREATE DATABASE |
Create a new database |
CREATE DOMAIN |
Create a new domain |
CREATE INDEX |
Create a new index |
CREATE SCHEMA |
Create a new schema (namespace) |
CREATE SEQUENCE |
Create a new sequence generator |
CREATE TABLE |
Create a new table |
CREATE TABLE AS |
Create a new table |
CREATE TYPE |
Create a new type |
CREATE USER |
Create a new user (role) |
CREATE VIEW |
Create a new view |
DEALLOCATE |
Deallocate a prepared statement |
DELETE |
Delete rows from a table |
DROP DATABASE |
Delete a database from the system |
DROP DOMAIN |
Delete a domain |
DROP SEQUENCE |
Delete a sequence generator |
DROP TABLE |
Deletes a table from a database |
DROP TYPE |
Delete a user-defined type |
END |
Commit a transaction |
EXECUTE |
Execute a prepared statement |
EXPLAIN |
Display execution plan for a statement |
INSERT |
Insert rows into a table |
LOCK |
Locks a table |
PREPARE |
Prepare a statement |
RESET |
Reset a parameter to factory settings |
REVOKE |
Remove access privileges |
ROLLBACK |
Rollback a transaction |
SELECT |
Select rows from a table |
SET |
Set a system, session, or transactional parameter |
SET CONSTRAINTS |
Set constraints on current transaction |
SET TRANSACTION |
Set transaction behaviors |
SHOW |
Show value of a system, session, or transactional parameter |
SHOW TRANSACTION |
Show properties of a transaction |
TRUNCATE |
Clear all rows from a table |
UPDATE |
Update rows in a table |