范文无忧网面试笔试笔试回答

SQL题目麻烦编下高手进

03月12日 编辑 fanwen51.com

[甲骨文Sql笔试题目]甲骨文Sql笔试 甲骨文Sql笔试) 第一题:有两个表分别如下: 表A(varchar(32) NAME,int GRADE) 数据: LISI 60 WANGWU 84 表B(varchar(32) NAME,int AGE) 数据: ZHANGSHAN 26 LISI...+阅读

SQL题目麻烦编下高手进

create table cr_grade (学号 char(11),课程代号 int,平时期中期末成绩 decimal(18,2))alter table cr_grade add constraint fk_xh foreign key(学号) references cr_student(学号) on delete cascade on update cascadealter table cr_grade add constraint fk_kcdh foreign key(课程代号) references cr_course(课程代号) on delete cascade on update cascade...

SQL题目谁帮忙做一下明天考试急用!

(1)create table sc (sno not null,cno not null,grade)

(2)select * from student where sname like '司马%' (3)create view PC_view WITH ENCRYPTION AS select * from student shere (4)grant alter,insert on student to U1

(5)select sname ,sno from student s,course c,sc a where a.sno=s.sno and c.cno=a.cno and c.cname='数据库原理及应用' order by s.sno desc

SQL数据库试题求解

------------------------------------------------------ create table students(st_id varchar(20),st_name varchar(50),sex varchar(10)) insert into students(st_id,st_name,sex) select 'st001','张杰', '男' union all select 'st002', '公孙燕飞' ,'男' union all select 'st003', '王楠', '女' union all select 'st004', '王伟', '男' union all select 'st005','李燕纹', '女' union all select 'st006', '孙武' ,'男' select * from students create table teachers(t_id varchar(20),t_name varchar(50),t_lesson varchar(50)) insert into teachers select 't001', '张老师' ,'数学' union all select 't002', '李老师', '英语' delete from results create table results(r_id varchar(20),r_fenshu int,r_stid varchar(50),r_tid varchar(50)) insert into results select 'r001','90', 'st001', 't002' union all select 'r002', '68', 'st005', 't001' union all select 'r003', '92', 'st003' ,'t001' union all select 'r004', '82', 'st006', 't002' union all select 'r005', '70', 'st002', 't002' union all select 'r006', '86', 'st002', 't001' union all select 'r007', '57', 'st003', 't002' union all select 'r008', '76', 'st006', 't001' union all select 'r009', '55', 'st001', 't001' union all select 'r010', '77', 'st004', 't002' union all select 'r011', '58', 'st005', 't002' ---------------------------------------------------------- 1. select st_id from students where st_name = '王伟' 2.select st_id,st_name from students where st_name like '__燕%' 3 select st_name,len(st_name) as 名字长度 from students where sex ='男' 4 select min(r_fenshu) as 最低分数 from teachers t inner join results r on t.t_id =r.r_tid where t_lesson ='数学' --这个是不考虑成绩中有null值的 5 select s.st_id as 学生编号,r_fenshu as分数,r_tid as 课目号 from students s inner join results r on s.st_id =r.r_stid where s.sex='女' --如果还要课目的名称的话请用下面的 select s.st_id as 学生编号,r.r_fenshu as 分数,r.r_tid as 课目号,t.t_lesson as 课目名称 from students s inner join results r on s.st_id =r.r_stid inner join teachers t on r.r_tid = t.t_id where s.sex='女' 6 select avg(r.r_fenshu) from results r inner join teachers t on r.r_tid = t.t_id where t.t_lesson='英语' 7.select * from students s inner join results r on s.st_id =r.r_stid inner join teachers t on r.r_tid = t.t_id where s.st_id in (select top 2 st_id from students order by st_id desc) order by s.st_id desc 8 select sum(r.r_fenshu) as 总分 from results r inner join students s on r.r_stid =s.st_id where s.st_name = '王楠' 9.select distinct s.st_id,s.st_name from students s inner join results r on s.st_id = r.r_stid where st_id not in (select r_stid from results where r_fenshu<60) and st_id not in (select r_stid from results where r_fenshu >=90) 10 update results set r_fenshu = r_fenshu + 10 --如果分数不可能大于100请用这句 set r_fenshu = case when r_fenshu + 10 <=100 then r_fenshu + 10 else 100 end where r_stid in (select st_id from students where) 1 进阶题 select t.t_name,count(*) from students s,teachers t,results r where r.r_tid = t.t_id and s.st_id =r.r_stid and r.r_fenshu >= 60 and t.t_id in (select t_id from teachers where t_lesson='数学' ) --and t_lesson='数学' group by t.t_name 2 select top 1 sum(r_fenshu) as 总分,t.t_lesson,t_id,t_name from results r,teachers t where r.r_tid = t.t_id group by t.t_lesson,t_id,t_name order by 总分 desc 3. delete from results where r_stid in (select r_stid from results group by r_stid having count(r_tid) = 1) 1 选做题 select d.name from sysobjects d where d.xtype='U' 2.select top 5 * from students order by newid()

SQL题目麻烦帮我编下

create table cr_student (xh char(11) not null,sfzid char(18) not null)alter table cr_student add constraint pk_xh primary key(xh)alter table cr_student add constraint un_xh unique(sfzid)alter table cr_student add constraint ck_sfzid check (sfzid like '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][01234567899X]' or sfzid like '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]')...

延伸阅读:

Linux运维笔试题高手麻烦了!展开全部 1.修改过的文件,是多久前修改过的?1天内吗? #!bin/sh find -mtime 1 | cp * /tmp 2.#!bin/sh while : do echo "Hello!" sleep done 3.查看cpu,硬盘,内存?查看他们的什么?硬...

面试题目sql我使用的是MySQL 如下语句: 建表语句: create table Lessoninfo( no int, week int, isonduty char); 插入数据:略 insert into Lessoninfo values(...............) SQL查询语...

电工高手进电工面试一般的问题4根电线国家标准代表是TN-C系统,即三根相线,一根工作零线,也叫N线。5根电线的叫TN-S系统,即三根相线,一根工作零线(N线),一根保护零线(PE线,颜色黄绿胶合)。 照明灯多少伏的都可以亮,要...

SQL数据库题目解答 2.select sno,sname,major from student where major in(select cno from course where) 3.没有见到有选课表 4.select cname from course where cno not in(select distin...

麻烦问两个sql查询啊面试题中遇到的谢谢!SELECT SUM(CASE T.TRADE_TYPE WHEN 0 THEN T.AMOUNT ELSE 0 END) - SUM(CASE T.TRADE_TYPE WHEN 1 THEN T.AMOUNT ELSE 0 END) LAST_AMOUNT FROM T_ORDER T WHERE T.CUT_DA...

Linux运维笔试题高手麻烦展开全部 1.修改过的文件,是多久前修改过的?1天内吗? #!bin/sh find -mtime 1 | cp * /tmp 2.#!bin/sh while : do echo "Hello!" sleep done 3.查看cpu,硬盘,内存?查看他们的什么?硬...

关于sql题目11,select name ,sex from table where name like '张%' 12, select name from table where name like '' 13,select name ,sex from table where age>20 14,select name fr...

速求SQL题目答案【1】 select * from employ 【2】 select department_name from departments d join employ e on d.department_id=e.department_id where e.employee_id=2 【3】 select p...

SQL的题目最基础的等1.select 工资 FROM 职工 2.SELECT * FROM 仓库 3.SELECT 职工号 FROM 职工 WHERE 工资>1230 4.SELECT DISTINCT 仓库号 FROM 职工 WHERE 工资>1210 5.SELECT 职工号 FROM...

推荐阅读
图文推荐
栏目列表