Chapter 2: RelationalModel
ďŽ Advantages of Relational Model
ďŽ Structure of Relational Databases
ďŽ Fundamental Relational-Algebra-Operations
ďŽ Additional Relational-Algebra-Operations
ďŽ Extended Relational-Algebra-Operations
ďŽ Null Values
ďŽ Modification of the Database
3.
Advantages of RelationalModel
ďŽ Simplicity
ďą Avoids data duplication.
ďą Avoids inconsistent records.
ďą Easier to change data
ďą Easier to change data format
ďą Data can be added and removed safely
ďą Easier to maintain security
ďŽ Provides a very simple yet powerful way to
represent data
4.
Structure of Relational
Databases
ďŽConsists of collection of tables, each of which is
assigned to a unique name.
ďŽ A row represent a relationship.
ďŽ Table is a collection of relationship
Formally, given sets D1, D2, âŚ. Dn a relation r is a
subset of
Basic Structure
ďŽ Example:If
ďą = customer_name = {Jones, Smith, Curry, Lindsay, âŚ}
ďą = customer_street = {Main, North, Park, âŚ}
ďą = customer_city = {Harrison, Rye, Pittsfield, âŚ}
Then r = {
(Jones, Main, Harrison),
(Smith, North, Rye),
(Curry, North, Rye),
(Lindsay, Park, Pittsfield)
}
is a relation over
customer_name x customer_street x customer_city
7.
Attribute Types
ďŽ Eachattribute of a relation has a name
ďŽ The set of allowed values for each attribute is called the
domain of the attribute
ďŽ Attribute values are (normally) required to be atomic; that is,
indivisible
ďą E.g. the value of an attribute can be an account number,
but cannot be a set of account numbers
ďŽ Domain is said to be atomic if all its members are atomic
ďŽ The special value null is a member of every domain
ďŽ The null value causes complications in the definition of
many operations
ďą We shall ignore the effect of null values in our main presentation
and consider their effect later
8.
Relation Schema
ďŽ A1,A2, âŚ, An are attributes
ďŽ R = (A1, A2, âŚ, An ) is a relation schema
Example:
Customer_schema = (customer_name,
customer_street, customer_city)
ďŽ r(R) denotes a relation r on the relation schema R
Example:
customer (Customer_schema)
9.
Relation Instance
ďŽ Thecurrent values (relation instance) of a
relation are specified by a table
ďŽ An element t of r is a tuple, represented by a
row in a table
Jones
Smith
Curry
Lindsay
customer_name
Main
North
North
Park
customer_street
Harrison
Rye
Rye
Pittsfield
customer_city
customer
attributes
(or columns)
tuples
(or rows)
10.
Relations are Unordered
ďŽOrder of tuples is irrelevant (tuples may be stored in an arbitrary
order)
ďŽ Example: account relation with unordered tuples
11.
Database
ďŽ A databaseconsists of multiple relations
ďŽ Information about an enterprise is broken up into parts, with each relation storing one
part of the information
account : stores information about accounts
depositor : stores information about which customer
owns which account
customer : stores information about customers
ďŽ Storing all information as a single relation such as
bank(account_number, balance, customer_name, ..)
results in
ďą repetition of information
ďŽ e.g.,if two customers own an account (What gets repeated?)
ďą the need for null values
ďŽ e.g., to represent a customer without an account
ďŽ Normalization theory (Chapter 7) deals with how to design relational schemas
Keys
ďŽ Let Kď R
ďŽ K is a superkey of R if values for K are sufficient to
identify a unique tuple of each possible relation r(R)
ďą by âpossible r â we mean a relation r that could exist in the
enterprise we are modeling.
ďą Example: {customer_name, customer_street} and
{customer_name}
are both superkeys of Customer, if no two customers can
possibly have the same name
ďŽ In real life, an attribute such as customer_id would be used instead of
customer_name to uniquely identify customers, but we omit it to keep
our examples small, and instead assume customer names are unique.
15.
Keys (Cont.)
ďŽ Kis a candidate key if K is minimal
Example: {customer_name} is a candidate key for
Customer, since it is a superkey and no subset of it
is a superkey.
ďŽ Primary key: a candidate key chosen as the principal
means of identifying tuples within a relation
ďą Should choose an attribute whose value never, or very
rarely, changes.
ďą E.g. email address is unique, but may change
16.
Foreign Keys
ďŽ Arelation schema may have an attribute that corresponds to the
primary key of another relation. The attribute is called a foreign
key.
ďą E.g. customer_name and account_number attributes of
depositor are foreign keys to customer and account
respectively.
ďą Only values occurring in the primary key attribute of the
referenced relation may occur in the foreign key attribute of the
referencing relation.
Query Languages
ďŽ Languagein which user requests information from
the database.
ďŽ Categories of languages
ďą Procedural
ďą Non-procedural, or declarative SQL
ďŽ âPureâ languages:
ďą Relational algebra
ďą Tuple relational calculus
ďą Domain relational calculus
ďŽ Pure languages form underlying basis of query
languages that people use.
19.
Relational Algebra
ďŽ Procedurallanguage
ďŽ Six basic operators
ďą select: ďł
ďą project: ď
ďą union: ď
ďą set difference: â
ďą Cartesian product: x
ďą rename: ď˛
ďŽ The operators take one or two relations as
inputs and produce a new relation as a result.
20.
Select Operation
ďŽ Notation:ďł p(r)
ďŽ p is called the selection predicate
ďŽ Defined as:
ďłp(r) = {t | t ď r and p(t)}
Where p is a formula in propositional calculus consisting of
terms connected by : ď (and), ď (or), ď (not)
Each term is one of:
<attribute> op <attribute> or <constant>
where op is one of: =, ďš, >, ďł. <. ďŁ
ďŽ Example of selection:
21.
Select Operation âExample
ďŽRelation r A B C D
ďĄ
ďĄ
ď˘
ď˘
ďĄ
ď˘
ď˘
ď˘
1
5
12
23
7
7
3
10
đđ¨=đŠďđŤ >đ( r ) A B C D
ďĄ
ď˘
ďĄ
ď˘
1
23
7
10
22.
Project Operation
ďŽ Notation:
whereA1, A2 are attribute names and r is a relation name.
ďŽ The result is defined as the relation of k columns obtained
by erasing the columns that are not listed
ďŽ Duplicate rows removed from result, since relations are sets
ďŽ Example: To eliminate the branch_name attribute of account
ďaccount_number, balance (account)
)
(
,
,
, 2
1
r
k
A
A
A ď
ď
23.
Project Operation âExample
ďŽ Relation r:
A B C
ďĄ
ďĄ
ď˘
ď˘
10
20
30
40
1
1
1
2
A C
ďĄ
ďĄ
ď˘
ď˘
1
1
1
2
=
A C
ďĄ
ď˘
ď˘
1
1
2
ďA,C (r)
24.
Union Operation
ďŽ Notation:r ď s
ďŽ Defined as:
r ď s = {t | t ď r or t ď s}
ďŽ For r ď s to be valid.
1. r, s must have the same arity (same number of attributes)
2. The attribute domains must be compatible (example: 2nd
columnof r deals with the same type of values as does
the 2nd
column of s)
ďŽ Example: to find all customers with either an account or a loan
ďcustomer_name (depositor) ď ďcustomer_name (borrower)
25.
Union Operation âExample
ďŽ Relations r, s:
ďŽr ď s:
A B
ďĄ
ďĄ
ď˘
1
2
1
A B
ďĄ
ď˘
2
3
r
s
A B
ďĄ
ďĄ
ď˘
ď˘
1
2
1
3
26.
Set Difference Operation
ďŽNotation r â s
ďŽ Defined as:
r â s = {t | t ď r and t ď s}
ďŽ Set differences must be taken between
compatible relations.
ďą r and s must have the same arity
ďą attribute domains of r and s must be compatible
27.
Set Difference Operationâ Example
ďŽ Relations r, s:
ďŽr â s:
A B
ďĄ
ďĄ
ď˘
1
2
1
A B
ďĄ
ď˘
2
3
r
s
A B
ďĄ
ď˘
1
1
28.
Cartesian-Product Operation
ďŽ Notationr x s
ďŽ Defined as:
r x s = {t q | t ď r and q ď s}
ďŽ Assume that attributes of r(R) and s(S) are
disjoint. (That is, R ď S = ď).
ďŽ If attributes of r(R) and s(S) are not disjoint,
then renaming must be used.
29.
Cartesian-Product Operation âExample
ďŽ Relations r, s:
ďŽr x s:
A B
ďĄ
ď˘
1
2
A B
ďĄ
ďĄ
ďĄ
ďĄ
ď˘
ď˘
ď˘
ď˘
1
1
1
1
2
2
2
2
C D
ďĄ
ď˘
ď˘
ď§
ďĄ
ď˘
ď˘
ď§
10
10
20
10
10
10
20
10
E
a
a
b
b
a
a
b
b
C D
ďĄ
ď˘
ď˘
ď§
10
10
20
10
E
a
a
b
b
r
s
30.
Composition of Operations
ďŽCan build expressions using multiple operations
ďŽ Example: ďłA=C(r x s)
ďŽ r x s
ďŽ ďłA=C(r x s)
A B
ďĄ
ďĄ
ďĄ
ďĄ
ď˘
ď˘
ď˘
ď˘
1
1
1
1
2
2
2
2
C D
ďĄ
ď˘
ď˘
ď§
ďĄ
ď˘
ď˘
ď§
10
10
20
10
10
10
20
10
E
a
a
b
b
a
a
b
b
A B C D E
ďĄ
ď˘
ď˘
1
2
2
ďĄ
ď˘
ď˘
10
10
20
a
a
b
31.
Rename Operation
ďŽ Allowsus to name, and therefore to refer to, the results of
relational-algebra expressions.
ďŽ Allows us to refer to a relation by more than one name.
ďŽ Example:
ď˛ x (E)
returns the expression E under the name X
ďŽ If a relational-algebra expression E has arity n, then
returns the result of expression E under the name X, and with the
attributes renamed to A1 , A2 , âŚ., An .
)
(
)
,...,
,
( 2
1
E
n
A
A
A
x
ď˛
32.
32
Example
Bars( name, addr)
Joeâs Maple St.
Sueâs River Rd.
R( bar, addr )
Joeâs Maple St.
Sueâs River Rd.
R(bar, addr) := Bars
Example Queries
ďŽ Findall loans of over $1200
ďŽ Find the loan number for each loan of an amount greater than
$1200
ďłamount > 1200 (loan)
ďloan_number (ďłamount > 1200 (loan))
ďŽ Find the names of all customers who have a loan, an account, or both,
from the bank
ďcustomer_name (borrower) ď ďcustomer_name (depositor)
35.
Example Queries
ďŽ Findthe names of all customers who have a
loan at the Perryridge branch.
ďŽ Find the names of all customers who have a loan at the
Perryridge branch but do not have an account at any branch of
the bank.
ďcustomer_name (ďłbranch_name = âPerryridgeâ
(ďłborrower.loan_number = loan.loan_number(borrower x loan))) â
ďcustomer_name(depositor)
ďcustomer_name (ďłbranch_name=âPerryridgeâ
(ďłborrower.loan_number = loan.loan_number(borrower x loan)))
36.
Example Queries
ďŽ Findthe names of all customers who have a
loan at the Perryridge branch.
ďŹ Query 2
ďcustomer_name(ďłloan.loan_number = borrower.loan_number (
(ďłbranch_name = âPerryridgeâ (loan)) x borrower))
ďŹ Query 1
ďcustomer_name (ďłbranch_name = âPerryridgeâ (
ďłborrower.loan_number = loan.loan_number (borrower x loan)))
37.
Example Queries
ďŽ Findthe largest account balance
ďą Strategy:
ďŽ Find those balances that are not the largest
ďą Rename account relation as d so that we can compare each account
balance with all others
ďŽ Use set difference to find those account balances that were not found in
the earlier step.
ďą The query is:
ďbalance(account) - ďaccount.balance
(ďłaccount.balance < d.balance (account x rd (account)))
38.
Formal Definition
ďŽ Abasic expression in the relational algebra consists of either
one of the following:
ďą A relation in the database
ďą A constant relation
ďŽ Let E1 and E2 be relational-algebra expressions; the following
are all relational-algebra expressions:
ďą E1 ď E2
ďą E1 â E2
ďą E1 x E2
ďą ďłp (E1), P is a predicate on attributes in E1
ďą ďs(E1), S is a list consisting of some of the attributes in E1
ďą ď˛ x (E1), x is the new name for the result of E1
39.
Additional Operations
ďŽ Wedefine additional operations that do not add
any power to the relational algebra, but that
simplify common queries.
ďą Set intersection
ďą Natural join
ďą Division
ďą Assignment
40.
Set-Intersection Operation
ďŽ Notation:r ď s
ďŽ Defined as:
ďŽ r ď s = { t | t ď r and t ď s }
ďŽ Assume:
ďą r, s have the same arity
ďą attributes of r and s are compatible
ďŽ Note: r ď s = r â (r â s)
41.
Set-Intersection Operation âExample
ďŽ Relation r, s:
ďŽ r ď s
A B
ďĄ
ď˘
2
3
A B
ďĄ
ďĄ
ď˘
1
2
1
r s
A B
ďĄ 2
42.
ďŽ Notation: rs
Natural-Join Operation
ďŽ Let r and s be relations on schemas R and S respectively.
Then, r s is a relation on schema R ď S obtained as follows:
ďą Consider each pair of tuples tr from r and ts from s.
ďą If tr and ts have the same value on each of the attributes in R ď S, add a
tuple t to the result, where
ďŽ t has the same value as tr on r
ďŽ t has the same value as ts on s
ďŽ Example:
R = (A, B, C, D)
S = (E, B, D)
ďą Result schema = (A, B, C, D, E)
ďą r s is defined as:
ďr.A, r.B, r.C, r.D, s.E (ďłr.B = s.B ďr.D = s.D (r x s))
43.
Natural Join Operationâ
Example
ďŽ Relations r, s:
A B
ďĄ
ď˘
ď§
ďĄ
ď¤
1
2
4
1
2
C D
ďĄ
ď§
ď˘
ď§
ď˘
a
a
b
a
b
B
1
3
1
2
3
D
a
a
a
b
b
E
ďĄ
ď˘
ď§
ď¤
ď
r
A B
ďĄ
ďĄ
ďĄ
ďĄ
ď¤
1
1
1
1
2
C D
ďĄ
ďĄ
ď§
ď§
ď˘
a
a
a
a
b
E
ďĄ
ď§
ďĄ
ď§
ď¤
s
ďŽ r s
44.
Division Operation
ďŽ Notation:
ďŽSuited to queries that include the phrase âfor allâ.
ďŽ Let r and s be relations on schemas R and S respectively
where
ďą R = (A1, âŚ, Am , B1, âŚ, Bn )
ďą S = (B1, âŚ, Bn)
The result of r ď¸ s is a relation on schema
R â S = (A1, âŚ, Am)
r ď¸ s = { t | t ď ď R -S (r) ď ď˘ u ď s ( tu ď r ) }
Where tu means the concatenation of tuples t and u to produce a single
tuple
r ď¸ s
45.
Division Operation âExample
ďŽ Relations r, s:
ďŽ r ď¸ s: A
B
ďĄ
ď˘
1
2
A B
ďĄ
ďĄ
ďĄ
ď˘
ď§
ď¤
ď¤
ď¤
ď
ď
ď˘
1
2
3
1
1
1
3
4
6
1
2
r
s
46.
Another Division Example
AB
ďĄ
ďĄ
ďĄ
ď˘
ď˘
ď§
ď§
ď§
a
a
a
a
a
a
a
a
C D
ďĄ
ď§
ď§
ď§
ď§
ď§
ď§
ď˘
a
a
b
a
b
a
b
b
E
1
1
1
1
3
1
1
1
ďŽ Relations r, s:
ďŽ r ď¸ s:
D
a
b
E
1
1
A B
ďĄ
ď§
a
a
C
ď§
ď§
r
s
47.
Division Operation (Cont.)
ďŽProperty
ďą Let q = r ď¸ s
ďą Then q is the largest relation satisfying q x s ď r
ďŽ Definition in terms of the basic algebra operation
Let r(R) and s(S) be relations, and let S ď R
r ď¸ s = ďR-S (r ) â ďR-S ( ( ďR-S (r ) x s ) â ďR-S,S(r ))
To see why
ďą ďR-S,S (r) simply reorders attributes of r
ďą ďR-S (ďR-S (r ) x s ) â ďR-S,S(r) ) gives those tuples t in
ďR-S (r ) such that for some tuple u ď s, tu ď r.
48.
Assignment Operation
ďŽ Theassignment operation (ďŹ) provides a convenient way to express complex
queries.
ďą Write query as a sequential program consisting of
ďŽ a series of assignments
ďŽ followed by an expression whose value is displayed as a result of the
query.
ďą Assignment must always be made to a temporary relation variable.
ďŽ Example: Write r ď¸ s as
temp1ďŹ ďR-S (r )
temp2 ďŹ ďR-S ((temp1 x s ) â ďR-S,S (r ))
result = temp1 â temp2
ďą The result to the right of the ďŹ is assigned to the relation variable on the
left of the ďŹ.
ďą May use variable in subsequent expressions.
49.
Bank Example Queries
ďŽFind the names of all customers who have a loan and an account at
bank.
ďcustomer_name (borrower) ď ďcustomer_name (depositor)
ďŽ Find the name of all customers who have a
loan at the bank and the loan amount
ďcustomer_name, loan_number, amount (borrower loan)
50.
ďŹ Query 1
ďcustomer_name(ďłbranch_name = âDowntownâ (depositor account )) ď
ďcustomer_name (ďłbranch_name = âUptownâ (depositor account))
ďŹ Query 2
ďcustomer_name, branch_name (depositor account)
ď¸ ď˛temp(branch_name) ({(âDowntownâ ),
(âUptownâ )})
Note that Query 2 uses a constant relation.
Bank Example Queries
ďŽ Find all customers who have an account from at
least the âDowntownâ and the Uptownâ
branches.
51.
ďŽ Find allcustomers who have an account at all
branches located in Brooklyn city.
Bank Example Queries
ďcustomer_name, branch_name (depositor account)
ď¸ ďbranch_name (ďłbranch_city = âBrooklynâ (branch))
Generalized Projection
ďŽ Extendsthe projection operation by allowing arithmetic
functions to be used in the projection list.
ďŽ E is any relational-algebra expression
ďŽ Each of F1, F2, âŚ, Fn are arithmetic expressions involving
constants and attributes in the schema of E.
ďŽ Given relation credit_info(customer_name, limit,
credit_balance), find how much more each person can
spend:
ďcustomer_name, limit â credit_balance (credit_info)
)
(
,...,
, 2
1
E
n
F
F
F
ď
54.
Aggregate Functions andOperations
ďŽ Aggregation function takes a collection of values and returns a single
value as a result.
avg: average value
min: minimum value
max: maximum value
sum: sum of values
count: number of values
ďŽ Aggregate operation in relational algebra
E is any relational-algebra expression
ďą G1, G2 âŚ, Gn is a list of attributes on which to group (can be empty)
ďą Each Fi is an aggregate function
ďą Each Ai is an attribute name
)
(
)
(
,
,
(
),
(
,
,
, 2
2
1
1
2
1
E
n
n
n A
F
A
F
A
F
G
G
G ď
ď
ď
55.
Aggregate Operation âExample
ďŽ Relation r:
A B
ďĄ
ďĄ
ď˘
ď˘
ďĄ
ď˘
ď˘
ď˘
C
7
7
3
10
ďŽ g sum(c) (r) sum(c )
27
Aggregate Functions (Cont.)
ďŽResult of aggregation does not have a name
ďą Can use rename operation to give it a name
ďą For convenience, we permit renaming as part of
aggregate operation
branch_name g sum(balance) as sum_balance (account)
58.
Outer Join
ďŽ Anextension of the join operation that avoids loss
of information.
ďŽ Computes the join and then adds tuples form one
relation that does not match tuples in the other
relation to the result of the join.
ďŽ Uses null values:
ďą
null signifies that the value is unknown or does not exist
ďą All comparisons involving null are (roughly speaking)
false by definition.
ďŽ We shall study precise meaning of comparisons with nulls later
59.
Outer Join âExample
ďŽ Relation loan
ďŽ Relation borrower
customer_name loan_number
Jones
Smith
Hayes
L-170
L-230
L-155
3000
4000
1700
loan_number amount
L-170
L-230
L-260
branch_name
Downtown
Redwood
Perryridge
60.
Outer Join âExample
ďŽ Join
loan borrower
loan_number amount
L-170
L-230
3000
4000
customer_name
Jones
Smith
branch_name
Downtown
Redwood
Jones
Smith
null
loan_number amount
L-170
L-230
L-260
3000
4000
1700
customer_name
branch_name
Downtown
Redwood
Perryridge
ďŽ Left Outer Join
loan borrower
61.
Outer Join âExample
loan_number amount
L-170
L-230
L-155
3000
4000
null
customer_name
Jones
Smith
Hayes
branch_name
Downtown
Redwood
null
loan_number amount
L-170
L-230
L-260
L-155
3000
4000
1700
null
customer_name
Jones
Smith
null
Hayes
branch_name
Downtown
Redwood
Perryridge
null
ďŽ Full Outer Join
loan borrower
ďŽ Right Outer Join
loan borrower
62.
Null Values
ďŽ Itis possible for tuples to have a null value, denoted by
null, for some of their attributes
ďŽ null signifies an unknown value or that a value does not
exist.
ďŽ The result of any arithmetic expression involving null is
null.
ďŽ Aggregate functions simply ignore null values (as in SQL)
ďŽ For duplicate elimination and grouping, null is treated
like any other value, and two nulls are assumed to be
the same (as in SQL)
63.
Null Values
ďŽ Comparisonswith null values return the special truth value: unknown
ďą If false was used instead of unknown, then not (A < 5)
would not be equivalent to A >= 5
ďŽ Three-valued logic using the truth value unknown:
ďą OR: (unknown or true) = true,
(unknown or false) = unknown
(unknown or unknown) = unknown
ďą AND: (true and unknown) = unknown,
(false and unknown) = false,
(unknown and unknown) = unknown
ďą NOT: (not unknown) = unknown
ďą In SQL âP is unknownâ evaluates to true if predicate P evaluates to unknown
ďŽ Result of select predicate is treated as false if it evaluates to
unknown
64.
Modification of theDatabase
ďŽ The content of the database may be modified
using the following operations:
ďą Deletion
ďą Insertion
ďą Updating
ďŽ All these operations are expressed using the
assignment operator.
65.
Deletion
ďŽ A deleterequest is expressed similarly to a
query, except instead of displaying tuples to the
user, the selected tuples are removed from the
database.
ďŽ Can delete only whole tuples; cannot delete
values on only particular attributes
ďŽ A deletion is expressed in relational algebra by:
r ďŹ r â E
where r is a relation and E is a relational algebra
query.
66.
Deletion Examples
ďŽ Deleteall account records in the Perryridge branch.
ďŽ Delete all accounts at branches located in Needham.
r1 ďŹ ďłď branch_city = âNeedhamâ (account branch )
r2 ďŹ ď account_number, branch_name, balance (r1)
r3 ďŹ ď customer_name, account_number (r2 depositor)
account ďŹ account â r2
depositor ďŹ depositor â r3
ďŽ Delete all loan records with amount in the range of 0 to 50
loan ďŹ loan â ďłď amount ďłď 0ď and amount ďŁ 50 (loan)
account ďŹ account â ďłď branch_name = âPerryridgeâ (account )
67.
Insertion
ďŽ To insertdata into a relation, we either:
ďą specify a tuple to be inserted
ďą write a query whose result is a set of tuples to be inserted
ďŽ in relational algebra, an insertion is expressed by:
r ďŹ r ď E
where r is a relation and E is a relational algebra
expression.
ďŽ The insertion of a single tuple is expressed by letting
E be a constant relation containing one tuple.
68.
Insertion Examples
ďŽ Insertinformation in the database specifying that Smith has $1200
in account A-973 at the Perryridge branch.
ďŽ Provide as a gift for all loan customers in the Perryridge branch, a $200
savings account. Let the loan number serve as the account number for the new
savings account.
account ďŹ account ď {(âA-973â, âPerryridgeâ, 1200)}
depositor ďŹ depositor ď {(âSmithâ, âA-973â)}
r1 ďŹ (ďłbranch_name = âPerryridgeâ (borrower loan))
account ďŹ account ď ďloan_number, branch_name, 200 (r1)
depositor ďŹ depositor ď ďcustomer_name, loan_number (r1)
69.
Updating
ďŽ A mechanismto change a value in a tuple without
charging all values in the tuple
ďŽ Use the generalized projection operator to do this
task
ďŽ Each Fi is either
ďą the I th
attribute of r, if the I th
attribute is not updated, or,
ďą if the attribute is to be updated Fi is an expression,
involving only constants and the attributes of r, which
gives the new value for the attribute
)
(
,
,
,
, 2
1
r
r l
F
F
F ď
ď
ďŹ
70.
Update Examples
ďŽ Makeinterest payments by increasing all
balances by 5 percent.
ďŽ Pay all accounts with balances over $10,000 6 percent interest
and pay all others 5 percent
account ďŹ ď account_number, branch_name, balance * 1.06 (ďł BAL ďž 10000 (account ))
ď ď account_number, branch_name, balance * 1.05 (ďłBAL ďŁ 10000 (account))
account ďŹ ď account_number, branch_name, balance * 1.05 (account)