3, view the database version number
Select version ();
4, display the current existing database
show databases;
5. Choose Test Database
Use test;
6, view the selected database
Select Database ();
7, set up the database Chinese code
Set names UTF8;
8. Create a test database
Create DATABASE Test
9, create a mtest table
CREATE TABLE Mtest (
ID tinyint (2) unsigned NOT NULL auto_increment,
Name varchar (20),
Sex char (1),
Email varchar (50),
Birth datetime,
Primary KEY (ID)
);
10. Insert a piece of data into the Mtest table
Insert into Mtest (' name ', ' sex ', ' email ', ' birth ') VALUES (' Zhangsan ', ' 1 ', ' zhangsan@163.com ', now ());
11, the Query mtest table name is John Information
SELECT * from mtest where name= ' Zhangsan ';
12. Output in descending order of ID number
SELECT * from mtest ORDER by id DESC;
13, display 11th to 20th data information
SELECT * FROM Mtest ID limit 10, 10;
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