加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MySql教程 > 正文

数据库小试题2

发布时间:2020-12-12 00:01:13 所属栏目:MySql教程 来源:网络整理
导读:世纪佳缘网面试题 1.统计每个分类(type)有多少人: select type,count(type) from tab_user group by type; 2.统计五个人的总分(score)是多少: select sum(score) from tab_user; 3.按照分数(score)选出前三名,倒序排列: select * from `tab_user`

世纪佳缘网面试题

1.统计每个分类(type)有多少人:

select type,count(type) from tab_user group by type;

2.统计五个人的总分(score)是多少:

select sum(score) from tab_user;

3.按照分数(score)选出前三名,倒序排列:

select * from `tab_user` order by score desc limit 3;

4.插入数据:小明(name),4(type),30(score);

insert into `tab_user` (name,type,score) values ('小明','4','30');

5.更新50分一下(不含50分)的分数(score)为60;

update `tab_user` set score = 60 where score

6.删除分数(score)60分一下的数据。

DELETE from `tab_user` where score

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读