用户  角色  权限

select * from students1;查询这个表里的数据

select ssex from students1;在这个表里面查询ssex(性别)

select distinct from students1;在这个表里面查出来的ssex(性别)去重重复行

update students1 set sname='李军1' where sname='李军';  在students1这个表里把 李军 改为 李军1

select  * from  students1 where ssex='女'  or sname='李军1';   在students1这个表里面查询性别女的有多少,另外查处李军1这个人来

select * from score where degree between 70 and 80; 在这个成绩表里查询成绩 70到80之间有哪些?

select * from student group by ssex;  对这个表里的性别进行分组查看

insert into student (sno,sname,ssex) values ('110','王远远','男');  往表里手动添加一个字段属

性。

select con,max(degree) from score group by con; 查看这个成绩表最大的值有哪些!

select con, count(*) from score group by con;

select con, count(*) from score group by con having count(*)>5;

select degree from score order by degree;从小到大排序

select degree from score order by degree desc ;从大到小排序

显示表的创建语句: show  create  table  表名;

alter  table 表名 modify ssex varchar(20)null;修改表里面的属性

select degree from score order by degree limit 3; 取出3个行数,从0开始

select * from student where sname like '李_';  模糊查找,从这个学会表里查找姓李的人有哪些?

select  max(degree) from score :查出一个最高分

MySQL数据库(查询语句)的更多相关文章

  1. MySQL 数据库 查询语句的基本操作,单表查询,多表查询

    1.查询语句的基本操作 - select - from - where - group by - having - distinct - order by - limit - 聚合函数: count, ...

  2. MySQL数据库 : 查询语句,连接查询及外键约束

    查询指定字段        select 字段1,字段2 from 表名; 消除重复行(重复指的是结果集中的所有完全重复行)             select distinct 字段1,字段2.. ...

  3. 23个MySQL常用查询语句

    23个MySQL常用查询语句 一查询数值型数据: SELECT * FROM tb_name WHERE sum > 100; 查询谓词:>,=,<,<>,!=,!> ...

  4. 提高MySQL数据库查询效率的几个技巧(转载)

    [size=5][color=Red]提高MySQL数据库查询效率的几个技巧(转)[/color][/size]      MySQL由于它本身的小巧和操作的高效, 在数据库应用中越来越多的被采用.我 ...

  5. (转载)常用的Mysql数据库操作语句大全

    打开CMD,进入数据库命令:mysql -hlocalhost -uroot -p 退出数据库:exit 用户管理: 1.新建用户: >CREATE USER name IDENTIFIED B ...

  6. MySQL 表查询语句练习题

    MySQL 表查询语句练习题: 一.  设有一数据库,包括四个表:学生表(Student).课程表(Course).成绩表(Score)以及教师信息表(Teacher).四个表的结构分别如表1-1的表 ...

  7. MySQL 数据库SQL语句——高阶版本2

    MySQL 数据库SQL语句--高阶版本2 实验准备 数据库表配置: mysql -uroot -p show databases; create database train_ticket; use ...

  8. MySQL 数据库SQL语句——高阶版本1

    MySQL 数据库SQL语句--高阶版本 实验准备,数据表配置 mysql -uroot -p show databases; create database train_ticket; use tr ...

  9. mysql数据库查询pdo的用法

    最早的php对mysql数据库查询是mysql和mysqli方法,后来php的新版本进一步封住了该方法,于是又pdo,抛开php框架,使用pdo查询数据,使用也是相当简便 <?php ini_s ...

  10. 数据库查询语句报错-ORA-00911: invalid character

    数据库查询语句报错-ORA-00911: invalid character 根据自己经验总结下: 1.都是分号惹的祸,有时候sql语句后面有分好导致这种错误 2.还有一种是从别处copy过来的sql ...

随机推荐

  1. [Vuex] Lazy Load a Vuex Module at Runtime using TypeScript

    Sometimes we need to create modules at runtime, for example depending on a condition. We could even ...

  2. JSP简单练习-猜字母游戏

    <!-- guessCharExample.jsp --> <%@ page contentType="text/html; charset=gb2312" %& ...

  3. easyui textbox 获取焦点

    function Admin_ListAdd() { $('#ListInfo').css({ display: "inherit" }); $("#Department ...

  4. php5.6.11编译安装报错configure: error: Don't know how to define struct flock on this system

    centos 6.8 32位系统下,安装php.5.6.11是出现这个错误 解决办法: 1 2 3 4 vim /etc/ld.so.conf.d/local.conf     # 编辑库文件 /us ...

  5. 构建自己的 Smart Life 私有云(一)-> 破解涂鸦智能插座

    博客搬迁至https://blog.wangjiegulu.com RSS订阅:https://blog.wangjiegulu.com/feed.xml 原文链接:https://blog.wang ...

  6. 超简单的okHttpUtils封装(下)

      版权声明:转载请注明出处:http://blog.csdn.net/piaomiao8179 https://blog.csdn.net/piaomiao8179/article/details/ ...

  7. java maven通过SMTP发送QQ邮件的完全步骤

    1.首先打开QQ邮箱的SMTP服务,因为QQ邮箱对于一般的用户都是默认关闭SMTP服务的. 找到SMTP服务的选项,可以看到此处默认是关闭的,点击开启,然后腾讯会进行一些身份验证,身份验证通过以后,腾 ...

  8. 模拟真实点击click,专门对付clickoutside

    var evmousedown = document.createEvent('HTMLEvents'); // evmousedown.clientX = 88 // evmousedown.cli ...

  9. SQL获取当前时间月份为两位数

    --获取当前时间月份为两位数 )),) --获取当前时间上月月份为两位数 , )),)

  10. https认证握手过程