SQL Statements for MariaDB Community Server 10.4
This page is part of MariaDB's Documentation.
The parent of this page is: Reference for MariaDB Community Server 10.4
Topics on this page:
Overview
Structured Query Language (SQL) statements enable the reading and writing of data within the database. MariaDB Community Server implements classic and modern SQL database features.
SQL Statement | Description |
---|---|
Modifies database characteristics, such as changing the default character-set and collation | |
Modifies event characteristics, including the schedule, name, and definer | |
Modifies stored function characteristics, including whether it contains SQL, modifies data, and its privilege requirements. Does not support modifying the stored function code. | |
Modifies stored procedure characteristics, including whether it contains SQL code, modifies data, and its privilege requirements. Does not support modifying the stored procedure code. | |
See ALTER DATABASE | |
Modifies sequence characteristics, including its increment, minimum, maximum, and starting values | |
Modifies specifications for a server definition | |
Modifies table characteristics, including changing the name, reordering the columns, and changing column data types | |
Modifies user characteristics, including changing and setting account authentication, TLS restrictions, and password expiration | |
Modifies view characteristics, including the view algorithm, name, and definer | |
Evaluates the Optimizer query plan estimates against execution time | |
Evaluates and stores index statistics for a table. The table remains locked during analysis. | |
Sets lock on table to ensure a consistent backup, causing it to reject DDL statements | |
Performs various staging tasks to minimize lock time during backups | |
Removes backup locks from table | |
Initiates a transaction | |
Internal statement used by mysqlbinlog to generate printable representations of certain binary log events | |
Sets a specific Key Cache for the index on MyISAM tables | |
Executes a stored procedure or function | |
Specifies the primary server to use in replication | |
Evaluates table or tables for errors | |
Evaluates whether the view algorithm is correct | |
Retrieves table checksum, which is used to determine whether two tables are the same (such as on a primary and replica server in replication) | |
Ends a transaction, saving all associated changes so that they become visible to subsequent transactions | |
Creates a function that is computed over a sequence of rows | |
Creates a database | |
Creates and schedules an event | |
Creates a stored function and specifies the code it executes | |
Creates and builds indexes for the table | |
Creates a stored procedure and specifies the code it executes | |
Creates security roles for user accounts | |
Creates a sequence | |
Creates a server definition, for use with the Spider storage engine | |
Creates and builds a spatial index for the table | |
Creates and specifies a table for data storage | |
Creates a trigger event and specifies the conditions in which it runs | |
Creates a user account | |
Creates view of the database as specified from the given SELECT statement | |
Deallocates a prepared statement. The PREPARE statement implicitly deallocates an already open prepared statements. | |
Removes rows of data from the given table or tables | |
See DESCRIBE | |
Provides the table specification | |
Executes the specified expression without returning a result-set | |
Deletes the given database with all its tables and data | |
Deletes an event | |
Deletes a user-defined or stored function | |
Deletes an index from the table | |
Deletes a prepared statement | |
Deletes a stored procedure | |
Deletes a security role for user accounts | |
Deletes a sequence | |
Deletes a server definition | |
Deletes a table and the data it contains from the database | |
Deletes a trigger from tables and database | |
Deletes a user account | |
Deletes a view of the database | |
Runs a prepared statement | |
Provides information on table specifications or on how MariaDB Server executes the given SQL statement. See DESCRIBE. | |
Clears or reloads various internal caches | |
Retrieves information from the diagnostic area on errors, warnings, and notes produced by the last SQL statement | |
Retrieves information from a condition in the diagnostic area on errors, warnings, and notes produced by the last SQL statement | |
Assigns privileges to a user account or security role | |
Provides direct access to the storage engine interface for key lookups or key table scans, where the storage engine supports the operation | |
Used by the client to retrieve basic syntax help and a short description of commands and functions | |
Adds a row or rows of data to table | |
Installs an individual plugin from the specified library | |
Installs all plugins in a library | |
Terminates a statement or thread | |
Copies rows from a text file into the designated table | |
Copies a table index into the Key Cache assigned by a CACHE INDEX statement | |
Copies rows from an XML file into the designated table | |
Explicitly acquires a table lock for the current client session | |
Performs optimization on tablespaces, defragmenting files and updating InnoDB Full Text indexes | |
Creates a prepared statement and assigns it a name for later use | |
Deletes all binary log files listed in the log index prior to the creation of the specified log file name or date, as well as from the log index file. The given log file becomes the first in the list. | |
Removes the specified savepoint from a transaction. It does not rollback or commit any changes. | |
Renames one or more tables or views, but not the associated privileges | |
Renames user accounts | |
Repairs corrupted tables and improves compression | |
Repairs view algorithms, correcting checksums and, where necessary, adding a version field | |
Adds a new row or rows to the table, replacing the row in the event of a conflict with Primary or Unique index keys | |
Deletes all binary log files listed in the log index file. Use only when primary server first starts, never when replica servers are actively replication from the binary log. | |
Removes all query results saved in the Query Cache | |
Resets the replication position in the primary server binary log, giving the replica server a clean start | |
Resends an error in a HANDLER for errors | |
Removes privileges granted to a user account or security role | |
Cancels a transaction and reverts any changes made to data, so that they never become visible to subsequent transactions | |
Creates a named sub-transaction | |
Retrieves data from one or more tables | |
Assigns a value to various types of variables, which can affect server and client operations | |
Defines the character-set and collation to use for strings sent between the current client and server | |
Defines the default security role for the current or specified user account | |
Defines the default transaction level for all subsequent client sessions (does not include existing sessions) | |
Defines the character-set and collation the client uses to send to the server and the server uses to send to the client | |
Defines the password for the given user account | |
Enables a security role with all associated privileges for the current session | |
Assigns a value to a system variable for the duration of a statement | |
Sets the isolation level for the next transaction started in the current session | |
Provides information about databases, tables, columns, or status information about the server | |
Run on the replica server, lists all connections to the primary server, as well as status information on essential parameters of replication threads | |
Lists information about the people who work on MariaDB Server, ordered by those active on MariaDB Server, followed by those involved in the legacy MySQL code as well as those who have contributed in the past | |
Lists the binary log files | |
Lists events in the given binary log. When no binary log is given, it defaults to the first. | |
Lists the available character-sets | |
Lists User Statistics, retrieved from information_ | |
Lists the available character-set collations | |
Lists the column specifications for the given table or view | |
Lists information about the companies and people who financially contribute to the development of MariaDB Server | |
Reports the number of errors that resulted from the last statement | |
Reports the number of warnings that resulted from the last statement | |
Provides the CREATE DATABASE statement needed to recreate the given database with its current specification | |
Provides the CREATE EVENT statement needed to recreate the given event with its current specification | |
Provides the CREATE FUNCTION statement needed to recreate the given stored or user-defined function with its current specification | |
Provides the CREATE PACKAGE statement needed to recreate the given SQL/PL package | |
Provides the SQL/PL code for package | |
Provides the CREATE PROCEDURE statement needed to recreate the given stored procedure | |
Provides the CREATE SEQUENCE statement needed to recreate the given sequence | |
Provides the CREATE TABLE statement needed to recreate the given table | |
Provides the CREATE TRIGGER statement needed to recreate the given trigger | |
Provides the CREATE USER statement needed to recreate the given user | |
Provides the CREATE VIEW statement needed to recreate the given view | |
Lists the available databases | |
Provides operational information about the available storage engines | |
Provides status information on the InnoDB storage engine | |
Provides information on the available storage engines | |
Lists errors resulting from the last statement | |
Lists information about the Event Manager | |
Provides a query plan description for a running query process | |
Provides the internal representation of the given stored function | |
Lists characteristics of the given stored function, like the database, name, type, and creator | |
Lists the privileges granted to the given user account | |
Provides information on indexes for the given table | |
Queries the Information Schema for statistics on index usage, to aid in identifying unused indexes and generated commands to remove them | |
See SHOW INDEX | |
See SHOW INDEX | |
Lists localization information available through the Locales plugin | |
See SHOW BINARY LOGS | |
Provides status information on the binary log files of the Primary Server. Alias for SHOW BINLOG STATUS in 10.5. | |
Lists non-temporary tables currently open in the table cache with additional information, including the database and table names, number of table instances in use, and whether the table is name-locked | |
Provides the internal representation of the given stored SQL/PL package | |
Lists specific characteristics of the given SQL/PL package body | |
Lists general characteristics of the given SQL/PL package | |
Provides information on installed plugins | |
Provides information on all built-in and available plugins in the plugins directory | |
Lists supported system privileges | |
Provides the internal representation of the given stored procedure | |
Lists characteristics of the given stored procedure, like the database, name, and creator | |
Lists information on the currently running threads, including their thread ID, user, command, time, and progress | |
Provides detailed profiling information on resource usage for a single statement executed during the current session | |
Provides detailed profiling information on resource usage statements executed during the current session | |
Lists information on response time from the QUERY_ | |
Run on the Replica Server, lists the events currently in the Relay Log | |
See SHOW DATABASES | |
Run on the Primary Server, lists information on the currently registers Replica Servers | |
Run on the Replica Server, lists status information on essential parameters of the replication threads | |
Lists status information | |
See SHOW ENGINES | |
Lists information on the non-temporary tables, sequences, and views in the given database | |
Lists the non-temporary tables, sequences, and views in the given database | |
Lists information on the currently defined triggers for tables in the given database | |
Lists data from the Information Schema for the USER_ | |
Lists system variables and their current values | |
Lists the errors, warnings, and notes that resulted from the last statement | |
Lists data from the Information Schema for the WSREP_ | |
Lists data from the Information Schema for the WSREP_ | |
Shuts down the server | |
Empties the diagnostics area, producing a custom error. Useful in stored procedures and functions. | |
Initiates replication for all Replica Servers | |
Initiates replication for the current Replica Server | |
Initiates a transaction | |
Halts replication for all running Replica Servers | |
Halts replication for the current Replica Server | |
Removes all rows from the specified table | |
See TRUNCATE | |
Removes the specified plugin | |
Removes all plugins that belong to the specified plugin library | |
Explicitly releases any locks from the given table | |
Sets new values on rows in a table or tables | |
Sets the default database | |
Initiates Common Table Expression (CTE), allowing the reference to a subquery expression many times in the given query that exists only for the duration of the query | |
Initiates an XA transaction | |
Ends the prepared XA transaction, committing the changes | |
Ends the active XA transaction, changing its state to idle | |
Prepares an idle XA transaction for commit | |
Provides information on all prepared XA transactions | |
Ends an idle or prepared XA transaction, reverts its changes | |
See XA BEGIN |