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

Source: Internet
Author: User

One, the CMD frequently uses the MySQL related command


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//username
-V,--version//output version


Able to use combination, such as input-uusernam-ppassword login username for usrname password for password account




II. Basic data types




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



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


Date:


Character type:


The above types. Select small as needed to be able. Personal feeling date type will be very fee, character type Plus, very easy to be able to express the date, and read and write is also convenient.

Iii. MySQL basic commands



MySQL Statement specification:


1) keyword with 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 number.

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;
Change 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 Main is 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.