"MySQL must know" study notes _1

Source: Internet
Author: User

# Select Database

Use MySQL

# return to the list of available databases

SHOW DATABASES

# Returns the tables available in the current database

SHOW TABLES

# return table columns

SHOW COLUMNS from DB

# Show creation statements for a specific database

SHOW CREATE DATABASE MySQL

# Displays extensive server status information

SHOW STATUS

# Show security permissions for authorized users

SHOW GRANTS

Multiple SQL statements must be separated by semicolons.

SQL statements are case-insensitive and habitually capitalized.

Retrieve different rows with DISTINCT, returning only different values.

Limit result, limit clause

LIMIT 5 returns no more than 5 rows.

LIMIT 3,4 4 lines starting from line 3

LIMIT 4 OFFSET 3 (results ibid.) "MySQL5 support Later"

ORDER BY clause ordering

Desc/asc specifying the sort direction

the WHERE clause, where theORDER by is located .

Operator

Description

=

Equals

<>

Not equal to

!=

Not equal to

<

Less than

<=

Less than or equal

>

Greater than

>=

Greater than or equal

Between

Between a specified two values

NULL No value

The WHERE * * is null check field has no null value.

and OR operators.

The in operator is used to specify a range of criteria, and multiple legal values are separated by commas.

The not negation operator, which supports negation of in ,between , and EXISTS clauses.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.