面试时最经常被问到的问题(Frenquentlyaskedinterviewquestions)之Databases篇
来源:互联网 发布:400电话软件 编辑:程序博客网 时间:2024/06/05 09:16
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
DatabasesQuestions&Answers
1. WhataretwomethodsofretrievingSQL?
Answer:
2. Whatcursortypedoyouusetoretrievemultiplerecordsets?
Answer:
3. Whatactiondoyouhavetoperformbeforeretrievingdatafromthenextresultsetofastoredprocedure?
Answer:Movethecursordownonerowfromitscurrentposition.AResultSetcursorisinitiallypositionedbeforethefirstrow.Beforeyoucangettothefirstrow,youwouldneedtoMovethecursordownbyonerow(Forex:injavathefirstcalltonextmakesthefirstrowthecurrentrow;thesecondcallmakesthesecondrowthecurrentrow,andsoon).
4. WhatisthebasicformofaSQLstatementtoreaddataoutofatable?
Answer:SELECT*FROMtable_name;
5. Whatstructurecanyouhavethedatabasemaketospeeduptablereads?
Answer:Thequestionisnotcorrect."Whatstructurecanyouhavethedatabasemaketospeeduptablereads?"Itisnotclearwhatexactlytheterm"structure"meansinthiscase.FollowtherulesofDBtuningwehaveto:
1)properlyuseindexes(differenttypesofindexes)
2)properlylocatedifferentDBobjectsacrossdifferenttablespaces,filesandsoon.
3)Createaspecialspace(tablespace)tolocatesomeofthedatawithspecialdatatypes(forexampleCLOB,LOBand...)
4)...
5)...
6. Whatisa"join"?
Answer:Joinsmergethedataoftworelatedtablesintoasingleresultset,presentingadenormalizedviewofthedata.
7. Whatisa"constraint"?
Answer:Aconstraintallowsyoutoapplysimplereferentialintegritycheckstoatable.Thereare5primarytypesofconstraintsthatarecurrentlysupportedby:
PRIMARY/UNIQUE-enforcesuniquenessofaparticulartablecolumn.
DEFAULT-specifiesadefaultvalueforacolumnincaseaninsertoperationdoesnotprovideone.
FOREIGNKEY-validatesthateveryvalueinacolumnexistsinacolumnofanothertable.
CHECK-checksthateveryvaluestoredinacolumnisinsomespecifiedlist
NOTNULL-isaconstraintwhichdoesnotallowvaluesinthespecificcolumntobenull.Andalsoitistheonlyconstraintwhichisnotatablelevelconstraint.
8. Whatisa"primarykey"?
Answer:PrimaryKeyisatypeofaconstraintenforcinguniquenessanddataintegrityforeachrowofatable.AllcolumnsparticipatinginaprimarykeyconstraintmustpossesstheNOTNULLproperty.
9. Whatisa"functionaldependency"?Howdoesitrelatetodatabasetabledesign?
Answer:Whatfunctionaldependenceinthecontextofadatabasemeansisthat:AssumethatatableexistsinthedatabasecalledTABLEwithacompositeprimarykey(A,B)andothernon-keyattributes(C,D,E).Functionaldependencyingeneral,wouldmeanthatanynon-keyattribute-CDorEbeingdependentontheprimarykey(AandB)inourtablehere.1<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
DatabasesQuestions&Answers
1. WhataretwomethodsofretrievingSQL?
Answer:
2. Whatcursortypedoyouusetoretrievemultiplerecordsets?
Answer:
3. Whatactiondoyouhavetoperformbeforeretrievingdatafromthenextresultsetofastoredprocedure?
Answer:Movethecursordownonerowfromitscurrentposition.AResultSetcursorisinitiallypositionedbeforethefirstrow.Beforeyoucangettothefirstrow,youwouldneedtoMovethecursordownbyonerow(Forex:injavathefirstcalltonextmakesthefirstrowthecurrentrow;thesecondcallmakesthesecondrowthecurrentrow,andsoon).
4. WhatisthebasicformofaSQLstatementtoreaddataoutofatable?
Answer:SELECT*FROMtable_name;
5. Whatstructurecanyouhavethedatabasemaketospeeduptablereads?
Answer:Thequestionisnotcorrect."Whatstructurecanyouhavethedatabasemaketospeeduptablereads?"Itisnotclearwhatexactlytheterm"structure"meansinthiscase.FollowtherulesofDBtuningwehaveto:
1)properlyuseindexes(differenttypesofindexes)
2)properlylocatedifferentDBobjectsacrossdifferenttablespaces,filesandsoon.
3)Createaspecialspace(tablespace)tolocatesomeofthedatawithspecialdatatypes(forexampleCLOB,LOBand...)
4)...
5)...
6. Whatisa"join"?
Answer:Joinsmergethedataoftworelatedtablesintoasingleresultset,presentingadenormalizedviewofthedata.
7. Whatisa"constraint"?
Answer:Aconstraintallowsyoutoapplysimplereferentialintegritycheckstoatable.Thereare5primarytypesofconstraintsthatarecurrentlysupportedby:
PRIMARY/UNIQUE-enforcesuniquenessofaparticulartablecolumn.
DEFAULT-specifiesadefaultvalueforacolumnincaseaninsertoperationdoesnotprovideone.
FOREIGNKEY-validatesthateveryvalueinacolumnexistsinacolumnofanothertable.
CHECK-checksthateveryvaluestoredinacolumnisinsomespecifiedlist
NOTNULL-isaconstraintwhichdoesnotallowvaluesinthespecificcolumntobenull.Andalsoitistheonlyconstraintwhichisnotatablelevelconstraint.
8. Whatisa"primarykey"?
Answer:PrimaryKeyisatypeofaconstraintenforcinguniquenessanddataintegrityforeachrowofatable.AllcolumnsparticipatinginaprimarykeyconstraintmustpossesstheNOTNULLproperty.
9. Whatisa"functionaldependency"?Howdoesitrelatetodatabasetabledesign?
Answer:Whatfunctionaldependenceinthecontextofadatabasemeansisthat:AssumethatatableexistsinthedatabasecalledTABLEwithacompositeprimarykey(A,B)andothernon-keyattributes(C,D,E).Functionaldependencyingeneral,wouldmeanthatanynon-keyattribute-CDorEbeingdependentontheprimarykey(AandB)inourtablehere.1<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- 面试时最经常被问到的问题(Frenquentlyaskedinterviewquestions)之Databases篇
- 面试时最经常被问到的问题(Frenquently asked interview questions)之 Databases 篇
- 面试时最经常被问到的问题(Frenquently asked interview questions)之C/C++篇
- 面试时最经常被问到的问题(Frenquently asked interview questions)之Java篇
- 面试时最经常被问到的问题(Frenquently asked interview questions)之Internet Technologies篇
- 面试时最经常被问到的问题(Frenquently asked interview questions)之Misc. Topics篇
- 面试时最经常被问到的问题(Frenquently asked interview questions)之General / Fundamentals篇
- 面试时最经常被问到的问题(Frenquently asked interview questions)之Algorithms & Coding篇
- 面试时最经常被问到的问题(Frenquently asked interview questions)之终结篇--提问面试官
- 面试时最经常被问到的问题(Frenquently asked interview questions)之Analytical, puzzles, and brain-teasers篇
- 面试时最经常被问到的问题(Frenquently asked interview questions)之Microsoft and other companies篇
- 面试时最经常被问到的问题II
- 面试时最经常被问到的问题I
- 面试时最经常被问到的问题(Frenquently asked interview questions)(I)
- 面试时最经常被问到的问题(Frenquently asked interview questions)(II)
- 面试时最经常被问到的问题(Frenquently asked interview questions)(I)
- 面试时最经常被问到的问题(Frenquently asked interview questions)(II)
- 面试时最经常被问到的问题(Frenquently asked interview questions)(I)
- 中国ERP之路
- 使用Microsoft2000的全文搜索功能构建Web搜索应用程序
- 如何在SQL中启用全文检索功能?(实例)
- 防止IIS返回错误信息泄露服务器敏感信息
- 这是个没头没尾的文章
- 面试时最经常被问到的问题(Frenquentlyaskedinterviewquestions)之Databases篇
- 系列创业家陈丕宏:互联网创业的五大定律
- 面向对象的正确评价与选择
- 重建系统!
- 连接失败错误及解决
- SETNOCOUNT的用法
- 内存池(version1.1)
- SETXACT_ABORT的用法
- 将小写金额转换为英文大写的SQL函数