資源描述:
《某外企sqlserver面試題》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在應(yīng)用文檔-天天文庫。
1、某外企SQLServer面試題>>教育資源庫 Question1:CanyouuseabatchSQLorstoreproceduretocalculatingtheNumberofDaysinaMonth Ansm,1,cast(cast(year(getdate())asvarchar)+'-'+cast(month(getdate())asvarchar)+'-01'asdatetime)))) Question2:CanyouuseaSQLstatementtocal
2、culatingit! Hoe,price=casebooks Question3:CanyouuseaSQLstatementtofindingduplicate values! Hoelastname? Youcanusethetableauthorsindatatabasepubs.Ie number_dups --------------------------------------------------- Ringer 2
3、 (1roe,number_dups=count(1)fromauthorsgroupbyau_lname Question4:Canyoucreateacross-tabreportinmySQLServer! Hoforeachstore.Columnstore_idistheidofeachstore,ord_dateistheorderdateofeachsaleitem,andcolumnqtyisthesalequlity.Tablestoresrecordallstoreinformation.
4、 Ie Total Qtr1 Qtr2 Qtr3 Qtr4 -----------------------------------------------------------------------------------------------Barnum's 50 0 50 0 0Bookbeat 55 25 30 0
5、 0Doc-U-Mat:QualityLaundryandBooks 85 0 85 0 0FricativeBookshop 60 35 0 0 25Total 250 60 165 0 25 Ansovedthedatabase(objecttransfer)fromonemachinetoanotherlastnight,andanerror(specifi
6、ctoastoredprocedure)iscroppingup.Hoissionsaregrantedinallofourstoredprocedures;isthereatheisqlutilitytoforceallstoredprocedurestorepile? Tips:sp_repileca123下一頁>>>>這篇文章來自..,。nreplieastoreprocedureeachtime Ansberstomyresultset? Indatabasepubs,haveatabletitle
7、s,nober,hober()asline_no,title_idfromtitles --SQL2000的寫法 selectline_noidentity(int,1,1),title_idinto#tfromtitles select*from#t droptable#t Question7:Canyoutellmeentsatperformanceofexecution? Statement1: ifNOTEXISTS(select*frompublishersarket'end e
8、lse begin SELECT'publishersarket' end Ansnstate,andtitleauhtorhavebookseachauthor authorsod_cook'typebooks? Indatabasepubs,usethreetablestores,salesandtitlestoimplementth