zoukankan      html  css  js  c++  java
  • 约束查询

    数据库查询语句
           
                 【 一 】
     
    1、检索student2010表中学制(XZ)为年的学生信息
    --select * from student2010 where xz = '2'
     
    
    2、检索course表中学分(credit)小于的所有课程
    --select * from course where credit < '3'
     
    
    3、检索course表中学分(credit)在.5和之间的所有课程
    --select * from course where credit between '2.5' and '4'
     
    
    4、检索course表中学分(credit)小于2.5或大于4的所有课程
    --select * from course where credit not between '2.5' and '4'
     
    
    5、检索student2010表中班级名称(BJMC)为“计算机网络技术班”的学生信息
    --select * from student2010 where BJMC = '2010计算机网络技术班'
     
    
    6、检索stucou表中选了课程编号从005到012的所有记录
    --select * from stucou where couno between '005' and '012'
     
    
    7、检索stucou表中没有选修课程编号从005到012的所有记录
    --select * from stucou where couno not between '005' and '012'
     
    
    8、检索student2010表中和你同一个市的学生信息
    --select * from student2010 where jtdz like '%韶关市'
     
    
    9、检索student2010表中专业名称(ZYMC)为“计算机网络技术”的学生信息,只显示学号、姓名、班级三列
    --select XH,XM,BJMC from student2010  where ZYMC = '计算机网络技术'
     
    
    10、检索student2010表中专业名称(ZYMC)为“计算机网络技术”的学生的学号、姓名字段,字段名用中文显示
    --select XH AS 学号,XM AS 姓名from student2010  where ZYMC = '计算机网络技术'
     
    
    11、检索stucou表中选修了、'004','009','010','015'、及课程的记录
    --select * from stucou where couno in ('004','009','010','015')
     
    
    12、显示student2010表中的所有系部名称(不重复显示)
    --select distinct xymc from student2010
     
    
    13、显示stucou表中所有willorder为1且couno为003的记录
    --select * from stucou where willorder='1' and couno='003'
     
    
    14、检索student表中你的记录行
    --select * from student where stuname = '钟红连'
     
    
    15、检索student表中和你同姓的记录行
    --select * from student where stuname like '钟%'
     
    
    16、显示stucou表中所有willorder为2到4的记录
    --select * from stucou where willorder between '2' and '4'
     
    
    17、显示student表中所有姓张、李、刘的记录
    --select * from student where stuname like '[张,李,刘]%'
     
    
    18、显示student表中所有姓张、李、刘记录的学号、姓名两个字段
    --select stuno,stuname from student where stuname like '[张,李,刘]%'
    
  • 相关阅读:
    绑定对象
    类与对象
    视音频技术干货专栏
    sqlite3把字段为int32(用c++的time(nullptr)获取的)的秒数显示为年月日时分秒
    微信小程序开发 --- 小白之路 --- 心得
    spring cloud --- config 配置中心 [本地、git获取配置文件]
    spring cloud --- Zuul --- 心得
    spring boot --- 注解 @Bean 和@Component
    spring cloud --- Feign --- 心得
    spring cloud --- Ribbon 客户端负载均衡 + RestTemplate + Hystrix 熔断器 [服务保护] ---心得
  • 原文地址:https://www.cnblogs.com/xiaoyumi666/p/6029918.html
Copyright © 2011-2022 走看看