MYSQL Basic Learning Note Overview with basic data type: integer: 1) TINYINT 2) SMALLINT 3) Mediumint 4) INT 5) BIGINT is mainly the size of the difference chart floating point: command

Source: Internet
Author: User

First, the cmd common MySQL related commands


mysql-d,--database=name//Open Database
--delimiter=name//Specify delimiter
-H,--host=name//server name
-P,--password[=name]//password
-P,--Port[=name]//Port number
--prompt==name//Setup prompt
-U,--user=name//user name
-V,--version//output version number


Can be used in combination, such as input-uusernam-ppassword login user name usrname password for password account




II. Basic data types




Integral type:
1) TINYINT 2) SMALLINT 3) Mediumint 4) INT 5) BIGINT
The main difference is the size



Floating point type:
1) FLOAT [(M,d)] 2) double[(M,D)]


Date:


Character type:


The above types, according to the needs of small can be selected. Personal feeling date type will be very fee, character type Plus; it is easy to represent the date, and it is easy to read and write.

Iii. MySQL basic commands



MySQL Statement specification:


1) keyword and function name all uppercase
2) data null name, table name, field name all lowercase
3) The SQL statement must have a good ending


Basic Information command:

SELECT VERSION (); Displays the current server version. Attention! The semicolon must be, it means the command is over, or it will always wait for you to finish the order.
SELECT now (); Show current date
SELECT USER (); Show Current User


Core command:
{} is a required option, selecting one from multiple items [] is optional, dispensable
To create a database command:
Creatte {DATABASE | SCHEMA} [IF not EXISTS] db_name [DEFAULT] CHARACTER SET [=] charset_name;


Show Database command:
show{databases| SCHEMAS} [like ' Pattern ' | WHERE expr];
To view the database that you have created:
SHOW CREATE DATABASE database_name;
To modify the database encoding method:
ALTER {database| SCHEMA} [DEFAULT] CHARACTER SET [=] charset_name;
To delete a database:

DROP {DATABASE | SCHEMA} [IF EXISTS] Db_name





MYSQL Basic Learning Note Overview with basic data type: integer: 1) TINYINT 2) SMALLINT 3) Mediumint 4) INT 5) BIGINT is mainly the size of the difference chart floating point: command

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.