展开

关键词

hadoopjournalns: NameNode has clusterId ‘CID-b82’ but storage has clusterId ‘CID-657

@ubuntu:~/hadoop/hadoop/name/current #Fri Mar 30 00:14:41 PDT 2018 namespaceID=695608861 clusterID=CID home/xiaoye/hadoop/journal/ns: NameNode has clusterId ‘CID-b824b399-e941-4982-a618-745373 9d3d55′ but storage has clusterId ‘CID-657e9540-2de9-43a2-bf91-199a4334b05a’ 于是还是修改上面的VERSION文件,把clusterId的值改成 storage

7330

数据库总结.

(1) from SC where CID = m.CID) as decimal(18,2)) 优秀率 from Course m , SC n where m.CID = n.CID group ) from SC where CID = m.CID) 最高分 ,   (select min(score) from SC where CID = m.CID) 最低分 ,   (select where CID = m.CID and score >= 60)*100.0 / (select count(1) from SC where CID = m.CID) as decimal(18,2 CID = m.CID and score >= 80 and score < 90 )*100.0 / (select count(1) from SC where CID = m.CID) as (1) from SC where CID = m.CID and score >= 85)*100.0 / (select count(1) from SC where CID = m.CID) as

517160
  • 广告
    关闭

    【玩转 Cloud Studio】有奖调研征文,千元豪礼等你拿!

    想听听你玩转的独门秘籍,更有机械键盘、鹅厂公仔、CODING 定制公仔等你来拿!

  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    互联网经典SQL面试题及答案解析

    SC(SId,CId,score) --SId 学生编号,CId 课程编号,score 分数 题目 1、查询“01”课程比“02”课程成绩高的所有学生的学号; 2、查询平均成绩大于60分的同学的学号和平均成绩 having count(if(cid='01',score,null))>0 and count(if(cid='02',score,null))>0 )t left join ),sid from sc group by sid having count(cid) < (select count(distinct cid) from =sc.cid group by sc.sid having count(distinct sc.cid)= (select count(distinct cid) from =course.cid group by sc.cid 19、按各科平均成绩从低到高和及格率的百分数从高到低顺序 #这里先按照平均成绩排序,再按照及格百分数排序,题目有点奇怪 select cid

    79720

    Typecho实现文章点赞功能

    请求: if (isset($_POST['agree'])) { // 判断 POST 请求中的 cid 是否是本篇文章的 cid if ($_POST['agree'] == $this ->cid) { // 调用点赞函数,传入文章的 cid,然后通过 exit 输出点赞数量 exit( strval(agree($this->cid)) ); } // 如果点赞的文章 cid 不是本篇文章的 cid 就输出 error 不再往下执行 exit('error'); } 接下来在该页面加入点赞按钮(按钮样式自行修改): <? > type="button" id="agree" data-cid="<?php echo $this->cid; ?>" data-url="<? ,直接获取点赞按钮的 cid 属性 data: 'agree=' + $('#agree').attr('data-cid'), async: true, timeout

    30731

    协程取消 API 的示例代码

    socket = new Socket(AF_INET, SOCK_DGRAM, 0); $socket->bind('127.0.0.1', 9601); // server $cid = Coroutine::getCid(); Event::defer(function () use ($cid) { assert(Coroutine::cancel($cid = Coroutine::getCid(); go(function () use ($cid) { System::sleep(0.002); assert( = Coroutine::getCid(); go(function () use ($cid) { System::sleep(0.002); assert( Coroutine::cancel($cid) === true); }); $retval = System::waitSignal(SIGTERM); echo "Done\

    14330

    SQL数据库面试题以及答案(50例题)

    : update sc set score = (select avg(sc_2.score) from sc sc_2 where sc_2.cid = sc.cid) where cid in (cid) from sc where sid='1002'); select a.sid,s.sname from (select sid,GROUP_CONCAT(cid order by cid t where l.cid = t.cid group by t.cid) and r.score = (select min(t.score) from sc t where r.cid = t.cid sc_1.score)<=2 order by sc_1.cid ); 26、查询每门课程被选修的学生数: select cid, count(sid) from sc group by cid; from sc sc_1 where sc.cid = sc_1.cid); 41、查询各个课程及相应的选修人数: select cid,count(*) from sc group by cid

    1.4K10

    sql练习学生成绩查询实践

    ,score from sc where sc.CId='01') as t1, (select sid,cid,score from sc where sc.CId='02')as t2 where a.cid=b.cid and a.score<b.score group by a.cid,a.sid,a.score order by a.cid,rank asc; 15.1 按各科成绩进行排序 left join sc as b on a.cid=b.cid and a.score<b.score group by a.cid,a.sid,a.score order by a.cid =course.cid group by sc.cid; 查询各科成绩前三名的记录 select * from sc as a left join sc as b on a.cid=b.cid and ,course.Cname,avg(score)as ss from sc,course where sc.cid=course.cid group by cid order by ss desc,sc.cid

    4720

    堪称经典的50道SQL题

    ,Tid)课程表 Cid:课程编号 Cname:课程名称 Tid:教师编号 SC(Sid,Cid,score)成绩表 Sid:学号 Cid:课程编号 score:成绩 Teacher(Tid,Tname =(Select Avg(s2_Score) From sc s2 Where s2.Cid=sc.Cid) Where Cid IN (Select Cid From sc cs INNER JOIN (IR.score) from sc as IR where R.Cid=IR.Cid group by IR.Cid); 19、按各科平均成绩从低到高和及格率的百分数从高到低顺序: SELECT t.Cid sc where t1.Cid=Cid order by score desc) order by t1.Cid; 44、统计每门课程的学生选修人数(超过10人的课程才统计)。 、查询全部学生选修的课程和课程号和课程名: select Cid ,cname from course where Cid in (select Cid from sc group by Cid);

    1K20

    MySQL实战四:查询再续

    AS '优秀率' FROM SC sc JOIN Course c ON sc.CId = c.CId GROUP BY sc.CId ORDER BY COUNT(sc.CId) DESC, = Course.CId GROUP BY sc.CId; 查询各科成绩前三名的记录 mysql> select * from SC sc -> where (select count(*) from SC as a -> where sc.CId= a.CId and sc.score<a.score )< 3 -> order by CId asc, sc.score ,a.score from SC as a left join SC as b on a.CId=b.CId and a.score<b.score group by a.CId asc,a.SId,a.score desc having count(b.cid)<2 order by a.CId; +-----+-----+-------+ | SId | CId | score | +-----+-----+

    26360

    sqlzoo练习19

    SQL练习-题目 查询001课程比002课程成绩高的所有学生的学号 需要用到的表:SC select a.Sid from (select Sid, score from SC where Cid group by Sid having count(SC.Cid)=(select count(Cid) , Cname from Course where Cid in (select Cid -- 通过分组的方式选择出Cid from SC group and a.Cid <>b.Cid; 查询和1002号的同学学习的课程完全相同的其他同学学号和姓名 select Sid from SC where Cid in (select Cid from SC =Cid order by Score desc); 查询只选修1门课程的全部学生的学号和姓名 select SC.Sid, Student.Sname, count(Cid

    13620

    50道SQL练习题

    =course.cid group by sc.cid 14.2要求输出课程号和选修人数,查询结果按人数降序排列,若人数相同,按课程号升序排列 多条件排序 select cid,count(1) from and tb1.cid=tb2.cid group by tb1.cid,tb1.sid order by cid,rank asc; 15.1 按各科成绩进行排序,并显示排名, Score 重复时合并名次 select a.sid,a.cid,a.score from sc a left join sc b on a.cid = b.cid and a.score<b.score group by a.cid , a.sid having count(b.cid)<3 order by a.cid; 19.查询每门课程被选修的学生数 select cid, count(sid) from sc group select sc.cid,count(1) from course left join sc on course.cid=sc.cid group by sc.cid having count(1)>

    10510

    mysql的一些常用操作(二)

    select course.cname '课程名称',count(*) '人数' from score,course where score.CId=course.CId group by score.CId =b.cid group by a.cid having count(*)>5; ? =c.cid; ? =b.cid and a.scoreore=b.scoreore group by a.cid,b.cid; ? a left join score b on a.cid=b.cid and a.scoreore<b.scoreore GROUP BY a.cid,a.sid order by a.cid

    22840

    【数据库】MySQL经典面试题(练习)

    into course(cid,cName,tid) values ('004','数据库',1); insert into course(cid,cName,tid) values ('005',' s, (SELECT sid,COUNT(cid) FROM sc WHERE cid IN ('001','002') GROUP BY sid HAVING COUNT(cid)>=2) t WHERE c.cid)sc_2 SET sc.score = sc_2.avgs WHERE sc.cid = sc_2.cid 14、查询和“1002”号的同学学习的课程完全相同的其他同学学号和姓名; select sc.cid FROM course c ,teacher t WHERE sc.cid = c.cid AND c.tid = t.tid AND t.tName = '叶平') 17、按平均成绩从高到低显示所有学生的 =Course.cid GROUP BY SC.cid,Cname; 26、查询每门课程被选修的学生数 select cid,count(sid) from sc group by cid;

    93860

    java 实现平层数组转换为层级对象

    sql insert into tb_tree (CID, CNAME, PID) values (1, '中国', 0); insert into tb_tree (CID, CNAME, PID) (CID, CNAME, PID) values (4, '上海市', 1); insert into tb_tree (CID, CNAME, PID) values (5, '广州市', 3); insert into tb_tree (CID, CNAME, PID) values (6, '深圳市', 3); insert into tb_tree (CID, CNAME, PID) values (7, '海珠区', 5); insert into tb_tree (CID, CNAME, PID) values (8, '天河区', 5); insert into tb_tree (CID, //根据cid获取节点对象(SELECT * FROM tb_tree t WHERE t.cid=?)

    63520

    Hive案例05-学生成绩表综合案例

    , avg(score) from sc where cid = '1' group by cid; <3> 查询各科成绩平均分 select c.cname, tmp.avg_score from course c join (select cid, avg(score) avg_score from sc group by cid) tmp on c.cid = tmp.cid; /* Chinese , max(score) max_score from sc where cid = '1' group by cid; /* 1 98 */ <5> 求各个课程号及相应的选课人数 select cid, count(distinct sid) count_sid from sc group by cid; /* 1 15 2 15 3 13 4 16 5 12 6 11 */ <6> 查询选修了3门以上的课程的学生学号 select sid, count(distinct cid) count_cid from sc group by sid having count_cid

    81640

    mysql经典50道练习题

    (1) from SC where CID = m.CID) as decimal(18,2)) 中等率 , cast((select count(1) from SC where CID = m.CID SC where CID = m.CID) as decimal(18,2)) 优秀率 from Course m , SC n where m.CID = n.CID group by m.CID CID = m.CID) 最高分 , (select min(score) from SC where CID = m.CID) 最低分 , (select cast(avg(score) as decimal(18,2)) from SC where CID = m.CID) 平均分 , cast((select count(1) from SC where CID = m.CID and where CID = m.CID) as decimal(18,2)) 中等率 , cast((select count(1) from SC where CID = m.CID and score

    6630

    MySQL 系列教程之(十四)50 道 SQL 练习题精讲

    END) / count(SC.CId) as '优秀率' from SC,Course as C where SC.CId = C.CId group by SC.CId,C.Cname order *,s2.* from (select cid,round(avg(score),2) as avg_sc from sc group by cid) as s1 join (select cid,round cid) as s1 join (select cid,round(avg(score),2) as avg_sc from sc group by cid) as s2 on s1.avg_sc = Course.CId group by Course.CId,Course.Cname; 23.查询各科成绩前三名的记录 (select CId,score from SC where CId = ,max(score) m from sc group by cid) c on b.cid=c.cid and b.score=c.m; 40.查询不同课程成绩相同的学生的学生编号、课程编号、学生成绩

    45.9K43

    MySQL实战上车,Github仓库Star起来

    ,Cname,TId) CId 课程编号,Cname 课程名称,TId 教师编号 教师表 Teacher(TId,Tname) TId 教师编号,Tname 教师姓名 成绩表 SC(SId,CId,score *,sc.score from Student s,Course c,SC sc where c.CId='01' and s.SId=sc.SId and c.CId=sc.CId; +-----+- *,sc.score from SC sc join Student s on sc.SId=s.SId join Course c on sc.CId=c.CId where c.CId='01'; Student s ON sc.SId = s.SId JOIN Course c ON sc.CId = c.CId WHERE c.CId = '02' sc.CId='02') s2 where s1.SId=s2.SId; +-----+-----+-------+-----+----------+ | SId | CId | score | CId

    31820

    SQL | 44道经典 SQL 笔试题与答案解析

    ,CId,score) --SId 学生编号,CId 课程编号,score 分数 1. =sc.cid group by sc.sid having count(distinct sc.cid)= (select count(distinct cid) from =course.cid group by sc.cid 19. =course.cid group by sc.cid,cname 24. cid) from sc) 40.

    2.3K20

    【数据库】MySQL经典面试题二(练习)

    (1) from SC where CID = m.CID) as decimal(18,2)) 优秀率 from Course m , SC n where m.CID = n.CID group SC where CID = m.CID) 最高分 , (select min(score) from SC where CID = m.CID) 最低分 , (select cast(avg = Course.CID group by Course.CID , Course.Cname order by Course.CID --纵向显示1(显示存在的分数段) select m.CID (1) from SC where CID = m.CID and score >= 85)*100.0 / (select count(1) from SC where CID = m.CID) as = m.CID) as decimal(18,2)) 百分比 from Course m , sc n where m.CID = n.CID group by m.CID , m.Cname

    6.3K70

    扫码关注腾讯云开发者

    领取腾讯云代金券