Mysql knowledge point summary

Source: Internet
Author: User

I. Database Management: 1. view the database mysql> show databases; 2. create a database mysql> create database name; 3. use mysql> use Database Name; 4. delete database mysql> drop database name;

2. Data Table Management: 1. view the database table mysql> show tables; 2. view the data table structure mysql> desc database table name; mysql> show create table name G; 3. create Database table mysql> create table database table name (column name type modifier); 4. delete database table mysql> drop table database table name; 5. modify, add, delete, rename the field, and sort the fields. Change the table name: mysql> alter table name modify the type of the field to be modified; mysql> alter table name add new field Name field type to be added; mysql> alter table Name drop field name to be deleted; mysql> alter table Name change Original Field name new field type; mysql> alter table name modify | add | field Name field type first | after field name; mysql> alter table original data table name rename new data table name; 6. create an indexed table mysql> create index name on table name (list); or mysql> create table name (index index1 (id, name); 7. insert data mysql> insert into Table Name (list name) values (data to be inserted); or mysql> insert into table name set list 1 = data, list 2 = data; 8. update Data mysql> update table name set column name 1 = data 1, column name 2 = Data 2 ,... [where clause]; 9. delete data mysql> delete from table name [where clause]; 10. query data mysql> select column name 1, column name 2 from table name 1, table name 2 [where clause];

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.