数据库 P3306
create database [if not exists] db_name [characterset gbk];
use database;//跳转数据库
show databases;
alert database db_name character set utf8;//修改
drop databases [ if not exists] dbname ;//最有用的
show create databses dbname;
表
create table [i n e] tbname(
id smallint unsigned primarykey auto_increment,
name varchar(10) not null,
);
not null非空 auto_increment自增 primary key unique key 唯一约束
default ' '
describe[desc] stu;
show tables;
show create table tbname;
alert table users1 add age tinyint unsigned not null default 10;
alert table tbname add colname coldef,...//添加多列
alert table tbname add password varchar(32) not null after username//在username后添加
alert table tbname add truename varchar(10) not null first//最前
alert table tbname drop password,drop age;//删除多列
int tinyint decimal(legth,dec) text char varchar //数据类型
增
insert into tbname(collist) values(val)
删
delete from tbname where name=xx;
更
update tbname set col='' where xx=xx;
查
select colname from tbname where ...... order by colname asc默认|desc降序 limit 3,2
and并且 or或者 not
min max sum avg count()
相关文章
- C语言学习笔记--函数
- C语言学习笔记--函数与指针
- WNMP环境搭建步骤 nginx1.4.3+php-5.3.27+mysql-5.5+RunHiddenConsole
- Mysql5.7自定义函数递归报错1424 Recursive stored functions and triggers are not allowed
- 有关使用phpstudy搭建sqli-lab环境搭建时发生Uncaught Error: Call to undefined function mysql_connect()错误
- Huffman Tree (哈夫曼树学习)
- C,C++网络编程学习简明指南
- mysql if()
- mysql错误一例:ERROR 1030 (HY000): Got error 28 from storage engine
- Linux学习之在搭建java开发环境