Solutions for Chapter 7
Solutions for Section 7.1
Solutions for Section 7.2
Solutions for Section 7.3
Solutions for Section 7.4
Solutions for Section 7.5
Solutions for Section 7.6
Solutions for Section 7.7
Solutions for Section 7.1
Exercise 7.1.1(a)
There are many ways to handle the DISTINCT keyword. Given the grammar rules defined so far, the
easiest might be to treat it as an option at the beginning of a select-list. That is, we change the rules
for <SelList> to
<SelList> ::= <OptDistinct><SelList1>
<OptDistinct> ::= DISTINCT
<OptDistinct> ::= emptyString
<SelList1> ::= <Attribute> , <SelList1>
<SelList1> ::= <Attribute>
That is, a <SelList1> is a list of attributes, as the old <SelList> used to be. The syntactic category
<OptDistinct> represents an ``optional
DISTINCT, and is replaced by either the keyword DISTINCT or
the empty string (i.e., it disappears).
Exercise 7.1.2(a)
<Condition> ::= <Condition> OR <Condition>
<Condition> ::= NOT <Condition>
Return to Top
Solutions for Section 7.2
Exercise 7.2.1
If the index on S helps us find tuples that satisfy the condition C, then surely we should push the
selection to S. Let the result of the selection on S be a relation S', which is a subset of S. Assuming
there is no index on
R
that helps with condition
C
, then if we push the selection to
R
as well, we still
Database System Implementation
- 1
- 2
- 3
- 4
- 5
- 6
前往页