Access Assignment

55 downloads 2866 Views 65KB Size Report
Mar 24, 2010 ... See scoring schema at the end of this assignment. For this database project, you will use MS Access to create a database of vendors, and the ...
ITEC 1050, Fall 2010, Database Assignment Assignment Date Due Date

Percent of the Grade Method of Submission

Thursday, March 24, 2010 THURSDAY, April 15, 2010 @ 11:59pm. Cutoff date is SATURDAY, April 17 @ 11:59pm. Submissions will NOT be accepted after the cutoff date/time. 15% of the course’s grade o Your file must be submitted by email o NO OTHER METHOD of submission will be accepted See scoring schema at the end of this assignment

Scoring

For this database project, you will use MS Access to create a database of vendors, and the related items they sell to your hardware store. For example, if you are Lowe’s® or Home Depot®, you purchase items to sell from various vendors, such as Black and Decker®. Some of those items may be power tools or hand tools. You may purchase items for sale from other vendors, such as garden tools. Your database will be made up of two tables: • • •

The vendor table, which is the parent – it will contain at least five vendors in it. And the item table, which is the child – it will contain at least three items for each vendor. In this project, you will: 1. 2. 3. 4. 5. 6.

Design the Table Structure Enter the Data Relate the two tables. Then delete one Item record. Create thee Queries. These queries do not have to be physically printed. Create one Report. The report does not have to be physically printed. In addition, you may choose to create yet another report for up to 5 points extra credit. This too does not have to be physically printed.

1. DESIGN YOUR TABLE STRUCTURE. You will do this for both tables. You will do this without using a wizard, as demonstrated in class. Please note the information below describing both tables. Your tables must include the information below. You must have the same field names, and each field must have the same data type, same field size and other information that must be defined in the Field Properties. DATABASE NAME – When you save your database, you must save it as Hardware-Store. VENDOR TABLE Field Name Vendor ID

Data Type Text

Field Size 5 Chars

Vendor Name Vendor City Vendor State

Text Text Text

20 Chars 12 Chars 2 Chars

Katz/Williams

-1-

Other Information Primary Key – may contain alpha and numeric. You create this, do not use autonumber.

Must be uppercase

04/06/10

ITEC 1050, Fall 2010, Database Assignment ITEM TABLE Field Name Item ID Description Vendor ID

Data Type Auto-number Text Text

20 Chars 5 Chars

List Price On-Hand Qty Item Type

Currency Number Text

Long Integer 4 Chars

On Sale

Yes / No

Field Size

Other Information Primary Key, this must be autonumber For each record, the data element in this field must exist in the Vendor Table Leave decimal places as auto Codes must be validated, and must be in upper case. The codes are TOOL, GRDN, ELEC, and OTHR. Default is OTHR.

Follow the instructions given in the handout to save your database, define its fields, and enter your data. Although the databases, tables, and fields are different, the procedures are the same as in the handout, and as described in class. 2. ENTER YOUR DATA Enter your data directly into the table. You can make up fictitious data, but it must be reasonable, because we will be sorting and making queries from this data. An example of what one Vendor record may look like: VENDOR ID VID01 VENDOR NAME Black and Decker VENDOR CITY Chicago VENDOR STATE IL An example of what one Item record may look like: ITEM ID 1 DESCRIPTION Power Drill VENDOR ID VID01 LIST PRICE $39.95 ON-HAND QTY 10 ITEM TYPE TOOL ON SALE No Feel free to use the two records above as the first records in your Vendor and Item tables, respectively. Your inventory items will be classified according to four different Item Types. Your items table must contain at least three records with each of the following Item Types: TOOL Tools GRDN Garden items ELEC Electrical items OTHR Other items You must validate that the values keyed into Item Type are one of the four types listed above, and display an appropriate error message when something else is keyed in. In addition, your Item Table must contain the following data combinations to test your criteria:

Katz/Williams

-2-

04/06/10

ITEC 1050, Fall 2010, Database Assignment • •

You must have at least two Item Type TOOL records, one that is On Sale, and one that is not On Sale You must have at least two On Sale records who’s Item Type is not TOOL.

3. RELATING THE TABLES Now you must relate the two tables to each other. You are going to follow the procedure described in class (TOOLS drop-down menu, RELATIONSHIPS command) to relate the parent Vendor table to the child Item table. They will be related via the Vendor Table’s VENDOR ID to the Item Table’s VENDOR ID. Before you create your relationship, you must be sure that at least one record match exists between the two tables. When you create your relationship, you must be sure to specify that you will be enforcing referential integrity. After you have created your relationship, and have entered all of your data (you may have entered all of your data before creating the relationship – that’s OK), you will need to delete one record, as demonstrated in class. You will need to delete one record from the Item Table (not the Vendor Table). You should delete a record that is not the last record in your table. If you have 17 records, don’t delete the 17th record. By looking at the numbered Item ID s, I’ll be able to tell that you successfully deleted one record. 4. QUERIES Joined Query • Using Design View, create a joined query on your data. • When you create your query, add both tables to the query. As in class, the relationship should be displayed in the Query by Example grid. • Select from the Vendor Table: o Vendor ID o Vendor Name • Select from the Item Table: o Item ID o Item Description o List Price o On-Hand Qty o Item Type • Sort the query (click in the sort fields in the definition grid) descending by Vendor Name (from the Vendor Table), then ascending by Item ID (from the Item Table) • Run the query to make sure it displays the data correctly. • Save the query as Joined Query and then exit. Tools on Sale Query • Using Design View, create a joined query on your data. • When you create your query, add only the Item table to the query. • The query (using the Criteria row) should only include rows that are both On Sale and Item Type TOOL. In addition, do not show the On Sale field. • Even though your result may only be one item, sort this query descending by Item Code (just in case you have more than item in your results). • Run the query to make sure it displays the data correctly. • Save the query as Tools on Sale Query and then exit.

Katz/Williams

-3-

04/06/10

ITEC 1050, Fall 2010, Database Assignment 5. REPORTS Using the Report Wizard, create a report on your ITEM TABLE data. Choose all fields except On Sale Item, using the arrow >. Group the items by Item Type. Then sort the records in descending order by Item ID. Choose Align Left 1 or Align Left 2 and Landscape. Choose any print style you like. For the Title, use Inventory Items Report. 6. EXTRA CREDIT Use the method shown in class to create a report of Vendors and Items based on your Joined Query. Name this report your Items by Vendor report.

Scoring Schema Design of Tables Vendor Table Vendor ID As primary key - text Vendor Name Vendor City Vendor State Uppercase Subtotal

Data Composition Vendor Table - at least 5 vendors Item Table - at least 3 items per vendor 2 TOOL items 1 TOOL on-sale 1 TOOL not on-sale 2 on-sale NOT TOOL Subtotal

1 2 1 1 1 2 8

Relationships Vendor parent to Item

Item Table Item ID As primary key - autonumber Description Vendor ID List Price As currency On-Hand Qty Item Type Validation Rule Validation Text Default Value Upper Case On Sale - as Yes / No Subtotal

Referential inegrity enforced (ie, oneto-many, not one-to-one) One item deleted Subtotal

1 2 1 1 1 2

Queries Joined Query

1 1 2 2 2 2 2 20

4 12

4 8 4 4 4 4 28

Report Grouped by Item Type Sorted descending by Item ID Landscape Subtotal

8 8 4 16

Extra Credit Items by Vendor Report (max of 10) GRAND TOTAL

-4-

4 4

Sorted descending by Vendor Name and then ascending by Item ID Tools on Sale Query Descending by Item Code Both on-sale and type TOOL Don't show on-sale Subtotal

TOTAL

Katz/Williams

2 2 3 3 3 3 16

100

10 110

04/06/10