04-Initial MySQL statement

Source: Internet
Author: User

This lesson first experiences the basic syntax of MySQL. Action folder (library) increase
Create Database db1 charset UTF8;
Check
# View the currently created database Show Create database db1; # View all databases show databases;
Change
ALTER DATABASE DB1 CharSet GBK;
By deleting
Drop database db1;


Action file (table)
# Toggle Folder  # View your current folder
Increase
CREATE TABLE T1 (id int,name char);
Check
# View the current T1 table Show CREATE table T1; # View all the tables show tables; # View the details of a table desc t1;
Change
# Modify modified meaning ALTER TABLE t1 modify name char (6); # change the name to uppercasename ALTER TABLE t1 changes name NAMA char (7);
By deleting
# Delete Tables drop table t1;

Operation file contents (record) increased
# Insert a piece of data that specifies id,name data leileiInsert T1 (id,name) VALUES (1,"mjj01"), (2," mjj02 "), (3,"mjj03");
Check
From fromfrom Db1.t1; 
Change
Update db1.t1 set name='zhangsan'; update db1.t1 set name='Alex ' where id=2;
By deleting
from from where id=2; 

04-Initial MySQL 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.