有了mysql这类数据库管理软件, 就可以将程序员从繁琐的数据管理中解脱出来, 让我们更加专注的编写程序的逻辑
SQL语言主要用于存取数据、查询数据、更新数据和管理关系数据库系统,SQL语言由IBM开发, 分为3种类型:
添加库 : create database db01 charset utf8;
查库 : show databases;
改库 : alter database db01 charset latin1;
删库 : drop database db01;
先切换到文件夹下 : use db01
增 : create table t01(id int,name char,age int);
查 : show tables
改 : alter table t01 modify name char(4);
改 : alter table t01 change names name char(3);
删 : drop table t01;
增 : insert into t01 values(1,"派大星",22),(2,"章鱼哥",34),(3,"海绵宝宝",23);
查 : select * from t01;
改 : update t01 set name="蟹老板" where id=3;
删 : delete from t01 where id=2;
清空表 : delete from t01
清空表 : truncate t01
,数据量大,删除速度比上一条快,且直接从零开始
--end--
以上只是简单演示SQL语句, 详解请看下篇文章
原文:https://www.cnblogs.com/songhaixing/p/14347037.html