Professional Documents
Culture Documents
Ms Access
Ms Access
BillingDate Date/Time
InvoiceAmt Currency
Adding Records to a Table
Enter data sequentially in Datasheet view
Do not jump from field to field
Use tap key to enter data
Add following data to each filed: 211, 201, paid (mark the
DB first
Importing External Access Table and
Excel Worksheet (con’t)
And she wants you to include the Billing Address
Excel worksheet as a Access table in the Restaurant
database.
Before try to import the excel file, review it first
Use Excel column headings for Access table
PK: CustomerNum
Specify in the description area of Design View that
CutomerNum is not only primary key of
BillingAddress table but also a foreign key of
Customer table.
Access is a relational database
Access allows you to form relationships between the
tables; that’s why it’s called a relational database
The simplest way to create a relationship
Look for identical field names between tables.
Tables can be joined in three ways; one-to-one, one-
to-many, and many-to-many.
An example of a
one-to-many relationship
The Employer table is related to the Position table via the common field EmployerID.
000 Choi COB 105 CSUB CA 93311 Scott Choi 5348 09/20/2001
Order Table
OrderNum CustomerNum Paid InvoiceAmt BillingDate
201 107 No 854.00 01/15/2001
Product Table
ProductCode CoffeeName Weight/Size Price Decaf
2301 Colombian Aged Crop 1 lb pkg 7.99
More about a Query
When you use the query design window, you use
Query By Example (QBE).
Do not include any unnecessary tables or queries in
Design View of the query.
Otherwise, you have to deal with unexpected problems.
In your midterm, you will be penalized if you include
unnecessary tables or queries.
Always use a primary table.
CustomerNum: Customer vs. BillingAddress
Restrictions can be used as well.
Creating Queries using
Multiple Tables
Since there have been some major changes in the
Restaurant database, Barbara wants to make sure
that the database is reliable. In order to test the
reliability of database query function, She wants
you to generate a query. The query must include
following fields: Order Number, Coffee Name,
Quantity, Price, and Weight/Size.
Save as Test
Should select OrderNum from the Order table
(primary table)
Querying and Sorting of
multiple Tables
Barbara wants to have following information for the
upcoming quarterly report: CustomerName, City,
State, BillingDate, InvoiceAmt, Paid, and First
Contact.
At same time, Barbara wants to sort the records by
the InvoiceAmt field in ascending order.
Barbara also wants to move the Paid field between
the State and BillingDate field.
Save as Customer Orders
Expressions
The And
condition.
The Or
condition.
Creating And and Or conditions
in the design grid
The subform
navigation bar.