The basic operation of MySQL

Source: Internet
Author: User

Basic management statements for libraries

SHOW DATABASES; # Show All Libraries

Create database name;

Show create database name; # Display library creation information

drop database name; # Delete Library

Use library name; Enter database

Basic management statements for tables

SHOW TABLES; # Show All Tables

CREATE table table name (columns); # Create a table

Show create table table name;

drop table name; # Delete Tables

increase, delete, change and check the data in a single table:

Select ID from test; # Query ID from the test table;

Increase

mysql> INSERT into Test (ID) value (1);

mysql> INSERT INTO Test (id,name) value (2, ' Zhang San ');

mysql> INSERT INTO test values (3, ' John Doe '), (4, ' Harry ');

mysql> INSERT INTO set id=6,name= ' micro ';

Inquire

mysql> Select *from test; # query All

Mysql> Select *from test where id=2;

Modify

Update test set name= ' Zhang San ' where id=1; the name of the #把id =1 is changed to ' Zhang San ', without the ' where ' condition all replaced with Zhang San

Delete

Delete from test where id=1; #不加 ' where ' condition is completely deleted

The basic operation of MySQL

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.