SELECT category_id, keyword, name, price FROM sh_goods ORDER BY category_id ASC, price DESC; 以上是一条SQL查询语句,用于查询sh_goods表的category_id, keyword, name, price字段,并按照要求排序。 category_id字段按照升序排序(ASC表示升序,默认为升序排序), price字段按照降序排序(DESC表示降序排序...
本题目要求编写SQL语句,结合sh_goods表和sh_goods_category表,查询所有用户评分为5分的商品对应的商品id、商品id、分类id和分类名称和用户评分。注意,查询结果显示字段依据输出样例设置。 提示:以sh_goods表为主表。 表样例 sh_goods表: sh_goods_category表 ...
以下属于行子查询的是( )。 A. SELECT name FROM sh_goods_category WHERE id = (SELECT category_id FROM sh_goods WHERE name='智能手机'); B. SELECT name FROM sh_goods_category WHERE id IN(SELECT category_id FROM sh_goods); C. SELECT id, price, score FROM sh_goods WHERE (price, ...
在下面的存储过程中,参数in是一个输入输出参数。 DELIMITER CREATE PROCEDURE proc(IN sid INT ) BEGIN SELECT id, name FROM sh_goods_category where id > sid; END A、正确 B、错误 点击查看答案
定义视图的查询语句是( ),则向视图添加数据一定会成功。 A. SELECT MAX(pric) FROM sh_goods; B. SELECT category_id FROM sh_goods GROUP BY category_id; C. SELECT id,name FROM sh_goods; D. 以上选项全部正确 相关知识点: 试题来源:
以下SQL语句编写正确的是( )。 A. SELECT * FROM sh_goods WHERE 0; B. SELECT * FROM sh_goods GROUP BY category_id WHERE price >5; C. SELECT * FROM sh_goods LIMIT 3 ORDER BY price; D. 以上选项都不正确 相关知识点: 试题来源: 解析 A ...
以下SQL语句编写正确的是( )。A.SELECT * FROM sh_goods WHERE 0;B.SELECT * FROM sh_goods GROUP BY category_id WHERE price >5;C.SELECT * FROM sh_goods LIMIT 3 ORDER BY price;D.以上选项都不正确相关知识点: 试题来源: 解析 A 反馈 收藏 ...
4、下面在sh_goods表中根据cat_id升序排序,当cat_id相同时按price降序排序的语句是A.SELECT * FROM sh_goods ORDER BY price DESC,cat_id;B.SELECT * FROM sh_goods ORDER BY price ,cat_id;C.SELECT * FROM sh_goods ORDER BY cat_id DESC,price;D.SELECT * F..
定义视图的查询语句是(),则向视图添加数据一定会成功。A.SELEC TMAX(pric)FROM sh_goods; B.SELEC Tcategory_id FROM sh_goods GROUP BY category_id; C.SELEC Tid,name FROM sh_goods; D.以上选项全部正确点击查看答案&解析 <上一题 目录 下一题> ...