补全语句:select vend_id,count(*) from products where prod_price>=10 group by vend_id ____ count(*)>=2;
举一反三
- 统计每个部门中人数的语句是? A: select count(id) from emp order by deptno; B: select sum(id) from emp order by deptno; C: select count(id) from emp group by deptno; D: select sum(id) from emp group by deptno;
- 统计每个部门中的人数的语句是【】。 A: SELECT SUM(ID) FROM examp GROUP BY DE_NUM B: SELECT COUNT(ID) FROM examp ORDER BY DE_NUM C: SELECT COUNT(ID) FROM examp GROUP BY DE_NUM D: SELECT SUM(ID) FROM examp ORDER BY DE_NUM
- 查询选修了2门课程以上的学生学号() A: select sid,count(*) from sc group by sid having count(*)>=2 B: select sid,count(*) from sc group by sid where count(*)>=2 C: select sid,count(*) from sc where count(*)>=2 group by sid D: select sid,count(*) from sc group by cid having count(*)>=2
- 已知用户表 user 有多列,其中字段 id 没有 NULL 值,字段username有NULL值,选项中,不能获得 user 表的总记录数量的 SQL 语句是 A: SELECT COUNT (*) FROM user ; B: SELECT COUNT ( id ) FROM user ; C: SELECT COUNT ( username ) FROM user ; D: SELECT COUNT ( id ) FROM user WHERE 1=1;
- 【单选题】有订单表tb_order,包含用户信息userid, 商品信息goodsid, 以下()语句能够返回至少被购买两次的商品id。 A. SELECT goodsid FROM tb_order WHERE COUNT(goodsid)>1 B. SELECT goodsid FROM tb_order WHERE MAX(goodsid)>1 C. SELECT goodsid FROM tb_order GROUP BY goodsid HAVING COUNT(goodsid)>1 D. SELECT goodsid FROM tb_order WHERE HAVING COUNT(goodsid)>1 GROUP BY goodsid