zoukankan      html  css  js  c++  java
  • MySQL数据库(查询语句)

    用户  角色  权限 

    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 :查出一个最高分

  • 相关阅读:
    回车代码兼容火狐浏览器
    js区分浏览器类型
    阶段总结(2014-07-23)
    Spring学习笔记 2014-7-9
    Maven学习笔记
    QQ协议的研究
    模仿微信打飞机做的程序
    滚动字幕
    13年8月15日阿里云服务器网络故障事件
    [转]程序员自己写的神器 MonoDevelop 4 (Xamarin Studio) Debugging for Unity
  • 原文地址:https://www.cnblogs.com/awdsjk/p/9481274.html
Copyright © 2011-2022 走看看