[出个Sql面试题!]--总体情况 SELECT a.ID, COUNT(*) AS 总数, SUM(CASE b.STYLE WHEN 0 THEN 1 ELSE 0 END ) AS 过关数, SUM(CASE b.STYLE WHEN 1 THEN 1 ELSE 0 END ) AS 未过关数 from a, b...+阅读
1.SELECT s.SNO,SNAME FROM S s,SC sc WHERE s.SNO=sc.SNO AND sc.CNO IN(SELECT CNO FROM C WHERE TNO= (SELECT TNO FROM T WHERE)); 2.SELECT SNO FROM SC WHERE CNO IN('C2','C4'); 3.SELECT s.SNO FROM SC s,SC sc WHERE s.SNO=sc.SNO AND s.CNO = 'C2' AND sc.CNO ='C4'; 4.SELECT SNAME,AGE FROM S WHERE SNO IN (SELECT SNO FROM SC WHERE CNO'C2')
延伸阅读:
SQL面试题。帮忙解答。谢谢(1): select 姓名,科目,成绩 from t表 a where not exists(select * from t表 b where b.成绩 (2): delete from t表 where id not in( select id from t表 a where id in(selec...
SQL语句面试题恩,通过自定义函数吧。。 实现如下: ----创建自定义函数 create function F_Getvarchar(a1 int) returns varchar(8000) as Begin declare a2 varchar(100),Newvarhar varchar...
有关SQL的面试题。。1: 〔车辆〕、〔站台〕、〔行车路线〕最少3个表 〔车辆〕表字段〔ID〕,〔名称〕 〔站台〕表字段〔ID〕,〔名称〕,〔描述〕 〔行车路线〕表字段〔ID〕,〔车ID〕,〔站ID〕 查询: SEL...
求sql语句怎么写金蝶面试题 MySQL大家论坛第一个select sum(FSAL) as salary from table1 where year(FDATE)=year(now()) and FNAME=\'张三\';第二个select sum(FSAL),sum(FSAL)/52/count(DISTINCT FID),sum(FSAL)/1...
数据库SQL查询语句面试题5.1 select a.username,b.deptname from users a,dept b where a.dept_id=b.id; 5.2 update users set dept_id='9' where dept_id='2'; 5.3 select a.deptname,b.count_id...
急求Sql Server数据库SQL语句面试题What are two methods of retrieving SQL? What cursor type do you use to retrieve multiple recordsets? What is the difference between a “where” clause and a “h...
SQL面试题求答案指定学科查询: select Name from Student where Curricula ='指定学科' and mark >60 不指定学科,按照学科排序 select Curricula,Name from Student where mark >60 order by...
oracle sql面试题求助--1 select max(sal) ,min(sal) from emp group by deptno; --2 select max(sal) ,min(sal) from emp where group by deptno; --3 select deptno,max(sal) ,min(sal) from...
oracle面试题一个SQL语句求解SQL code--举例如下SQL>delete emp 2wherenotexists (select1from3 (select rownum rn,empno from emp) t 4where t.empno=emp.empno and t.rn in(2,5));已删除12行。SQL>sele...