博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Mysql 语句
阅读量:4602 次
发布时间:2019-06-09

本文共 1631 字,大约阅读时间需要 5 分钟。

1 show databases; 2 create database first; 3 drop database first; 4 use example; 5 create table example0( 6  id int primary key auto_increment, 7  name varchar(20) 8  ); 9 show tables;10 describe example0;11 show create table example1 \G12 primary key,13 14 constraint c_fk foreign key(stu_id,course_id) references exma2(stu_id,course_id)15 16 unique17 math float default 018 19 alter table ex0 rename ex1;20 alter table ex0 modify sex int(4);21 alter table ex0 change id stu_id int;22 alter table ex0 add age int not null;23 alter table ex0 add id int primary key first;24 alter table ex0 add address varchar(30) not null after name;25 alter table ex0 drop sex;26 alter table ex0 modify address varchar(30) after name;27 alter table ex0 modify address varchar(30) first;28 alter table ex0 drop foreign key c_fk;29 drop table ex0;30 31 insert into 表名 values(, , , );32 33 select * from 表名;34 select * from 表名 where id in(1000,1001);35 select * from 表名 where age between 18 and 20;36 select * from biao where name like "李明";37 select * from biao where name like "李%";38 select * from biao where name like "%李%";39 select * from b where name like "李_";40 select * from b where name not like "李%";41 select * from ex0 order by id asc;42 select * from ex0 order by age desc;43 select avg(math),avg(English),avg(sum) from a1;44 select id,name,max(sum) from a1;45 select id,name,sex,max(sum) from a1 group by sex;46 47 update tab_name set col_name1="",col_name2=" " where name="" order by 48 update tab_name set sum=math+English;49 50 delete tab_name from tab_name where id=1005;

 

转载于:https://www.cnblogs.com/jxust-jiege666/p/7153811.html

你可能感兴趣的文章
Jmeter测试dubbo接口填坑
查看>>
python小练——找出指定目录下小于指定字节的文件,输出到文本文件
查看>>
渐渐磨砺--16年11月封闭总结
查看>>
[zz]GDB调试精粹及使用实例
查看>>
数据库的创建和删除
查看>>
最简单的三层实例【插入据
查看>>
设计模式学习笔记——Prototype原型模式
查看>>
pom.xml里有红叉报错的解决办法
查看>>
Perl last和next的用法区别
查看>>
Selenium 管理 Cookies
查看>>
exceptionfunction[LeetCode]Permutations
查看>>
Linux(2)_常用命令2
查看>>
自定义分页
查看>>
[转]DELPHI——调试(1)
查看>>
JS秒数转成分秒时间格式
查看>>
xp_cmdshell 命令的开启与关闭,和状态查询
查看>>
Linux sudoers
查看>>
MySQL详解(18)-----------分页方法总结
查看>>
bzoj 4595 激光发生器
查看>>
multi cookie & read bug
查看>>