2011年3月份VF上机试题答案1.doc_第1页
2011年3月份VF上机试题答案1.doc_第2页
2011年3月份VF上机试题答案1.doc_第3页
2011年3月份VF上机试题答案1.doc_第4页
2011年3月份VF上机试题答案1.doc_第5页
已阅读5页,还剩8页未读 继续免费阅读

付费下载

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

万老师VF等级考试资料2010年3月份VF上机考试题答案第 13 页 共 13 页第一套二、简单应用题1、select 供应商号,工程号,数量 from 供应,零件 where 供应.零件号=零件.零件号 and 颜色=红 order by 数量 desc into table sup_temp2、rightclick事件的代码:do m_quick.mpr三、综合应用题Command1按钮的Click事件中代码:select 零件名,颜色,重量 from 零件,供应 where 零件.零件号=供应.零件号 and 工程号=alltrim(thisform.text1.value) order by 零件名 into table ppthisform.grid1.recordsource=pp第二套二、简单应用题1、select 书名,作者,价格 from book,loans,borrows where book.图书登记号=loans.图书登记号 and loans.借书证号=borrows.借书证号 and 姓名=田亮 order by 价格 desc into table booktemp2、顶层表单的设计:在表单的属性窗口中设置Showwindow属性为2-作为顶层表单双击表单,在 load事件中输入以下代码:do menu_lin.mpr with this 三、综合应用题在Command1的Click事件中输入: select count(*) from book where 出版社=bo1.value into array athisform.text1.value=a在Command2的Click事件中输入:thisform.release第三套一、 基本操作题3、insert into score1 value(993503433,0001,99)三、综合应用题“平均”菜单项的过程代码为:select 课程名,avg(成绩) 平均成绩 from score1,course where score1.课程号=course.课程号 group by 课程名 order by 课程名 into table newtable第四套二、 简单应用题2、”查询”的click事件代码为:select 作者姓名,所在城市 from authors,books where authors.作者编号=books.作者编号 group by 作者姓名 having count(书名)=3 order by 作者姓名 into table newtable三、 综合应用题1、SELECT * FROM books WHERE AT(计算机,书名)0 INTO TABLE BOOKSBAK2、update booksbak set 价格=价格*0.953、select 出版单位,avg(价格) as 均价 from booksbak group by 出版单位 order by 均价into cursor aaselect * top 1 from aa where 均价=25 order by 均价into table newtable 第五套二、简单应用题1、select 外币名称,持有数量 from currency_sl,rate_exchange where currency_sl.外币代码=rate_exchange.外币代码and 姓名=林诗因 order by 持有数量 into table rate_temp三、综合应用题“查询”的Click事件代码为:select 外币名称,现钞买入价*持有数量 as 人民币数量from currency_sl,rate_exchange where currency_sl.外币代码=rate_exchange.外币代码and currency_sl.姓名=alltrim(thisform.text1.value) order by 人民币数量 desc into table DBFAthisform.grid1.recordsource=DBFA第六套二、简单应用题1、第一个错误改为locate for 姓名=林诗因第二个错误改为do while not eof()第三个错误是改为summ=summ+a1*currency_sl.持有数量三、 综合应用题“统计”的click事件代码为:DO CASECASE thisform.myOption.option1.value=1 SELECT Currency_sl.姓名, Currency_sl.持有数量FROM rate_exchange, Currency_sl where rate_exchange.外币代码 = Currency_sl.外币代码and rate_exchange.外币名称 = 日元 INTO TABLE rate_ryCASE thisform.myOption.option2.value=1 SELECT Currency_sl.姓名, Currency_sl.持有数量 FROM rate_exchange,Currency_sl where rate_exchange.外币代码 = Currency_sl.外币代码 and rate_exchange.外币名称 = 美元 INTO TABLE rate_myCASE thisform.myOption.option3.value=1 SELECT Currency_sl.姓名, Currency_sl.持有数量FROM rate_exchange, Currency_sl where rate_exchange.外币代码 = Currency_sl.外币代码 and rate_exchange.外币名称 = 欧元 INTO TABLE rate_oyENDCASE第七套二、简单应用题1、update 教师 set 新工资=原工资*1.2 where 职称=教授update 教师 set 新工资=原工资 where 职称!=教授insert into 教师 value(林红,讲师,10200,10000)三、 综合应用题“查询”的click事件代码为:THISFORM.GRID1.RECORDSOURCE=SELECT 学生.姓名,课程.课程名称,选课.成绩FROM课程,选课,学生 where学生.学号=选课.学号 and课程.课程号 = 选课.课程号and系 = 6 INTO CURSOR a第八套二、简单应用题1、select 项目信息.项目号,项目名,零件信息.零件号,零件名称 from 零件信息,使用零件,项目信息 where 零件信息.零件号=使用零件.零件号 and 使用零件.项目号=项目信息.项目号 and 零件信息.零件号 in(select 零件号 from 使用零件 where 项目号=s1) order by 项目信息.项目号 desc into table item_temp三、综合应用题表单form_item的Load事件代码为:public ss(3)ss(1)=s1ss(2)=s2ss(3)=s3“命令”的Click事件代码为:SELECT SUM(零件信息.单价*使用零件.数量);FROM 零件信息,使用零件,项目信息where使用零件.项目号 = 项目信息.项目号 and 零件信息.零件号 = 使用零件.零件号and使用零件.项目号 =ALLTRIM(THISFORM.combo1.VALUE) GROUP BY 项目信息.项目号 INTO ARRAY aaTHISFORM.TEXT1.VALUE=aa第九套二、简单应用题2、select 姓名,sum(基准价*持有数量) 人民币价值 from currency_sl,rate_exchange where currency_sl.外币代码=rate_exchange.外币代码 group by 姓名 order by 2 desc into table results三、综合应用题“查询”的click事件代码为:x=thisform.text1.valueselect 外币名称,持有数量 from currency_sl,rate_exchange;where currency_sl.外币代码=rate_exchange.外币代码 and 姓名=x order by 持有数量 into table &xthisform.grid1.recordsource=&x第十套一、基本操作题1、select 外币名称,现钞买入价,卖出价 from rate_exchange into table rate_x2、update rate_exchange set 卖出价=829.01 where 外币名称=美元二、简单应用题1、timer1的timer事件代码为:thisform.label1.caption=time()“暂停”的click事件代码为:erval=0“继续”的click事件代码为:erval=500第十一套二、简单应用题1、空行处应填use customer第二个错误应改为SCAN FOR 所在地=北京。2、select 公司名称,订单编号,金额,送货方式 from customer,order where customer.客户编号=order.客户编号 order by 公司名称,订单编号 into table results三、综合应用题“退出”的过程代码为:myform.releaseset sysmenu to defaultload事件代码为:do mymenu.mpr with this第十二套一、 基本操作题1、 insert into 零件信息 value(p7,PN7,1020)2、 delete from 零件信息 where 单价(select avg(数学) from chengji) and 英语(select avg(英语) from chengji) and 信息技术(select avg(信息技术) from chengji) order by xuesheng.学号 desc into table table2第十七套三、综合应用题open database cj_mselect*from table3 into table aaselect 1use xueshengindex on 学号 tag 学号select 2use chengjiindex on 学号 tag 学号set relation to 学号 into chengjiselect 1go topdo while not eof()select 2if chengji.数学60 insert into aa value(xuesheng.学号,xuesheng.姓名,数学,chengji.数学)endifif chengji.英语60 insert into aa value(xuesheng.学号,xuesheng.姓名,英语,chengji.英语)endifif chengji.信息技术=ctod(thisform.text1.value) order by 价格 desc into table tabd第二十一套三、综合应用题“计算”的过程事件代码为:select xuesheng.学号, 姓名, 数学,英语,信息技术from chengji,xuesheng where chengji.学号 = xuesheng.学号 order by xuesheng.学号 desc into table table3alter table table3 add 等级 c(4)update table3 set 等级=优 where数学=60 and t英语=60 and信息技术=60 and (数学+英语+信息技术)=270update table3 set 等级=良 where 数学=60 and 英语=60 and 信息技术=60 and (数学+英语+信息技术)=240 and (数学+英语+信息技术)=60 and 英语=60 and 信息技术=60 and (数学+英语+信息技术)=210 and (数学+英语+信息技术)=60 and 英语=60 and 信息技术=60 and (数学+英语+信息技术)=180 and (数学+英语+信息技术)命令按钮click事件如下: thisform.list2.additem(thisform.list1.value)2、修改=04、update teacher set 工资=8000 where 姓名=Jack二 、简单应用题1、第一处错误应改为do while not eof()第二处错误应改为select count(*) from 教师表 where 教师表.系号=xihao into array a第三处错误应改为skip第二十九套二、简单应用题2、select 姓名,avg(成绩) 平均成绩 from student,score where student.学号=score.学号group by student.学号 order by 2 desc,1 into table avgscore三、综合应用题4、”生成数据”的click事件代码为:select*from viewsc order by 学号,成绩 desc into table result“运行报表”的click事件代码为:report form three preview第三十套二 、简单应用题2、第一处错误修改为:group by 销售表.部门号 into cursor temp第二处错误修改为:into table account三 、综合应用题“查询”的click事件代码为:x=alltrim(thisform.text1.value)y=alltrim(thisform.text2.value)thisform.grid1.recordsource=select 商品代码表.商品号,商品名,一季度利润,二季度利润,三季度利润,四季度利润 from 商品代码表,部门成本表,销售表 where 商品代码表.商品号=销售表.商品号 and 部门成本表.部门号=销售表.部门号 and 销售表.部门号=x and 部门成本表.年度=y into table xs+x第三十一套三、综合应用题1、建立菜单,在”显示”常规选项”选中”顶层表单”复选框“统计”的过程代码为:select customer.客户号,客户名,sum(金额) 合计 from customer,orders where customer.客户号=orders.客户号group by customer.客户号 order by 3 desc into table tabletwo2、”退出”的过程代码为:myform.release3、建立表单,设置showwindow属性为2-作为顶层表单在表单的load事件代码为:do mymenu.mpr with this第三十二套三、综合应用题“统计”的过程代码为:select year(签订日期) 年份,month(签订日期) 月份,sum(金额) 合计 from orders,employee where orders.职员号=employee.职员号 group by 1,2 order by 1 desc,2 into table tabletwo第三十三套一、 基本操作题3、alter table 金牌榜 add 奖牌总数 I check 奖牌总数=04、update 金牌榜 set 奖牌总数=金牌数+银牌数+铜牌数三、综合应用题x=thisform.list1.valueselect 运动员名称,项目名称,名次 from 获奖牌情况,国家;where 获奖牌情况.国家代码=国家.国家代码 and 国家名称=x;into table &x第三十四套二、 简单应用题1、 select 课程名称,max(成绩) 最高分 from course,scorewhere course.课程编号=score.课程编号group by course.课程编号 into table me2、 select 课程名称 from course,score where course.课程编号=score.课程编号and 成绩=70 group by 学生.学号 having count(课程号)=3 into table results2、第一处错误修改为:alte table 学生 add 平均成绩 n(6,2)第二处错误修改为:do while .not. eof()第三处错误修改为:replace 平均成绩 with cj1第三十七套一、 基本操作题4、select 顾客号,顾客点菜表.菜编号,菜名,单价,数量 from 顾客点菜表,菜单表where 顾客点菜表.菜编号=菜单表.菜编号 and 单价=40 order by 顾客点菜表.菜编号 desc into table taba二、简单应用题2、选项按钮组的click事件代码为:if thisform.optiongroup1.value=1thisform.list1.rowsource=*.docendifif thisform.optiongroup1.value=2thisform.list1.rowsource=*.xlsendifif thisform.optiongroup1.value=3thisform.list1.rowsource=*.txtendif三、综合应用题“查询”的click事件代码为:select 顾客序号,顾客姓名,单位,消费金额from 结帐表 where 结帐日期=ctod(thisform.text1.value) order by 消费金额 desc into table tabc“显示”的click事件代码为:thisform.grid1.recordsource=select*from tabc into cursor a第三十八套一、 基本操作题2、update tabb set 日期=2005/10/013、select distinct *from taba into table tabc二、简单应用题1、use taba go top do while not eof() select a,b,c from taba into array aa a=aa(1) b=aa(2) c=aa(3) if a0 x=b2-4*a*c y=-b/(2*a) z=sqrt(abs(x)/(2*a) if delta=0 r1=y+z r2=y-z replace x1 with r1 replace x2 with r2 else repl note with 无实数解endif endif skipenddo三、综合应用题“查询”的click事件代码为:thisform.grid1.recordsource=select*from 学生表 where 注册日期=ctod(alltrim(thisform.text1.value) into cursor aaselect*from aa into array bbuse tabe zapinsert into tabe from array bb第三十九套一、 基本操作题2、alter table 课程表 add unique 课程号 tag 课程号三、综合应用题表单的load事件代码为:public a(3)a(1)=3000a(2)=4000a(3)=5000“生成”的click事件代码为:if thisform.optiongroup1.value=1 select*from 教师表 where 工资=val(bo1.value) order by 工资 desc,姓名 into table salaryelse select*from 教师表 where 工资val(bo1.value) order by 工资 desc,姓名 into table salaryendif第四十套一、 基本操作题4、alter table 教师表 alter 职工号 set check left(职工号,4)=1102二、简单应用题1、第一处错误应改为:create table 工资表(职工号 c(8) primary key,姓名 c(6),工资 n(10,2)第二处错误应改为:insert into 工资表 values (11020034,宣喧,4500)第三处错误应改为:update 工资表 set 工资=工资*1.1 where 工资3000第四处错误应改为:delete from 工资表 where 姓名=Thomas三 、综合应用题“取前三名”的过程事件代码为:select top 3 系名,avg(工资) 平均工资 from 学院表,教师表 where 学院表.系号=教师表.系号 group by 学院表.系号 order by 2 desc into table sa_three“取前五名”的过程事件代码为:select top 5 系名,avg(工资) 平均工资 from 学院表,教师表 where 学院表.系号=教师表.系号group by 学院表.系号 order by 2 desc into table sa_five第四十一套二、简单应用题2、将第2行语句修改为:from employee p join employee c第3行语句修改为:on p.组别=c.组别 where c.职务=组长 and c.姓名p.姓名三、综合应用题“开始查询”的click事件代码为:select 订单号,客户号,签订日期,金额 from order where 职员号=alltrim(thisform.text1.value) order by 签订日期 into table t+thisform.text1.valuethisform.release第四十二套二、简单应用题2、select 会员号,姓名,年龄 from customer where 年龄=thisform.text1.value group by customer.会员号 order by 3 into table dbfa第四十三套三、综合应用题alter table order add 总金额 n(7,2)select 订单号,sum(单价*数量) as 总金额 from orderitem,goods where orderitem.商品号=goods.商品号group by 订单号 into table bbdo while not eof()update order set 总金额=bb.总金额 where 订单号=bb.订单号skipenddo第四十四套二、简单应用题1、select year(签订日期),count(客户号) from customers group by 1 order by 1 into table tableone三、综合应用题语句1为:set relation to 商品号 into goods_t语句2为:set relation to 订单号 into orderitems语句3为:if 数量goods_t.库存量语句4为:skip -n语句5为:replace 库存量 with 库存量-orderitems.数量第四十五套一、基本操作题4、index on 客户号 tag khh of customers二、简单应用题1、查询的Click事件代码为:select 姓名,性别,出生日期 from customers where 出生日期=ctod(thisform.text1.value) order by 出生日期 desc into table tableone三、综合应用题“计算”的过程事件代码为:select 订单号,sum(单价*数量) 总金额 from goods,orderitems where goods.商品号=orderitems.商品号 group by 订单号 into table aado while not eof()update orders set 总金额=aa.总金额 where 订单号=aa.订单号skipenddo第四十六套一、基本操作题3、select*from 教师表 where 工资4500 order by 职工号 to file one二、简单应用题1、第一处错误应改为:select 系号 from 学院表 where 系名=信息管理 into array a第二处错误应改为:use 教师表第三处错误应改为:scan for 系号=a第四处添加的程序为:num=num+1三、综合应用题“生成”的click事件代码为:if thisform.optiongroup1.value=1 select 系名,学院表.系号,avg(工资) 平均工资 from 教师表,学院表 where 教师表.系号=学院表.系号and 系名=bo1.value into table salaryelse select 系名,学院表.系号,avg(工资) 总工资 from 教师表,学院表 where 教师表.系号=学院表.

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论