Datasheet

18
Part I: Basic Concepts
shows data flowing into the accounts-payable manager’s view from both the
CUSTOMER and INVOICE tables.
Figure 1-5:
The branch
manager’s
view
includes
only
certain rows
from the
CUSTOMER
table.
CUSTOMER Table
Customer ID
FirstName
LastName
Street
City
State
Zipcode
Phone
BRANCH_MGR View
FirstName
LastName
Phone
INVOICE Table
InvoiceNumber
CustomerID
Date
TotalSale
TotalRemitted
FormOfPayment
Zipcode > = 90000 AND Zipcode < = 93999
Views are useful because they enable you to extract and format database
data without physically altering the stored data. They also protect the
data that you don’t want to show, because they don’t contain it. Chapter 6
illustrates how to create a view by using SQL.
Figure 1-6:
The
accounts-
payable
manager’s
view draws
from two
tables.
CUSTOMER Table
Customer ID
FirstName
LastName
Street
City
State
Zipcode
Phone
FirstName
LastName
Date
Total Sale
TotalRemitted
FormOfPayment
ACCTS_PAY View
INVOICE Table
InvoiceNumber
CustomerID
Date
TotalSale
TotalRemitted
FormOfPayment
TotalRemitted < TotalSale