本页的SQL例全部懂了,你的数据库开发所需知识就够用了.doc

本页的SQL例全部懂了,你的数据库开发所需知识就够用了.doc

  1. 1、本文档共13页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
本页的SQL例全部懂了,你的数据库开发所需知识就够用了

本页的SQL例句全部懂了,你的数据库开发所需知识就够用了 Posted on 2011-11-25 23:18 moss_tan_jun 阅读(593) 评论(1) 编辑 收藏 --====================简单的查增删改=学云网-天轰穿-[url][/url]=========== --查看学生表的全部数据 select * from studio? ? --插入一个新的学生信息 insert into studio(st_name,st_sex,st_age,st_add,st_tel) values(黄兰淇,0,36,南充 --查看class全部数据 select * from class --向class表增加两条条数据 insert into class(cl_class,cl_coding,cl_o_time,cl_remark) values(新电实训班,GXA-ncs-001,2008-03-11,都是很优秀的朋友) insert into class(cl_class,cl_coding,cl_o_time) values(阿坝师专实训班,GXA-ABSZ-001,2008-03-11) --更新一条的数据? ?条件的重要性 update class set cl_remark=真的是不错 where cl_id=5 --删除一条数据? ?条件的重要性 delete from class where cl_id=7 --修改列标题 select cl_id as 班级主键,cl_class as 班级名称 from class select 名字=st_name from studio --使用文字串 select 名字是:,st_name from studio --=============条件稍微复杂点的查增删改==学云网-天轰穿-[url][/url]============ --主要涉及到 or and not between in like?? = ! ! != () = =??is null??is not null --查询cl_id 大于 1 的所有信息 select * from class where cl_id1 --使用 or select * from class where cl_id10 or cl_class=百杰一班 --使用and select * from class where cl_id10 and cl_class=百杰一班 --使用like 和 % select * from class where cl_class like 百杰% select * from class where cl_remark like %上午% --使用 between select * from class where cl_id between 3 and 5 --使用 between 配合上 not select * from class where cl_id not between 3 and 5 --使用 is not null select * from class where cl_remark is not null --使用 in? select * from class where cl_class in(千星一班,百杰二班) --=================使用数学运算符=学云网-天轰穿-[url][/url]===================== --主要涉及到 + = * \ --查询Java相关课程分别要上多少周??按照每周5天,每天6节课来计算 select 结果=co_num/5/6 from course where co_name in (Java基础,Java项目入门) --==================使用汇总函数 ===学云网-天轰穿-[url][/url]===================== --涉及到COUNT SUM AVG MAX MIN --查询课时数小于50的课程一共有多少门 select count(*) from course where co_num50 --查询所有课程一共多少课时 select sum(co_num) from course --计算全部课时费,假设每节课50块钱 select sum(co_num)*50 from course --查询课时最少的课程 select min(co_num) from course --查询课时最多的课程 select max(co_num) from c

文档评论(0)

ufh031 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档