实验三.docx

上传人:b****4 文档编号:4405531 上传时间:2023-05-07 格式:DOCX 页数:9 大小:475.18KB
下载 相关 举报
实验三.docx_第1页
第1页 / 共9页
实验三.docx_第2页
第2页 / 共9页
实验三.docx_第3页
第3页 / 共9页
实验三.docx_第4页
第4页 / 共9页
实验三.docx_第5页
第5页 / 共9页
实验三.docx_第6页
第6页 / 共9页
实验三.docx_第7页
第7页 / 共9页
实验三.docx_第8页
第8页 / 共9页
实验三.docx_第9页
第9页 / 共9页
亲,该文档总共9页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

实验三.docx

《实验三.docx》由会员分享,可在线阅读,更多相关《实验三.docx(9页珍藏版)》请在冰点文库上搜索。

实验三.docx

实验三

数据库系统实现

实验报告

实验名称:

实验3:

IndexingusingBexperiment

 

姓名:

王慧洁(2121492)

翟红敏(2121532)

指导老师:

王洪亚

日期:

2012年12月08日

一、实验目的:

IndexadatabaseofstudentrecordsusingB-trees.

二、实验内容:

IndexadatabaseofstudentrecordsusingB-trees.

TherewillbeoneindexfilesasthedatabasewillbeindexedbystudentID.Aseparatedatabasefilewillcontaintheactualstudentrecords.Theprogramwilltaketwoinputfiles:

adatafileandacommandfile.Thedatafileisatextfilecontainingstudentrecordsfromwhichthedatabaseanditsindexeswillbeinitiallybuilt.Thecommandfileisalistofinsertandsearchoperationstobecarriedoutafterthefileshavebeenbuilt.

InputandOutputFormats:

Thedatafilewillconsistofsomenumberoftextlines,onestudentrecordperline.Eachlinewillhave6space-separatedfields:

ID(9digits),lastname(atmost15letters),firstname(atmost15letters),year(1digit),major(atmost4letters),andemailaddress(atmost20characters).

Thecommandfilewillcontainlinesspecifiyingoneoffivekindsofcommands:

findID

add

dumpbyID

SampleInputandOutputFiles:

datafile.txt

000000088PlattJohn0MLjplatt@vt.edu

000000097BrillEric1NLPbrill@vt.edu

000000056DumaisSusan2IRdumais@

000000003ChenZheng1CNzhengc@

000000010ChenMing0ISEmcheng@vt.edu

cmdfile.txt

findID000000097

add000000060ShafferClifford1ALGshaffer@vt.edu

add000000066PlattJenny1UNKplatt@vt.edu

add000000021ChenJian0cSEjchen@vt.edu

dumpbyID

三、实验结果及分析:

1.cmdfile.txt和datafile.txt

 

2.首先根据datafile.txt中的数据构建b+树,

即:

3.查找记录60和88

4.分别依次插入记录60662221

具体过程为:

插入60:

插入66:

插入22:

插入61:

实验结果:

即:

与分析结果一致。

 

5.分别依次删除记录1922

具体过程为:

删除19:

删除22:

实验结果为:

即:

与分析结果一致。

四、实验小结:

此次实验结果达到了实验目的和要求,通过此次实验,我真正理解了b+树索引的创建、查找、插入、删除等操作的处理过程,更好的理解了索引的作用。

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 自然科学 > 物理

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2