资源描述:
《实验3 数据索引及视图设计》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、实验3数据索引及视图设计3.1实验目的(1)掌握使用SQL语句建立索引(2)掌握使用SQL语句进行视图的定义的方法(3)掌握通过视图设计器进行视图的定义的方法3.2实验内容和要求完成教材第六章6.1.3及6.2.2节的例题,并把相应的命令语句写入实验报告并给出运行结果。完成创建和删除索引(视图方法和SQL语句方法).完成创建和删除视图(视图方法和SQL语句方法).3.3实验步骤例6.1.3createindexsname_indonstudent(sname)例6.2.2例5createviewis_studentasselect*fromstudent例
2、6createviewv_is_s1(sno,sname,grade)asselectstudent.sno,sname,gradefromstudentjoinsconstudent.sno=sc.snowheresdept='xinxi'andsc.cno='a001'例7createviewv_is_sageasselectsno,sname,sagefromis_studentwheresage<20例8createviewv_is_s2(sno,sname,grade)asselectsc.sno,sname,gradefromis_studen
3、tjoinsconis_student.sno=sc.snowherecno='a001'例920currencydeposit,weprescribeapassonaregularbasis,qilucardaccountonaregularbasis),certificatebondsandsavingsbonds(electronic);3.notdrawnonabanksavingscertificate,certificatebondsapplyformortgageloans,acceptingonlythelendercreateviewbt
4、_s(sno,sname,sbirth)asselectsno,sname,2010-sageFROMstudent创建的索引和视图:删除索引的语句是:Dropindex索引名删除视图的语句是:Dropview视图名20currencydeposit,weprescribeapassonaregularbasis,qilucardaccountonaregularbasis),certificatebondsandsavingsbonds(electronic);3.notdrawnonabanksavingscertificate,certificate
5、bondsapplyformortgageloans,acceptingonlythelender创建索引:20currencydeposit,weprescribeapassonaregularbasis,qilucardaccountonaregularbasis),certificatebondsandsavingsbonds(electronic);3.notdrawnonabanksavingscertificate,certificatebondsapplyformortgageloans,acceptingonlythelender