sql語句翻譯
① 求大佬翻譯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);
應該就是這樣滴。。.在網吧.. 如果有錯誤再發信給我啊