当前位置: 首页 > news >正文

公司网站微信平台建设的好处网络seo优化

公司网站微信平台建设的好处,网络seo优化,网站建设全程揭秘光盘文件,网站设计排名北京例题: 创建如下两张表 分别命名为books和persons (1)按照书名,姓名的顺序列出字里包含‘德’字的人物的姓名,书名和字。 select name 姓名,bookname 书名,style 字 from books,persons where style like %德% and bo…

例题:

创建如下两张表 分别命名为books和persons

 

(1)按照书名,姓名的顺序列出字里包含‘德’字的人物的姓名,书名和字。

select name 姓名,bookname 书名,style 字
from books,persons
where style like '%德%'
and books.bookid = persons.bookid
order by 2,1;

order by 2,1:先按照书名排序,书名相同再按照姓名排序:一般是按照首字母排序

 

(2)哪本书中的人物姓名包含最多‘悟’字?
第一种表示方法:

select bookname 书名
from books,persons
where persons.bookid=books.bookid
and name like '%悟%'
group by bookname
having count(books.bookid)=(select top 1 count(bookid)
from persons
where name like '%悟%'
order by count(bookid) desc)

第二种表示方法:

select bookname 书名 from books
where bookid in(
select bookid from persons
where name like'%悟%’
group by bookid
having count(*) =(
select top (1) count(*) from persons
where name like'%悟%’
group by bookid
order by 1 desc))

count(字段)和count(*)的区别:

count(*) 是统计行数,

count(字段) 是统计字段列非null的行数

在查询字段非null时,两者的查询结果是一样的

补充:

count(1)也是统计行数

对于count(1)和count(*)返回的结果是一样的,但是两者的效率在不同的情况下不同:

如果表中没有主键 ,使用count(1)比count(*)快;

如果有主键,那么count(主键)最快

详细的内容,推荐这篇:http://t.csdn.cn/AiVUl

(3)人物最多的书的男性人物的姓名和字是什么

select name 姓名,style 字
from persons
where sex='男'
and bookid in(select bookid from persons
group by bookid 
having count(bookid) =(select top 1 count(bookid) from persons
group by bookid
order by count(bookid) desc))

 

(4)哪本书的人物姓名都是三个字的

select bookname 书名
from books
where bookid not in(select bookid from persons
where name not in(select name from persons where len(name)=3))

(5)女性人物最多的书是哪个朝代的

select dynasty 朝代
from books
where bookid in (
select bookid from persons
where sex ='女’
group by bookid
having count(*)=(
select top(1) count(*) from persons
where sex='女
group by bookid
order by 1 desc

 

 

(6)与唐僧在同一本书的女性人物是谁?

select name 姓名 from books,persons
where books.bookid in(select books bookid from books,persons
where books.bookid=persons.bookid
and name ='唐僧')
and books.bookid=persons.bookid
and sex='女';

(7) 有女性人物但是女性人物最少的书:

select distinct bookname书名,author作者
from books.persons
where books.bookid=persons.bookid
and books.bookid in 
select bookid from persons
where sex ='女'
group by bookid
having count(*) =(
select top(1) count(*)
from persons
where sex='女'
group by bookid
order by 1 asc))

 

http://www.jinmujx.cn/news/112435.html

相关文章:

  • 做国外网站的站长免费建立网站
  • 淘宝网站可以做seo吗成都seo技术
  • 做网站那个平台重庆seo公司排名
  • 网站搭建中114514手机建站教程
  • 网站规划与建设策划书网络运营培训课程
  • 网站宣传册怎么做的百度营销推广登录
  • 炫富做图网站线下推广的渠道和方法
  • 网站开发拖延交货算诈骗吗广告搜索引擎
  • 天津狐臭在哪里做津门网站I电商大数据查询平台
  • 做付费动漫网站百度云盘网页登录入口
  • 建设小型网站价钱网站建网站建设网站
  • 郑州网站建设乛汉狮网络全网营销与seo
  • 学生做网站专业黑帽seo
  • 中卫网站设计公司有哪些株洲seo
  • 中小企业网站提供了什么湖南seo优化服务
  • 怎么做点播网站巨量千川广告投放平台
  • 南川网站制作国内最新新闻消息今天的
  • 网站banner尺寸电商网站对比表格
  • 徐州旅游的网站建设一键搭建网站
  • 做企业网站好处国内网站排名
  • 怎样说服公司做网站平台推广引流怎么做
  • 有实力高端网站设计地址营销咨询公司
  • 怎么做网站专题武汉做seo公司
  • 购物网站开发问题微博营销
  • 模板网站和定制网站后缀的区别seo网站关键词优化价格
  • 郑州做网站建设公司哪家好国际新闻 军事
  • 武汉app网站建设农产品网络营销策划书
  • 电脑网站拦截怎么解除浏览器正能量网站免费
  • 天元集团第一建筑公司绍兴seo网站推广
  • 厦门网站建设公司闽icpseo百度网站排名研究中心关键词首页优化