Tables & Attributes
Access Tables with Attributes and Validation


Home

Site Map
 


Objective:

To create Access tables that supports your database plan.  To gain experience using the metadata construction tools of Access.  To create a data dictionary.   To see how databases can ensure validity of data via table lookup and validation rules that support the business rules.

Assignment:

Create 3 or more tables as defined by your E-R model. 

bulletEach table should have the necessary attributes.  
bulletTable and attribute names should be consistent and clear.
bulletDescriptions should be assigned to tables and to all but the most self explanatory attributes. 
bulletAttributes should be made easy to input and have high reliability by having  
bulletInput masks
bulletvalidation rules
bullet lookups (both value list and table)

Details:

Select "Create table in Design view".

There are 3 columns Field Name (Attribute name), Data type, Description.  In the lower right hand corner is blue text that has a bit of help and changes as you move from column to column. It reminds you that you should press F1 for help.  Access provides lots of help, just ask and always get as close to the "problems" as possible before asking so that your answer will be an answer to the question you have.

Attributes must be atomic.  That means:

bulletseparate name into title, first, last.  Separate address into street, city, state and zip.  
bulletsince books can have multiple authors, all names can not be put into one attribute.  A separate table would be needed with the book key (ISBN probably) and the author name as keys and probably no other attributes.

Be sure to give complete names like Student_Home_City 
Take care to avoid:

bulletsynonyms (the same name for different things like StreetAddress in two tables, one being the street address of a student and the other the StreetAddress of a Professor)
bullethomonyms (different names for the same thing).

Avoid abbreviations and avoid very long names.  This is compromise.  If you abbreviate something,  stick to that abbreviation scheme throughout the database (consistency is the goal).  For example, if you abbreviate address as "addr", then ALWAYS use addr, student_addr, prof_addr, etc, never use the full word address.

Access permits spaces in attribute names, but most other DBMS do not.  So instead of a space use an underscore or nothing.

Choose the appropriate data type from the dropdown

That will cause the Field Properties box to display proprieties. 

For text fields:

bulletbe sure to adjust Field Size (or example State should be only 2) 
bulletuse a Input Mask (use Help and wizards for phone and social security and others) to improved data quality when possible 

Select a format for date and Number (Byte must be less than  256, but don't cut it close, use only for things that will be under 100.  Integer for 32k or less, again stuff that is in the low thousands, everything else Long Integer.

Default values make entry easier because that value is already keyed, but can be changed.  Required can be dangerous because if the person does not know what goes into the field they will make something up just to get the computer off their back and there is no way to find out what is a made up value and what is a correctly entered value.  If a field is not required and nothing is put there (including no default), then the filed will get a null value and a query can be make to find all rows with null values.

Validation rules ensure good data but like Required if they are too strict, data entry personnel will make up values that satisfy the system.   

Well worded Descriptions of each attributes should be given.  The function of  Access's description field is to provide a Data Dictionary definition for the the attributes in the table.  Do not simply repeat the attribute name in the description.  Don't waste description space repeating the attribute name, provide additional description of what function the attribute plays.  What is it? If validation is used, it should be explained.  Foreign keys should be noted.  Example data provides very descriptive information. 

Attributes should be indexed if queries are made based upon those values.  For example, if the data is frequently requested based upon date, then date should be indexed. 

When you are done, click the close X.  Access won't let you leave without saving.  Select a meaningful entity name for your table.  Access would also like you to give the table a key, it will even give you an Autonumber is you can't thing of a key.  At this point we have not covered keys so tell Access to forget it.  You will identify the primary key later.

Create is one table per entity.  Give each table a meaningful name and Description.  Note that descriptions will appear on the Data Objects window if you select the last icon to the right.  You can then increase/decrease the size of the window, the size of each column (Name, Description and Modified).  You can also sort the tables in ascending or descending order by clicking on the word Name, Description or Modified.

Procedure:

  1. Create 3 tables per details above 
  2. Compact and upload it to your virtual drive and post summary  of what you did on the Bulletin Board.
  3. Post summary  of what you did on the Bulletin Board indicating your work is ready to be reviewed.
  4. Submit for assignment for feedback from proof and first draft grade
  5. Check if your teammates or other class members have posted that their Database tables are ready for review
    If so download their Access MDB file from their virtual drive
    Open it with Access.  Review the tables and attributes
    Study each table looking 
    bulletthat all tables have a Meaningful Descriptions
    In the objects window select a details display (click the rightmost icon on the top of the window)

    After clicking the Design icon scrutinize the attributes:

    bulletDo all attributes have meaningful and consistent names?  Does each have a description? Are foreign keys noted?
    bulletAre the data types correct and  lengths reasonable?
    bulletAre correct formats chosen?
    bulletDo phone numbers, social security numbers etc. have input masks?
    bulletDo some have validation rules, any required, any defaults?  Can you think of some more that should be there? 
    bulletSwitch to the Lookup tab.  Is a table lookup used when the user might want to change values  and a value list used when the set of values is quite static?
    bulletTry to enter data into each table.  Did you have any problems?.
  6. Post suggestions on the Bulletin Board
  7. Imitate good ideas in your tables
  8. Look for suggestions to your Tables
    bulletincorporate suggestions into your design and upload to your Virtual Hard again then note improvement  on the Bulletin Board or
    bulletpost reasons you think suggestions won't work
  9. Continue to do steps 5 to 8  as often as needed.

[Site Map ] Home ]

This page was created by Professor Maureen Greenbaum and was last updated on 02/04/06
Page Name:  Tables & Attributes
URL:             http://faculty.ucc.edu/business-greenbaum/DB/AsgnmntTable.htm
Disclaimer:    http://www.ucc.edu/professional_disclaimer.htm
Copyright:      ãMaureen Greenbaum 2001, 2002.  All rights reserved.