当前位置:首页 » 编程语言 » sql语句翻译

sql语句翻译

发布时间: 2022-03-30 03:41:39

① 求大佬翻译sql语句

先根据查询和关联条件查询students s, classes c, Student_Deal sd,Patriarchies p四张表,形成t1临时表,然后t1表与schools表根据school_id左连接,最后得到结果。
具体的语句可以翻译为
students s, classes c, Student_Deal sd,Patriarchies p 四张表根据
s.class_id = c.class_id
and s.student_id = sd.student_id
and p.p_id=sd.p_id
的关联条件,查询当满足
sd.if_key_p=1
and sd.Expire_Date >sysdate
and sd.is_valid=1
and s.home_city=592
条件时所生成的临时数据表t1 与schools ss表根据ss.school_id = t1.school_id左连接所得到的数据。

② 高分求助 SQL 的语句翻译

请高人翻译并解释如下语句,请尽量详细
问题描述:
已知关系模式:
s (sno,sname)学生关系。
sno 为学号,
sname 为姓名
c (cno,cname,cteacher) 课程关系。
cno 为课程号,
cname 为课程名,
cteacher 为任课教师
sc(sno,cno,scgrade) 选课关系。
scgrade 为成绩

2. 列出有二门以上(含两门)不及格课程的学生姓名及其平均成绩

--实现代码:
select s(学生表).sno(学号),s.sname,avg_scgrade=avg(sc.scgrade)
from s,sc,(
select sno
from sc
where scgrade<60
group by sno
having count(distinct cno)>=2
)a where s.sno=a.sno and sc.sno=a.sno
group by s.sno,s.sname

3. 列出既学过“1”号课程,又学过“2”号课程的所有学生姓名

--实现代码:
select s.sno,s.sname
from s,(
select sc.sno
from sc,c
where sc.cno=c.cno
and c.cname in('1','2')
group by sno
having count(distinct cno)=2
)sc where s.sno=sc.sno

4. 列出“1”号课成绩比“2”号同学该门课成绩高的所有学生的学号

--实现代码:
select s.sno,s.sname
from s,sc sc1,sc sc2
where sc1.cno='1'
and sc2.sno='2'
and sc1.cno=s.cno
and sc1.scgrade>sc2.scgrade

5. 列出“1”号课成绩比“2”号课成绩高的所有学生的学号及其“1”号课和“2”号课的成绩

--实现代码:
select sc1.sno,[1号课成绩]=sc1.scgrade,[2号课成绩]=sc2.scgrade
from sc sc1,sc sc2
where sc1.cno='1'
and sc2.cno='2'
and sc1.sno=sc2.sno
and sc1.scgrade>sc2.scgrade
我刚刚看了一下你这些脚本,好像,,,,本来就有问题哈,,

过两天空了再来看看!

③ SQL语句怎么翻译

select C_NAME,C_STU from CLASS where C_STU>50 or C_STU<20

select 后面写什么字段就只返回什么字段,如果是“*”,则表中的字段全部返

回,“or”表示或者,满足一个条件就可以了”and“表示和,并且,”and“前

后的条件都要满足的,所以这里用“or”,而不用”and“的

④ SQL语言应该怎么翻译

MSEmployee a
MSDepartment b
MSPostion c
MSPostionClass d
a.*就是a表所有的列 b.name就是b表列名为name的列
SQL本身就是解释性语言。仔细看看。你就能看出蛛丝马迹。

⑤ 请将下列语句翻译成 sql语句代码 急用~

1.create database student_score

2.
create table courseInfo(
courseNo char(6) primary key,
courseName varchar(20) not null
)

3.
create table stuInfo(
StuNo char(6) primary key,
StuName varchar(20) not null,
Sex char(2),
Nation varchar(4) default('汉') not null,
ID varchar(18) unique
)

4.
create table scoreInfo(
ID int identity(1,1) not null,
StuNo char(6),
courseNo char(6),
score float,
constraint fk_id foreign key (stuNO) references stuInfo(stuNo),
constraint fk_Courseno foreign key (courseNo) references courseInfo(courseNo),
constraint check_score check (score>=0 and score<=100)
)

5.
insert into courseInfo values('100101','西班牙语')
insert into courseInfo values('100102','大学英语')
update courseInfo set courseName='专业英语' where courseNo='100102'
delete from courseInfo where courseNo='100101'

6.
create view viewScoreInfo
as
select stuInfo.stuNO as stuNO,stuInfo.stuName as stuName,courseInfo.courseNo as courseNo,courseInfo.courseName as courseName,scoreInfo.score as score from stuInfo
join scoreInfo on scoreInfo.stuNO=stuInfo.stuNo join courseInfo on courseInfo.courseNO=scoreInfo.courseNo

7.select stuName,sex from stuInfo where stuName like '刘%' and sex='女'

8.select stuNo,stuName from viewScoreInfo where score<60

9.
create procere select_specialScore
@courseName varchar(20)
as
select max(score),min(score),avg(score) from scoreInfo join courseInfo on scoreInfo.courseNo=courseInfo.courseNo where courseName=@courseName

exec select_specialScore '专业英语'//执行存储过程语句

⑥ SQL语句翻译成oracle语句

delete from T_SM_SupplyInfo where fpurchaseorgid <>'8r0AAAAAAOHM567U';
commit;

create table T_SM_SupplyInfobak as select * from T_SM_SupplyInfo ;

ALTER TABLE T_SM_SupplyInfobak DROP COLUMN FPurchaseOrgID;

create table T_SM_SupplyInfobak1 as
select a.FID as FPurchaseOrgID,b.id,b.name ......
from T_ORG_Purchase a,T_SM_SupplyInfobak b
where a.FID <>'8r0AAAAAAOHM567U';

create table T_SM_SupplyInfobak2 as
select rownum kk,id,name ..... from T_SM_SupplyInfobak1;

update
(SELECT td.fid,td1.kk
from T_SM_SupplyInfobak1 td
left join T_SM_SupplyInfobak2 td1 on td.FPurchaseOrgID=td1.FPurchaseOrgID and td.FSupplierID=td1.FSupplierID and td.FMaterialItemID=td1.FMaterialItemID )
set FID =kk;

commit;

insert into T_SM_SupplyInfo select FID ,FCreatorID,FCreateTime ,FLastUpdateUserID,FLastUpdateTime ,
FControlUnitID ,FName_L1 ,FName_L2,FName_L3,FNumber ,FDescription_L1 ,FDescription_L2 ,FDescription_L3 ,
FSimpleName ,FPurchaseOrgID,FSupplierID ,FMaterialItemID ,FMmateiralRule ,FMeasureUnitID ,FSupplierMaterialNumber,
FSupplierMaterialName,FSupplierMaterialRule,FPurMeasureUnitID ,FEffectualDate ,FUneffectualDate ,FLeadtime ,
FQtyOrderBottom ,FQtyOrderTop,FIsUseable ,FAuditorID ,FAuditDate ,FMaxPrice ,FMinPrice ,FLastPrice ,FPrice ,
FLastPurTime ,FIsTaxPrice ,FIsBatchTemp ,FDiscountRate ,FTaxRate ,FMaterialPurchaseType,FOperationNo ,
FIndemnityPrice ,FFixedExpenses ,FFixingQty ,FFromQty ,FToQty ,FRecOrgID from T_SM_SupplyInfobak1;
commit;

drop table T_SM_SupplyInfobak;
drop table T_SM_SupplyInfobak1;
drop table T_SM_SupplyInfobak2;

⑦ sql 语句翻译~~

先说下,本人SQL知识也有限,如果此段代码有误,我还傻乎乎的翻译不要怪我.
进入DB:JXSK
创建触发器SCORE_SC_TRI
监视对SC进行INSERT,UPDATE的动作
将@score_read(tinyint,以下简称@S)作为输出变量.
从INSERTED表中查询@S(即SCORE)
如果@S在0到100之间
则输出"操作完成"
反之输出"成绩超过0---100....."
并且撤消之前的动作.

⑧ SQL语言翻译(急求啊!!)

不对啊,你表的信息不全怎么建啊,字段呢?

⑨ SQL 语句翻译

SELECT Q0.姓名, IIf(Q1.JiaoFeiYue<Q1.WT1,0,Q0.JS1) AS 基数1, IIf(Q1.JiaoFeiYue<Q1.WT2,0,Q0.JS2) AS 基数2, Q1.JiaoFeiYue AS 缴费月
FROM (SELECT 缴费表.ID, 缴费表.姓名, 缴费表.基数1 AS JS1, 缴费表.基数2 AS JS2 FROM 缴费表) AS Q0 RIGHT JOIN (SELECT YN.YN AS JiaoFeiYue, WTY.ID, WTY.委托月 AS WT, WTY.委托月1 AS WT1, WTY.委托月2 AS WT2, WTY.minYear, WTY.MaxYear FROM (SELECT YandM.YN FROM (SELECT GetMaxMonth1(Q_Date.ZX1,Q_Date.ZX2,Q_Date.ZX3,0) AS ZXDate, GetMaxMonth1(Q_Date.ZD1,Q_Date.ZD2,Q_Date.ZD3,1) AS ZDDate FROM (SELECT Min(JFB.委托月) AS ZX1, Min(JFB.委托月1) AS ZX2, Min(JFB.委托月2) AS ZX3, Max(JFB.委托月) AS ZD1, Max(JFB.委托月1) AS ZD2, Max(JFB.委托月2) AS ZD3 FROM (SELECT * FROM 缴费表 WHERE 缴费表.委托月<="201407") AS JFB) AS Q_Date) AS V_Date, YandM WHERE YandM.YN>=V_Date.ZXDate and YandM.YN<=V_Date.ZDDate) AS YN, (SELECT 缴费表.ID, 缴费表.委托月, GetMaxMonth("201407",缴费表.委托月,缴费表.委托月1,缴费表.委托月2,0) AS minYear, GetMaxMonth("201407",缴费表.委托月,缴费表.委托月1,缴费表.委托月2,1) AS MaxYear, 缴费表.委托月1, 缴费表.委托月2 FROM 缴费表 WHERE (((缴费表.委托月)<="201407"))) AS WTY WHERE (((YN.YN)>=[WTY].[minYear] And (YN.YN)<=[WTY].[maxYear]))) AS Q1 ON Q0.ID=Q1.ID
ORDER BY Q0.姓名, Q1.JiaoFeiYue DESC;

⑩ 求一条sql语句翻译

当然不适用,

oracle中根本就没有top语句..这条语句肯定就会报错。

你可以使用oracle中自带的rowid字段进行查询条件的控制

select rowid<countpage,* from EVALUEPICTURE where E_ID not in
(select rowid<countpage*(mypage-1)+" E_ID from EVALUEPICTURE);

应该就是这样滴。。.在网吧.. 如果有错误再发信给我啊

热点内容
编程好软件 发布:2025-01-16 20:38:07 浏览:422
流量密码如何改成 发布:2025-01-16 20:37:13 浏览:49
java判断是否是对象 发布:2025-01-16 20:31:04 浏览:884
python调用外部程序 发布:2025-01-16 20:14:09 浏览:396
缓解压力英语作文 发布:2025-01-16 20:13:31 浏览:64
javaname 发布:2025-01-16 20:13:15 浏览:21
用户访问表空间 发布:2025-01-16 20:07:07 浏览:943
java代码自动编译 发布:2025-01-16 19:58:14 浏览:313
编程很困难 发布:2025-01-16 19:58:09 浏览:673
gg登录源码 发布:2025-01-16 19:58:07 浏览:292