MySQL Basic statement

Source: Internet
Author: User

An Action folder (library)

1. Increase

Create Database db1 charset UTF8;

2. By deleting

Drop database db1;

3. Change

ALTER DATABASE DB1 CharSet GBK;

4. Check

# View the database you are currently creating show CREATE Database db1;# view all databases show databases;

Second, table operation

Use DB1; #切换文件夹

Select Database (); #查看当前所在文件夹

1. Increase

int Char);

2. Check

#查看当前的这张t1表show CREATE table t1;# See all Tables show tables;# see table details desc t1;

3. Change

Char (6Char(7);

4. By deleting

# Delete tables drop table T1;

Three operation file contents (record)

1. Increase

# Insert a piece of data that specifies id,name data Leileiinsert T1 (id,name) VALUES (1,"mjj01"), (  2,"mjj02"), (3,"mjj03");

2. Check

Select  from db1.t1; Select  from db1.t1; Select  from

3. Change

set name=' Zhangsan'set name='Alex'  where id=2;

4. By deleting

from fromwhere id=2;

MySQL Basic statement

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.