数据库系统概念(第六版)答案

所需积分/C币:25 2018-01-30 10:39:47 12.72MB PDF
收藏 收藏
举报

数据库系统概念(第六版)里的课后习题答案,非常好的资源!
Chapter 1 Introductio e. A database DDL is focussed on specifying types of attributes of rela tions; in contrast, a programming language allows objects, and col lections of objects to be created 1.3 List six major steps that you would take in setting up a database for a particular enterprise Answer: Six major steps in setting up a database for a particular enterprise are Define the highlevel requirements of the enterprise(this step generates a document known as the system requirements specification Define a model containing all appropriate types of data and data rela- tionships e Define the integrity constraints on the data Define the physical level For each known problem to be solved on a regular basis ( e.g, tasks to be carried out by clerks or Web users) define a user interface to carry out the task, and write the necessary application programs to implement the user interface Create/initialize the database 1.4 List at least 3 different types of information that a university would main tain, beyond those listed in Section 1.6.2 Answer: e Information about people who are employees of the university but who are not instructors Library information including books in the library, and who has issued books Accounting information including fee payment, scholarships, salaries and all other kinds of receipts and payments of the university 1.5 Suppose you want to build a video site similar to YouTube. Consider each of the points listed in Section 1. 2, as disadvantages of keeping data in a file-processing system. Discuss the relevance of each of these points to the storage of actual video data, and to metadata about the video, such as title the user who uploaded it, tags, and which users viewed it Answer: Data redundancy and inconsistency. This would be relevant to meta- data to some extent, although not to the actual video data, which is not updated. There are very few relationships here, and none of them can lead to redundancy. Difficulty in accessing data. If video data is only accessed through a few predefined interfaces, as is done in video sharing sites today. 学霸助手[xuebazhushou.com-课后答案期末试卷|复习提纲 Exercises this will not be a problem. However, if an organization needs to find video data based on specific search conditions(beyond simple key word queries)if meta data were stored in files it would be hard to find relevant data without writing application programs. USing a database would be important for the task of finding data. Data isolation. Since data is not usually updated, but instead newly created, data isolation is not a major issue. Even the task of keeping track of who has viewed what videos is(conceptually) append only, again making isolation not a major issue. However, if authorization is added there may be some issues of concurrent updates to authoriza- tion information Integrity problems. It seems unlikely there are significant integrity constraints in this application, except for primary keys. if the data distributed, there may be issues in enforcing primary key constraints. Integrity problems are probably not a major issue Atomicity problems. When a video is uploaded, metadata about the video and the video should be added atomically, otherwise there would be an inconsistency in the data. An underlying recovery mechanism would be required to ensure atomicity in the event of failures Concurrent-access anomalies Since data is not updated,concurrent access anomalies would be unlikely to occur Security problems. These would be a issue if the system supported authorization 1.6 Keyword queries used in Web search are quite different from database queries. List key differences between the two, in terms of the way the queries are specified, and in terms of what is the result of a query. Answer: Queries used in the Web are specified by providing a list of keywords with no specific syntax. The result is typically an ordered list of URLS, along with snippets of information about the content of the URls In contrast, database queries have a specific syntax allowing complex queries to be specified. And in the relational world the result of a query is always a table 学霸助手[xuebazhushou.com-课后答案期末试卷|复习提纲 学霸助手[xuebazhushou.com-课后答案期末试卷|复习提纲 CHAPTER 2 Introduction to the relational Model Practice Exercises 2.1 Consider the relational database of Figure ??. What are the appropriate primary keys Answer: The answer is shown in Figure 2.1, with primary keys under lined 2.2 Consider the foreign key constraint from the dept name attribute of in structor to the department relation Give examples of inserts and deletes to these relations, which can cause a violation of the foreign key constraint. Answer: Inserting a tup (10111, Ostrom, Eco 110000 into the instructor table, where the department table does not have th department Economics, would violate the foreign key constraint Deleting the tuple (Biology, Watson, 90000) from the department table, where at least one student or instructor tuple has dept_name as Biology, would violate the foreign key con- traint employee(person._name, street, city) works(personname, company-name, salary company(company-name, city) Figure 2.1 Relational database for Practice Exercise 2.1 学霸助手[xuebazhushou.com-课后答案期末试卷|复习提纲 Chapter 2 Introduction to the Relational Model 2.3 Consider the time slot relation. Given that a particular time slot can meet more than once in a week, explain why day and start time are part of the primary key of this relation, while end-time is not Answer: The attributes day and start-time are part of the primary key since a particular class will most likely meet on several different days, and may even meet more than once in a day. However, end-time is not part of the primary key since a particular class that starts at a particular time on a particular day cannot end at more than one time 2.4 In the instance of instructor shown in Figure ? no two instructors have the same name. From this can we conclude that name can be used as a superkey(or primary key )of instructor? Answer: No. For this possible instance of the instructor table the names are unique, but in general this may not be always the case(unless the university has a rule that two instructors cannot have the same name which is a rather unlikey scenario 2.5 What is the result of first performing the cross product of student and advisor, and then performing a selection operation on the result with the predicate s-id =ID? (Using the symbolic notation of relational algebra this query can be written as o,id=In(student x advisor) Answer: The result attributes include all attribute values of student followed by all attributes of advisor. The tuples in the result are as follows. For each student who has an advisor the result has a row containing that students attributes, followed by an s id attribute identical to the students ID attribute, followed by the iid attribute containing the ID of the students advisor Students who do not have an advisor will not appear in the result. a student who has more than one advisor will appear a corresponding number of times in the result 2.6 Consider the following expressions, which use the result of a relational algebra operation as the input to another operation For each expression, explain in words what the expression does a. Ovearz2009(takes )M student (takes a student C.∏ID.name,. ourseid( student凶 takes) Answer: a. For each student who takes at least one course in 2009, display the students information along with the information about what courses the student took The attributes in the result are ID, name, dept name, tot_cred, courseid, section id, semester, year, grade b. Same as(a); selection can be done before the join operation Provide a list of consisting of 学霸助手[xuebazhushou.com-课后答案期末试卷|复习提纲 Exercises D. name. course id of all students who took any course in the university 2.7 Consider the relational database of Figure ?? Give an expression in the relational algebra to express each of the following queries a. Find the names of all employees who live in city Miami b. Find the names of all employees whose salary is greater than 中100,000 C. Find the names of all employees who live in Miami and whose salary is greater than $100,000 Answer: Iname(ocity= Miami(employee)) b. [name(salary >10000(employee)) C. Iname(ocity= Miami A salary> 100000(employee)) 2.8 Consider the bank database of Figure ?? Give an expression in the relational algebra for each of the following queries Find the names of all branches located in chicago b. Find the names of all borrowers who have a loan in branch Down town Answer: a. [:(Ulruuchcily= Chicago (branch)) b. Customer_name(branch_mame- Downtown (borrower M loan) 学霸助手[xuebazhushou.com-课后答案期末试卷|复习提纲 学霸助手[xuebazhushou.com-课后答案期末试卷|复习提纲 CHAPTER 3 一h Introduction to SQL Exercises 3.1 Write the following queries in SQL, using the university schema (We sug gest you actually run these queries on a database, using the sample data that we provide on the web site of the book, db-book. com. Instructions for setting up a database, and loading sample data, are provided on the above Web site.) a. Find the titles of courses in the comp Sci. department that have 3 credits b. Find the iDs of all students who were taught by an instructor named Einstein; make sure there are no duplicates in the result C. Find the highest salary of any instructor d. Find all instructors earning the highest salary(there may be more than one with the same salary) e. Find the enrollment of each section that was offered in autumn 2009 f. Find the maximum enrollment, across all sections in Autumn 2009 g. Find the sections that had the maximum enrollment in Autumn 2009 Answer: a. Find the titles of courses in the Comp. Sci. department that have 3 credit select title from course where dept name= Comp. Sci and credits= 3 学霸助手[xuebazhushou.com-课后答案期末试卷|复习提纲

...展开详情
试读 127P 数据库系统概念(第六版)答案
立即下载 低至0.43元/次 身份认证VIP会员低至7折
    抢沙发
    一个资源只可评论一次,评论内容不能少于5个字
    • GitHub

      绑定GitHub第三方账户获取
    • 签到新秀

      累计签到获取,不积跬步,无以至千里,继续坚持!
    关注 私信 TA的资源
    上传资源赚积分,得勋章
    最新推荐
    数据库系统概念(第六版)答案 25积分/C币 立即下载
    1/127
    数据库系统概念(第六版)答案第1页
    数据库系统概念(第六版)答案第2页
    数据库系统概念(第六版)答案第3页
    数据库系统概念(第六版)答案第4页
    数据库系统概念(第六版)答案第5页
    数据库系统概念(第六版)答案第6页
    数据库系统概念(第六版)答案第7页
    数据库系统概念(第六版)答案第8页
    数据库系统概念(第六版)答案第9页
    数据库系统概念(第六版)答案第10页
    数据库系统概念(第六版)答案第11页
    数据库系统概念(第六版)答案第12页
    数据库系统概念(第六版)答案第13页
    数据库系统概念(第六版)答案第14页
    数据库系统概念(第六版)答案第15页
    数据库系统概念(第六版)答案第16页
    数据库系统概念(第六版)答案第17页
    数据库系统概念(第六版)答案第18页
    数据库系统概念(第六版)答案第19页
    数据库系统概念(第六版)答案第20页

    试读已结束,剩余107页未读...

    25积分/C币 立即下载 >