资源描述:
《oracle 实验3new》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、实验三:高级SQL语言1.实验目的:熟悉Oracle10g关于层次、情景、翻译、分析、线性回归等各种高级查询技术。2.实验内容(1)练习层次查询(2)练习情景查询;(3)练习翻译查询;(4)练习分析查询;(5)练习线性回归查询。3.实验步骤4.实验总结5.实验数据和SQL语句层次查询createtablebicycle(part_idnumber(5)constraintpk_bicycle_part_idprimarykey,parent_idnumber(5)constraintfk_bicycle_pidreferencesbicycle(part_id),part_namevar
2、char2(30)notnull,mp_costnumber(9,2),describevarchar2(30));insertintobicyclevalues(1,null,'自行车',379.28,'装配');insertintobicyclevalues(2,1,'导向系统',101.11,'制造');insertintobicyclevalues(3,1,'驱动系统',159.56,'制造');insertintobicyclevalues(4,1,'其他部分',118.61,'制造和采购');insertintobicyclevalues(5,2,'车把',37.28,'制造
3、');insertintobicyclevalues(6,2,'前叉',24.35,'制造');insertintobicyclevalues(7,2,'前轴',19.67,'制造');insertintobicyclevalues(8,2,'前轮',19.81,'制造');insertintobicyclevalues(9,7,'前轴棍',8.16,'制造');insertintobicyclevalues(10,7,'前轴身',4.82,'制造');insertintobicyclevalues(11,7,'前轴碗',6.69,'制造');insertintobicyclevalue
4、s(12,10,'前轴管',1.61,'制造');insertintobicyclevalues(13,10,'前花盘',3.21,'制造');insertintobicyclevalues(14,3,'脚蹬',18.99,'制造');insertintobicyclevalues(15,3,'中轴',25.27,'制造');insertintobicyclevalues(16,3,'链条',21.65,'制造');insertintobicyclevalues(17,3,'飞轮',29.12,'制造');insertintobicyclevalues(18,3,'后轴',31.72,'
5、制造');insertintobicyclevalues(19,3,'后轮',32.81,'制造');insertintobicyclevalues(20,17,'外套',9.35,'制造');insertintobicyclevalues(21,17,'平档',5.82,'制造');insertintobicyclevalues(22,17,'芯子',5.11,'制造');insertintobicyclevalues(23,17,'千斤',6.56,'制造');insertintobicyclevalues(24,17,'钢珠',2.28,'采购');insertintobicycl
6、evalues(25,4,'车架',81.78,'制造');insertintobicyclevalues(26,4,'车闸',15.26,'制造');insertintobicyclevalues(27,4,'链罩',7.10,'采购');insertintobicyclevalues(28,4,'车铃',4.33,'采购');insertintobicyclevalues(29,4,'车锁',5.02,'采购');insertintobicyclevalues(30,4,'支架',5.12,'制造');selectpart_id,parent_id,part_name,mp_cost
7、frombicyclestartwithpart_id=1connectbypriorpart_id=parent_id;selectlevel,part_id,parent_id,part_name,mp_costfrombicyclestartwithpart_id=1connectbypriorpart_id=parent_idorderbylevel;columnpartNameformatA35columnmp_costf