Basic syntax for "MYSQL" sql

Source: Internet
Author: User

show databases; #查看所有的数据库
Create database Myfirst; #创建一个schemas databases
Use Myfirst; #进入到这个数据库中
Show tables; #查看所有表
CREATE TABLE Myfirst.tableone (ID int NOT NULL primary key,name varchar (a) Not Null,birth Date,sex char (1)); #创建表
Describe Tableone; #查看表结构
ALTER TABLE Tableone add addr varchar () not NULL; #增加一列
ALTER TABLE tableone drop addr; #删除一列
INSERT into Tableone values (' 2 ', ' Flora ', ' 1983-08-24 ', ' M '); #插一条记录
SELECT * from Tableone; #查看表内容

Update tableone set sex= ' F ' where name= ' flora '; #修改
Delete from Tableone where name= ' flora '; #删除

This article from "Happy_candy" blog, declined reprint!

Basic syntax for "MYSQL" sql

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.