[编程面试题求解]我没学过c#,我写过一个c语言的。你参考改下语言吧·应该很简单的,我用的是递归。输出结果表示每一步走几个台阶。 #include<stdio.h> int place[200]={0}; int n=1; void zuh...+阅读
sql面试题求解
方法1:Select * from p a where not exists(select 1 from p where phone=a.phone and calltime>a.calltime)方法2:select a.* from p a join (select max(calltime)calltime,phone from p group by phone) b on a.phone=b.phone and a.ID=b.ID order by calltime方法3:select * from p a where ID=(select max(ID) from p where phone=a.phone) order by calltime方法4:select a.* from p a join p b on a.phone=b.phone and a.calltimea.calltime)=0方法7:select * from p a where calltime=(select top 1 calltime from p where phone=a.phone order by calltime desc)方法8:select * from p a where calltime!
数据库面试题:
1. create database aaa; 2. create table users(id int NOT NULL AUTO_INCREMENT, user_name char(10),money char(10),add_time datetime PRIMARY KEY (`id`))ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; 3.insert into users values(2,'a1','a11',current_date),(3,'a1','a11',current_date),(4,'a1','a11',current_date),(5,'a1','a11',current_date),(6,'a1','a11',current_date),(7,'a1','a11',current_date),(8,'a1','a11',current_date),(9,'a1','a11',current_date),(10,'a1','a11',current_date),(11,'a1','a11',current_date); 4.参考第二步 5.参考第三步 6.select a.username,a.money,b.email,b.user_phone,b.weigh from users a,user_info b where a.id=b.id and a.id=XXX(你指定的); 7.mysqldump -uroot -p aaa >/tmp/aaa.sql (需要输入密码) 我用的是mysql上的写法
求sql语句怎么写金蝶面试题
兄弟,不知道你这道题出的是什么意思?是在有数据的一张表中完成你的题目要求吗?还有你的薪水的数据类型怎么会是flaot?应该是float哦哦~~~~~
1:select sun(FSAL) from table1 where FNAME is zhangsan;
2: select FNAME , avg(FSAL) from table group by (周薪,月薪,年薪);
3:select FNAME from table1 group by <;月薪 > having avg(月薪) >600 and avg(月薪)<800 or avg(月薪) =600 or avg(月薪)=800;
我用的是oracle,不知道蛮不满足你的要求
急求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 “having” clause? - “Where” is a kind of restiriction statement. You use where clause to restrict all the data from DB.Where clause is using before result retrieving. But Having clause is using after retrieving the data.Having clause is a kind of filtering command. What is the basic form of a SQL statement to read data out of a table? The basic form to read data out of table is 'SELECT * FROM table_name; ' An answer: 'SELECT * FROM table_name WHERE xyz= 'whatever';' cannot be called basic form because of WHERE clause. What structure can you implement for the database to speed up table reads? - Follow the rules of DB tuning we have to: 1] properly use indexes ( different types of indexes) 2] properly locate different DB objects across different tablespaces, files and so on.3] create a special space (tablespace) to locate some of the data with special datatype ( for example CLOB, LOB and …) What are the tradeoffs with having indexes? - 1. Faster selects, slower updates. 2. Extra storage space to store indexes. Updates are slower because in addition to updating the table you have to update the index.
为管理业务培训信息,建立3个表: S(S#,SN,SD,SA)S#,SN,SD,SA分别代表学号,学员姓名,所属单位,学员年龄 C(C#,CN)C#,CN分别代表课程编号,课程名称 SC(S#,C#,G) S#,C#,G分别代表学号,所选的课程编号,学习成绩
(1)使用标准SQL嵌套语句查询选修课程名称为'税收基础'的学员学号和姓名? 答案:select s# ,sn from s where S# in(select S# from c,sc where c.c#=sc.c# and)
(2) 使用标准SQL嵌套语句查询选修课程编号为'C2'的学员姓名和所属单位? 答:select sn,sd from s,sc where s.s#=sc.s# and sc.c#='c2' (3) 使用标准SQL嵌套语句查询不选修课程编号为'C5'的学员姓名和所属单位? 答:select sn,sd from s where s# not in(select s# from sc where c#='c5') (4)查询选修了课程的学员人数 答:select 学员人数=count(distinct s#) from sc (5) 查询选修课程超过5门的学员学号和所属单位? 答:select sn,sd from s where s# in(select s# from sc group by s# having count(distinct c#)>5)
延伸阅读:
出个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...
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...
几道面试题求解 sql200915. 在web控件发生事件时,客户端采用提交的形式将数据交回服务端,服务端先调用Page_Load事件,然后根据传回的状态信息自动调用服务端事件自动传回是当我们在点击客户端控件时,采...
急求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...
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...
一道软件测试面试题中的sql题目求解1. select * from student where score>80 and s_id in (select sid from student_class where c_id=(select c_id from class where c_name='一班')) 2. select c.c_name,女...
SQL试题求解1 IF OBJECT_ID('学生表')IS NOT NULL DROP TABLE 学生表 GO create table 学生表 --建立学生表. ( 学号 int not null , --学号,姓名,年龄,性别,家庭住址,联系电话 姓名 varchar(10)...
sql语句面试题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(...