MySQL Simple operation

Source: Internet
Author: User

Database: As the name implies is a storage data warehouse, according to the structure of the data to organize the storage and management of data.

Create a database

Create Databese [if not exists]db_name DEFAULT CHARACTER SET charset_name;

Create DATABASE [if not present] database library name character Set character set name

Cases:

Create a database with the name Wo

  

If the database wo does not exist then create a database named Wo

  

Creates a database and specifies the character set used by the CREATE database if not exists TA DEFAULT CHARACTER set UTF8;

  

View current databases Select database ();

   

View current server all databases show databases;

  

to view specific information about a database that has been created show Create Database ni;

  

Switch database use db_name;

  

Modify database Alter DB ni CHARACTER SET = UTF8;

  

Delete database drop databases db_name;

  

Data sheet: One of the parts of the database

Creating a data table Create tables table_name ();

  

View Table

Querying the table data table of the current database show tables;

  

View tables in a specified library show tables from NI;

  

View data sheet structure show columns from table_name;

  

Insert Tab1 values (' Tom ', 25,9876.54);

  

View all contents of a table select * from TAB1;

Write this for the first time, don't mind if you write it well

  

MySQL Simple operation

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.