数据库处理课后习题答案.pdf
《数据库处理课后习题答案.pdf》由会员分享,可在线阅读,更多相关《数据库处理课后习题答案.pdf(122页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、数据库处理复习要点及参考答案 最近更新时间:7/25/2020 第一章 Microsoft Access 2007(第一次作业).错误!未定义书签。复习要点.错误!未定义书签。.错误!未定义书签。.错误!未定义书签。.错误!未定义书签。.错误!未定义书签。.错误!未定义书签。.错误!未定义书签。.错误!未定义书签。.错误!未定义书签。.错误!未定义书签。.错误!未定义书签。第二章 结构化查询语言简介(第二次作业).错误!未定义书签。复习要点.错误!未定义书签。.错误!未定义书签。.错误!未定义书签。Marcia 干洗店项目练习.错误!未定义书签。第三章 关系模型和规范化(第三次作业).错误!未
2、定义书签。复习重点.错误!未定义书签。.错误!未定义书签。.错误!未定义书签。Marcia 干洗店项目练习.错误!未定义书签。第四章.错误!未定义书签。复习重点.错误!未定义书签。第五章 E-R 图(第四次作业).错误!未定义书签。复习重点.错误!未定义书签。.错误!未定义书签。Marcia 干洗店项目.错误!未定义书签。第六章 数据库设计(第五次作业).错误!未定义书签。复习重点.错误!未定义书签。.错误!未定义书签。Marcia 洗衣店项目练习.错误!未定义书签。第七章 数据库创建、视图、触发器(第六次作业).错误!未定义书签。复习重点.错误!未定义书签。.错误!未定义书签。.错误!未定义
3、书签。.错误!未定义书签。.错误!未定义书签。.错误!未定义书签。.错误!未定义书签。Marcia 干洗店项目.错误!未定义书签。第十章 用 SQL Server 2008 管理数据库触发器、存储过程.错误!未定义书签。第八章 数据库再设计.错误!未定义书签。第九章 管理多用户数据库.错误!未定义书签。第一章 Microsoft Access 2007(第一次作业)复习要点(1).知识网络图 图(2).基本的定义:a.DBS:=用户+数据库应用程序+DBMS+DB。各个部分有什么作用 b.元数据 metadata (3).Access 的使用-作业 Create a Microsoft Acc
4、ess database named.Answers to the Project Questions are contained in the database,which is available on the texts Web site(database is created as described in Appendix A.The two tables to be created are:DEPARTMENT(DepartmentName,BudgetCode,OfficeNumber,Phone)EMPLOYEE(EmployeeNumber,FirstName,LastNam
5、e,Department,Phone,Email)Where An underlined column name indicates the table key(primary key)of the table,and an italicized column indicates a foreign key linking two tables.Figure 1-26 shows the column characteristics for the WPC DEPARTMENT table.Using the column characteristics,create the DEPARTME
6、NT table in the database.Figure 1-27 shows the data for the WPC DEPARTMENT table.Using Datasheet view,enter the data shown in Figure 1-27 into your DEPARTMENT table.Figure 1-28 shows the column characteristics for the WPC EMPLOYEE table.Using the column characteristics,create the EMPLOYEE table in t
7、he database.Create the relationship and referential integrity constraint between DEPARTMENT and EMPLOYEE.Enable enforcing of referential integrity and cascading of data updates,but do not enable cascading of data from deleted records.Using the Microsoft Access form wizard,create a data input form fo
8、r the EMPLOYEE table and name it WPC Employee Data Form.Make any adjustments necessary to the form so that all data display properly.Use this form to enter the rest of the data in the EMPLOYEE table shown in Figure 1-29 into your EMPLOYEE table.Using the Access report wizard,create a report named We
9、dgewood Pacific Corporation Employee Report that presents the data contained in your EMPLOYEE table sorted first by employee last name and then by employee first name.Make any adjustments necessary to the report so that all headings and data display properly.Print a copy of this report.To produce th
10、e report as shown below,some work in the Report Design view is necessary take the time to show your students how to modify report formats in Report Design view.Using the Microsoft Access form wizard,create a form that has all of the data from both tables.When asked how you want to view your data,sel
11、ect by DEPARTMENT.Choose the default options for other questions that the wizard asks.Open your form and page through your departments.To produce the report as shown below,some work in the Form Design view is necessary take the time to show your students how to modify report formats in Form Design v
12、iew.Using the Access report wizard,create a report that has all of the data from both tables.When asked how you want to view your data,select by DEPARTMENT.For the data contained in your EMPLOYEE table in the report,specify that it will be sorted first by employee last name and then by employee firs
13、t name.Make any adjustments necessary to the report so that all headings and data display properly.Print a copy of this report.To produce the report as shown below,some work in the Report Design view is necessary take the time to show your students how to modify report formats in Report Design view.
14、Explain,to the level of detail in this chapter,what is going on within Microsoft Access in Project Questions,and.What subcomponent created the form and report Where is the data stored What role do you think SQL is playing Access uses SQL SELECT statements to query the database tables for the data to
15、 be displayed in the forms and the report.The results of the query are stored in a temporary table created to hold this data,and this table is the source of the data displayed in the form and the report.SQL is used to gather the data needed for display in the form and report.第二章 结构化查询语言简介(第二次作业)复习要点
16、 (1).定义 DDL、DML。p32.(2).SQL 的写法-基本、重要。SELECT.FROM.WHERE.ORDER BY.GROUP BY.HAVING.IN.EXISTS.JOIN.ON(3).难点:多表连接、相关子查询、谓词计算(4).发现数据模式-动脑、扩展。例如题目.(5).实验教材。A.The ChangeClose on Fridays.SELECT ChangeClose FROM NDX WHERE TDayOfWeeK=Friday;B.The minimum,maximum,and average ChangeClose on Fridays.SELECT MIN(
17、ChangeClose)AS MinFridayChangeClose,MAX(ChangeClose)AS MaxFridayChangeClose,AVG(ChangeClose)AS AverageFridayChangeClose FROM NDX WHERE TDayOfWeeK=Friday;C.The average ChangeClose grouped by TYear.Show TYear.SELECT TYear,AVG(ChangeClose)AS AverageChangeClose FROM NDX GROUP BY TYear ORDER BY TYear;D.T
18、he average ChangeClose grouped by TYear and TMonth.Show TYear and TMonth.Since TYear and TMonth are being displayed,it makes sense to sort the results by TYear and TMonth although this is not explicitly stated in the question.SELECT TYear,TMonth,AVG(ChangeClose)AS AverageChangeClose FROM NDX GROUP B
19、Y TYear,TMonth ORDER BY TYear,TMonth;Unfortunately,the table NDX does not contain a numeric value of the month,so in order to sort the months correctly,we need a TMonthNumber which has a column containing a representative number for each month(January=1,February=2,etc.).In the and databases,this col
20、umn is included in a table named NDX_FULL.SELECT TYear,TMonth,AVG(ChangeClose)AS AverageFridayChangeClose FROM NDX_Full GROUP BY TYear,TMonth,TMonthNumber ORDER BY TYear,TMonthNumber;E.The average ChangeClose grouped by TYear,TQuarter,TMonth shown in descending order of the average(you will have to
21、give a name to the average in order to sort by it).Show TYear,TQuarter,and TMonth.Note that months appear in alphabetical and not calendar order.Explain what you need to do to obtain months in calendar order.SELECT TYear,TQuarter,TMonth,AVG(ChangeClose)AS AverageChangeClose FROM NDX GROUP BY TYear,T
22、Quarter,TMonth ORDER BY AverageChangeClose DESC;Unfortunately,as discussed above,Microsoft Access cannot process the ORDER BY clause correctly when an SQL built-in function is used.The correct result,obtained from SQL Server 2008,is:In order to obtain the months in calendar order,we would have to us
23、e a numerical value for each month(1,2,3,12)and sort by those values.F.The difference between the maximum ChangeClose and the minimum ChangeClose grouped by TYear,TQuarter,TMonth shown in descending order of the difference (you will have to give a name to the difference in order to sort by it).Show
24、TYear,TQuarter,and TMonth.SELECT TYear,TQuarter,TMonth,(MAX(ChangeClose)MIN(ChangeClose)AS DifChangeClose FROM NDX GROUP BY TYear,TQuarter,TMonth ORDER BY DifChangeClose DESC;Unfortunately,as discussed above,Microsoft Access cannot process the ORDER BY clause correctly because it contains an aliased
25、 computed result.The correct result,obtained from SQL Server 2008,is:G.The average ChangeClose grouped by TYear shown in descending order of the average(you will have to give a name to the average in order to sort by it).Show only groups for which the average is positive.SELECT TYear,AVG(ChangeClose
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 数据库 处理 课后 习题 答案
限制150内