zoukankan      html  css  js  c++  java
  • 2017-11-2

     今天学习了下mysql数据库,学习起来真的很吃力啊。好多东西当时感觉理解了 会了,过上几个小时就有模糊了,而且这个真的要英语功底啊。报个错不知道啥意思,写几个英语单词还出错,检查好几遍都查不到。

    像  查询Student表中的所有记录的Sname、Ssex和Class列     其实很简单的东西  就是select Sname,Ssex,Class from Student;  但是这几个单词打起来也是麻烦  而且这么简单的操作 或许上午学习了 下午就有可能忘掉。还是多几下把。

    简单记一下吧 :

    1、 查询Student表中的所有记录的Sname、Ssex和Class列。 

          select Sname,Ssex,Class from Student  

    2、 查询教师所有的单位即不重复的Depart列。

           select distinct Depart from Teacher

    3、 查询Student表的所有记录。

         select * from Student
     

    4、 查询Score表中成绩在60到80之间的所有记录并按成绩顺序排列。

    select * from Score where Degree >=60 and Degree <=80 order by Degree
    select * from Score where Degree between 60 and 80 order by Degree

    5、 查询Score表中成绩为85,86或88的记录。

    select * from Score where Degree in (85,86,88)

    6、 查询Student表中“95031”班或性别为“女”的同学记录。

    select * from Student where Class =95031 or Ssex ='女'

    7、 以Class降序查询Student表的所有记录。

    select * from Student order by Class desc  

    8、 以Cno升序、Degree降序查询Score表的所有记录。

    select * from Score order by Cno,Degree desc

  • 相关阅读:
    GCD的常用代码块
    多用字面量语法,少用与之等价的方法
    新建项目上下出现黑色块
    按钮UIButton的使用
    集成支付宝
    app生命周期之即将关闭
    苹果开发者计划申请材料准备(公司级)
    真机调试的一些问题记录~更新中
    iOS开发架构学习记录
    用枚举值表示状态、选项、状态码
  • 原文地址:https://www.cnblogs.com/dongweichang/p/7775243.html
Copyright © 2011-2022 走看看