In-Class Exercises

1.      Create a database named “Seller-Buyer” in Access 2007

2.      Create two tables named “Seller” and “Buyer” by importing the corresponding two Text files

3.      Assign primary keys and data types to field(s) in these two tables (if you haven’t done so when importing)

4.      Establish a relationship between these two tables 

5.      Find out answers to the following questions by using queries:

a.      What is the total number of records where there is a letter “e” in the Seller’s Last Name AND there is a number “3” in his/her Buyer’s Phone Number? Make a table named “Table a” from this query result with the field caption “Phone Number” changed to “Buyer Phone Number”

b.      What is the longest time between the Pay Date and the Win Date for records where the Item Price is between 10 to 100 dollars OR where the Pay Date is null? Export this query result to an Excel file named “Query b”.

c.       What is the average Item Price for records where there is a letter “o” in the Seller ID?

  Seller.txt

Seller ID     Seller Last Name    Seller First Name    Buyer ID     Item Price     Win Date    Pay Date   
AS36    Dang     Chou    2    20.12    12/30/07    12/31/07   
AU54    Hyde    Michelle    3    333.38    05/03/07    06/01/07   
BL92    Lopez    Javier    6    55.00    06/16/07    08/08/07   
CI76    Varter    Chris    3    12.33    04/04/08    06/26/08   
JO62    Place    Jordan    9    259.58    06/30/08    08/01/08   
KL55    Toys    Klingon    4    30.00    08/06/06    10/04/06   
ME71    Breeton    Alex    5    879.38    11/04/07    11/06/07   
MO13    Ferber    Jane    10    96.48    02/01/08    03/15/08   
RO32    Gammon    Fred     4    153.65    08/11/08       

  Buyer.txt

Buyer ID    Buyer Last Name    Buyer First Name    Phone Number    Street    City    State    Zip
1    Kline    Albert    555-267-1234    123 College Avenue    State College    PA    16802
2    Larson    Bonnie    555-267-1235    456 Beaver Avenue    State College    PA    16802
3    Marple    Christina    555-267-1236    789 Burrows Street    State College    PA    16802
4    Newton    Doug    555-267-1237    1020 Pugh Street    State College    PA    16802
5    Opal    Emily    555-267-1238    1834 Allen Street    State College    PA    16802
6    Paul    Frank    555-267-1239    8233 Shortlidge Street    State College    PA    16802
7    Quittner    Greg    555-267-1240    3412 Garner Street    State College    PA    16802
8    Renz    Harriet    555-267-1241    3123 Beaver Avenue    State College    PA    16802
9    Stout    Ivy    555-267-1242    103 Fairmont Street    State College    PA    16802
10    Todd    Jason    555-267-1243    9647 Allen Street    State College    PA    16802