MySQL - HELP Statement



MySQL HELP Statement

The HELP statement is used to retrieve the information from the MySQL official documentation about the specified string.

Syntax

Following is the HELP statement −

HELP 'search_string'

Example

Following query retrieves the list of contents of the MySQL online documentation −

HELP 'contents'
You asked for help about help category: "Contents"
For more information, type 'help <item>', where <item> 
is one of the following
categories:
   Account Management
   Administration
   Components
   Compound Statements
   Contents
   Data Definition
   Data Manipulation
   Data Types
   Functions
   Geographic Features
   Help Metadata
   Language Structure
   Plugins
   Storage Engines
   Table Maintenance
   Transactions
   User-Defined Functions
   Utility

Following query retrieves the list of datatypes of the MySQL database specified in the official online documentation −

HELP 'data types'
You asked for help about help category: "Data Types"
For more information, type 'help <item>', where <item> 
is one of the following
topics:
   AUTO_INCREMENT
   BIGINT
   BINARY
   BIT
   BLOB
   BLOB DATA TYPE
   BOOLEAN
   CHAR
   CHAR BYTE
   DATE
   DATETIME
   DEC
   DECIMAL
   DOUBLE
   DOUBLE PRECISION
   ENUM
   FLOAT
   INT
   INTEGER
   LONGBLOB
   LONGTEXT
   MEDIUMBLOB
   MEDIUMINT
   MEDIUMTEXT
   SET DATA TYPE
   SMALLINT
   TEXT
   TIME
   TIMESTAMP
   TINYBLOB
   TINYINT
   TINYTEXT
   VARBINARY
   VARCHAR
   YEAR DATA TYPE

You can also get the documentation of an in-built function by specifying the name of the function as the search_string, as shown below −

Name: 'LCASE'
Description:
Syntax:
LCASE(str)

LCASE() is a synonym for LOWER().

URL: https://dev.mysql.com/doc/refman/8.0/en/string-functions.html

Following query retrieves the information about the USE query −

help 'use'
Name: 'USE'
Description:
Syntax:
USE db_name

The USE statement tells MySQL to use the named database as the default
(current) database for subsequent statements. This statement requires
some privilege for the database or some object within it.

The named database remains the default until the end of the session or
another USE statement is issued:

USE db1;
SELECT COUNT(*) FROM mytable; # selects from db1.mytable
USE db2;
SELECT COUNT(*) FROM mytable; # selects from db2.mytable

The database name must be specified on a single line. Newlines in
database names are not supported.

URL: https://dev.mysql.com/doc/refman/8.0/en/use.html

Following query retrieves the list of functions of the MySQL database specified in the official online documentation −

help 'functions'
You asked for help about help category: "Functions"
For more information, type 'help <item>', where <item> 
is one of the following
categories:
   Aggregate Functions and Modifiers
   Bit Functions
   Cast Functions and Operators
   Comparison Operators
   Control Flow Functions
   Date and Time Functions
   Encryption Functions
   Enterprise Encryption Functions
   GROUP BY Functions and Modifiers
   GTID
   Information Functions
   Internal Functions
   Locking Functions
   Logical Operators
   Miscellaneous Functions
   Numeric Functions
   Performance Schema Functions
   Spatial Functions
   String Functions
   Window Functions
   XML
Advertisements