Chapter 13 SQL Statement Syntax

Table of Contents

13.1 Data Definition Statements
13.1.1 ALTER DATABASE Syntax
13.1.2 ALTER FUNCTION Syntax
13.1.3 ALTER PROCEDURE Syntax
13.1.4 ALTER TABLE Syntax
13.1.5 ALTER VIEW Syntax
13.1.6 CREATE DATABASE Syntax
13.1.7 CREATE FUNCTION Syntax
13.1.8 CREATE INDEX Syntax
13.1.9 CREATE PROCEDURE and CREATE FUNCTION Syntax
13.1.10 CREATE TABLE Syntax
13.1.11 CREATE TRIGGER Syntax
13.1.12 CREATE VIEW Syntax
13.1.13 DROP DATABASE Syntax
13.1.14 DROP FUNCTION Syntax
13.1.15 DROP INDEX Syntax
13.1.16 DROP PROCEDURE and DROP FUNCTION Syntax
13.1.17 DROP TABLE Syntax
13.1.18 DROP TRIGGER Syntax
13.1.19 DROP VIEW Syntax
13.1.20 RENAME TABLE Syntax
13.1.21 TRUNCATE TABLE Syntax
13.2 Data Manipulation Statements
13.2.1 CALL Syntax
13.2.2 DELETE Syntax
13.2.3 DO Syntax
13.2.4 HANDLER Syntax
13.2.5 INSERT Syntax
13.2.6 LOAD DATA INFILE Syntax
13.2.7 REPLACE Syntax
13.2.8 SELECT Syntax
13.2.9 Subquery Syntax
13.2.10 UPDATE Syntax
13.3 MySQL Transactional and Locking Statements
13.3.1 START TRANSACTION, COMMIT, and ROLLBACK Syntax
13.3.2 Statements That Cannot Be Rolled Back
13.3.3 Statements That Cause an Implicit Commit
13.3.4 SAVEPOINT, ROLLBACK TO SAVEPOINT, and RELEASE SAVEPOINT, and Syntax
13.3.5 LOCK TABLES and UNLOCK TABLES Syntax
13.3.6 SET TRANSACTION Syntax
13.3.7 XA Transactions
13.4 Replication Statements
13.4.1 SQL Statements for Controlling Master Servers
13.4.2 SQL Statements for Controlling Slave Servers
13.5 SQL Syntax for Prepared Statements
13.5.1 PREPARE Syntax
13.5.2 EXECUTE Syntax
13.5.3 DEALLOCATE PREPARE Syntax
13.6 MySQL Compound-Statement Syntax
13.6.1 BEGIN ... END Compound-Statement Syntax
13.6.2 Statement Label Syntax
13.6.3 DECLARE Syntax
13.6.4 Variables in Stored Programs
13.6.5 Flow Control Statements
13.6.6 Cursors
13.6.7 Condition Handling
13.7 Database Administration Statements
13.7.1 Account Management Statements
13.7.2 Table Maintenance Statements
13.7.3 User-Defined Function Statements
13.7.4 SET Syntax
13.7.5 SHOW Syntax
13.7.6 Other Administrative Statements
13.8 MySQL Utility Statements
13.8.1 DESCRIBE Syntax
13.8.2 EXPLAIN Syntax
13.8.3 HELP Syntax
13.8.4 USE Syntax

This chapter describes the syntax for the SQL statements supported by MySQL.