Assignment 2

advertisement
ASSIGNMENT 2
Necessary data Files: LuckyTire.accdb (created in Tutorial 1), Customers.csv, and Sales.xlsx
Len Phan, the owner of Lucky Tire, wants you to expand the LuckyTire database to store additional company data.
Specifically, he wants to keep track of customer and sales data. You will need to add a table for customers, and
another table for their tire purchases .
1.
Open the LuckyTire database. Save the database where you save your data files.
2.
Open the Tires table and in Design View, set the following field properties:
Field Name
PartID
Model Name
Manufacturer
Unit Price
Type
Data Type
Text
Text
Text
Currency
Text
Field Size
5
20
20
2 Decimal Places
12
Save and close the Tires table.
3.
Len gave you a text file named Customers.csv that includes the customer data he used to maintain in another
computer. Import the data from the Customers.csv into a new table in the LuckyTire database.







4.
Specify Customers.csv as the source of your data.
Select Import the source data into a new table in the current database
Select import in a delimited format.
Select comma delimited and click the First Row Contains Field Names checkbox.
Select the Indexed option Yes (No Duplicates).
Choose CustID as the primary key.
Name the new table Customers. (Do not save import steps.)
Open the Customers table. Resize the columns as necessary to fit the data, and then set the following properties
for the fields:
Field Name
CustID
First
Last
Address
City
State
Zip
Phone
Make
Model
Year
Data Type
Text
Text
Text
Text
Text
Text
Text
Text
Text
Text
Text
Description
Primary Key
Save and close the Customers table.
1of 2
Field Size
5
20
20
35
25
2
5
14
15
15
4
5.
Use Design View to create a new table named Sales using the following table design.
Field Name
Invoice
InvoiceDate
CustID
PartID
Quantity
6.
Data Type
Text
Date/Time
Text
Text
Number
Description
Primary Key
Field Size
5
Short Date
5
5
Long Integer
Foreign Key
Foreign Key
Add the following two records to the Sales table, and then save the table.
Invoice
77340
77341
Date
5/5/2010
5/5/2010
CustID
50173
50211
PartID
Y450T
G812T
Quantity
1
1
7.
Len used an Excel spreadsheet named Sales.xlsx to track recent Lucky Tire sales information. Append a
copy of the records from Sales.xlsx to the Sales table. Open the Sales table. Resize all of the columns to their
best fit, then save and close the Sales table.
8.
A customer can be associated with multiple sales order. However, a sales order must correspond to only one
customer. Define the one-to-many relationship between the primary Customer table and the related Sales table.
Select the Enforce Referential Integrity option and Cascade Update Related Fields option for this relationship.
9. A sale is associated with a specific tire model. define the one-to-many relationship between the primary Tires
table and the related Sales table. Select the Enforce Referential Integrity option and Cascade Update Related
Fields option for this relationship. Save the changes to the Relationships Window. Compact and
repair the LuckyTire database, and then close the database.
2of 2
Download