-- 查询由生产厂商B生产的所有产品的型号(model) 和价格(price)。 -- 提示:查询按照pc、laptop和printer的顺序进行。-- union:是连接多个查询的语句-- 还有就是这里的 in () 括号中不可添加为('1006','3002')select model,price from pcwhere model in(select model from product where maker ='B')unionselect model,price from laptopwhere model in(select model from product where maker ='B')unionselect model,price from printerwhere model in(select model from product where maker ='B')
-- 查询在两种或两种以上PC机上出现的硬盘容量。-- 分析:1.先按硬盘容量进行分组-- 2.在将其作为子表-- select hd,count(*) from pc-- group by hd;selecttemp.hdfrom(select hd,count(*)as num from pcgroupby hd)tempwheretemp.num >=2;
4:查询拥有相同速度和内存的PC机的成对的型号 (10 分)
select temp1.model as model1,temp2.model as model2from pc temp1,pc temp2where temp1.speed = temp2.speedand temp1.ram = temp2.ramand temp1.model < temp2.model
5. 查询电影“M3”中的男影星 (10 分)
-- 多表查询 条件是 演员的姓名进行联系两个表-- 然后就是 演员表当中性别为男-- select name-- from StarsIn,MovieStar-- where starName = name-- and gender = 'M'-- and movieTile = 'M3';-- 用到了多行子查讯-- select starName from MovieStar-- where movieTile = 'M3';select namefrom MovieStarwhere name in(select starName from StarsInwhere movieTitle ='M3')and gender ='M';
-- 查询在st1公司于2018年制作的电影中出演的影星。-- 分析:1.查询st1公司2018年制作了哪些电影在movie表当中-- 2.然后在将其上方的查询结果作为子查询 在StarsIn表中-- select title from Movie-- where studioName = 'st1'-- and year = 2018;SELECTDISTINCT starNameFROM StarsInWHERE movieTitle IN(SELECT title FROM MovieWHERE studioName ='st1'ANDYEAR=2018)and movieYear =2018;
public class RadiusBackgroundSpan extends ReplacementSpan {private int mColor;private int mTvColor;private int mTvSize;/*** param color 背景颜色* param tvColor 需要改变文字颜色吗* param tvSize 需要改变文字大小吗*/public RadiusBackgroundSpan(int color, in…
一:题目
现有一份 n m 次投掷单个 六面 骰子的观测数据,骰子的每个面从 1 到 6 编号。观测数据中缺失了 n 份,你手上只拿到剩余 m 次投掷的数据。幸好你有之前计算过的这 n m 次投掷数据的 平均值 。
给你一个长度为 m 的整数数组 rolls …