资源描述:
《数据库系统及应用实验与课程设计指导实验归纳总结报告.doc》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、实验一SQLServer2008基本服务和信息一实验目的要求学生查看SQLServer2008联机丛书的内容,了解SQL的环境及基本操作,了解SQL的基本信息。二实验内容查看书内容,环境并掌握其基本操作,服务器管理和注册查看SQL的目录结构,利用SQL的基本系统视图查看相关信息。三实验指导select*fromsys.serverswhereserver_id=0select*fromsys.databasesselect*fromsys.filegroupsselect*fromsys.master_filesselect*fromsys.database_fil
2、esselect*fromsys.data_spacescreatetabletest(idintnotnull,namechar(100)null,constraintpk_testprimarykeyclustered(idasc))createnonclusteredindexix_testontest(name)select*fromsys.objectswheretype_desc='user_table'andname='test'select*fromsys.objectswheretype_desc='user_table'andname='test
3、'orparent_object_idin(selectobject_idfromsys.objectswheretype_desc='user_table'andname='test')select*fromsys.columnswhereobject_id='12'select*fromsys.indexeswhereobject_id='12325345'select*fromsys.partitionswhereobject_id='12325345'select*fromsys.allocation_unitsselect*fromsys.allocati
4、on_unitsu,sys.partitionspwhereu.typein(1,3)andu.container_id=p.hobt_idandp.object_id='33'unionallselect*fromsys.allocation_unitsu,sys.partitionspwhereu.type=2andu.container_id=p.partition_idandp.object_id='33'select*fromsys.dm_db_partition_statswhereobject_id='33'select*fromsys.index_c
5、olumnswhereobject_id='11'select*fromsys.database_principalsselect*fromsys.types实验二数据库的创建和管理一实验目的要求学生熟练的使用SQL创建和管理数据库,并学会使用SQL查询分析器接受和运行结果分析。二实验内容创建数据库,查看和修改数据库的属性,修改数据库名称,删除数据库.三实验指导--数据库的创建createdatabaseeduconprimary(name=student_data,filename='C:ProgramFilesMicrosoftSQLServerMSSQL
6、10.MSSQLSERVERMSSQLDATAstudent_data.mdf',size=10MB,maxsize=50MB,filegrowth=1MB)logon(name=student_log,filename='C:ProgramFilesMicrosoftSQLServerMSSQL10.MSSQLSERVERMSSQLDATAstudent_log.ldf',size=2MB,maxsize=5MB,filegrowth=1%)useeducgoselectdatabase_id,is_read_only,collation_nam
7、e,compatibility_levelfromsys.databaseswherename='educ'gouseeducgoselectdatabasepropertyex('educ','isautoshrink')gousejxglgoselectobject_name(id)as'数据表名'fromsysobjectswherextype='u'andobjectproperty(id,'ismsshipped')=0gouseeducgoexecsp_spaceusedgousejxglgoalterdatabasejxgladdfile(name