MySQL's instructions

Source: Internet
Author: User

MySQL has a couple of features:

1: Multi-lingual support

2: Can be good portability

3: Free Open source

4: Efficient (multi-threading support, full utilization of CPU resources, very fast running)

5: Large data query and storage support

6: Easy to learn and easy to operate

In fact, the database is to use a table to store the data, the data in this table to increase the deletion and check, you can complete a database basic functions:

There are several aspects to a table:

Header (header): Name of each column

Column (ROW): A collection of data with the same data type

Row (COL): Each line is used to describe the specific information of a person/thing

Key: A method used to identify a particular person \ object, and the value of the key is unique in the current column

Value: The specific information for the row, each value must be the same as the data type of the column;

The MySQL data type has the following aspects:

integers: tinyint, smallint, mediumint, int, bigin

Floating point number
float, double, real, decimal

Date and time
Date, time, DateTime, timestamp, year

String type
String
char, varchar
Text
Tinytext, text, Mediumtext, Longtext
Binary (used to store pictures, music, etc.)
Tinyblob, BLOBs, Mediumblob, Longblob

After we have learned this, we can do the command operation of the database:

We operate in the CMD panel:

Link MySQL
Mysql-h host Address-u user name (root)-p user Password admin

Create a database
Create databases < database name >;

Display Database
show databases;

Working with databases
Use < database name >;

Deleting a database
Drop databases < database name >;

Create a data table
CREATE table < table name > (< Field name 1> < type 1> [,.. < Field name N> < type n>]);

Get table structure
DESC table name;

Show data table
Show tables;

Delete a data table
DROP table < table name >;

Modify Table name *
Rename table name to new table name;

Inserting data
INSERT into < table name > [(< Field name 1>[,.. < field name n >])] VALUES (value 1) [, (value N)];

Querying data
Select < Field 1, Field 2, ...> from < table name > where < expression >;
SELECT * FROM < table name > where < expression >; Query all

modifying data
Update table name Set field = new value,... where condition;

Delete data
Delete from table name where expression;

MySQL's instructions

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.