Presentation is loading. Please wait.

Presentation is loading. Please wait.

Creating a Simple Database with Microsoft Access 2007

Similar presentations


Presentation on theme: "Creating a Simple Database with Microsoft Access 2007"— Presentation transcript:

1 Creating a Simple Database with Microsoft Access 2007
Health Science Center IT Center – Training

2 Basic Database Concepts
Name: Barry Harris College: Medicine Tel: Table A set of related records Record Name: Barry Harris College: Medicine Tel: A collection of data about an individual item Field Name: Barry Harris A single item of data common to all records

3 An Example of a Table Fields Records Name GatorLink Phone College
Graff rgraff Pharmacy Harris bharris Medicine Ipswich zipswich PHHP

4 You can join fields together in queries, forms and reports.
Basic Design Rules Data is broken down into Smallest Logical Parts Putting all of the home address in one field may make for convenient data entry, but it makes it very difficult to work with the data. For example, what if I needed to sort by City or Zip Code? Pulling fields together is fairly simple, pulling them apart is very difficult. PT ID # Home Address 987 123 West Main Street, Gainesville, FL 32601 654 456 South 3rd Road, Apt 12, Newberry, FL 32684 321 846 West Newberry Road, Gainesville, FL 32609 You can join fields together in queries, forms and reports.

5 Basic Design Rules Unique Field Names
You also want to be aware of the field names across tables. For example several tables may use the Field LastName. When you use those fields in other parts of the database things can become very confusing very quickly. DOCTOR TABLE First Name Last Name Sallye Shapiro Samuel Smith Sidney Samueson PATIENT TABLE First Name Last Name Annie Adams April Appleton Arnold Arlington Bobbie Brown Butch Bruce When these two Last Name fields are pulled into the same Query/Form/Report they will appear with the table name in front of the field name: Patient Table.Last Name

6 Access will let you create calculations in queries, forms and reports.
Basic Design Rules No Calculated or Derived Fields Calculations - If we give an employee a raise, we will need to change both the Hourly Rate and the Standard Pay, and we need to make sure our calculations are correct. Derivations - Since we have the Dept ID, there is no need to include the Dept Name, it can be pulled from the Dept Table. Listing it in both places leads to data entry errors. Employee ID Num Hourly Rate Standard Hours Standard Pay Dept ID Num Dept Name 123 $10.00 40 $390.00 12 Editing 789 20 $200.00 Edit Access will let you create calculations in queries, forms and reports.

7 Basic Design Rules Unique Records
If you don’t have unique records, your database can’t tell which record you may be referring to. LastName GatorLink Phone College Smith rsmith 3-5051 Pharmacy COP Thomas bthomas Medicine Van Winkle sleepyguy PHHP LastName EmergencyContact Smith Mary Anne Smith

8 Primary Keys LastName GatorLink Phone College Smith rsmith Pharmacy Thomas bthomas Medicine Van Winkle sleepyguy PHHP To ensure that each record is unique in each table, we can set one field to be a Primary Key field. A Primary Key is a field that that will contain no duplicates and no blank values. Looking at the table above, what would be the best Primary Key?

9 Primary Keys LastName GL ID Phone College Smith rsmith Pharmacy Thomas Bthomas Medicine Van Winkle sleepyguy PHHP While each column in this particular data set has unique data, the field that will work best for us is GL ID (GatorLink). Many employees will work for the same college, have the same last name and possibly even share telephone numbers, but each employee should have a unique GatorLink ID. When there is not a unique field in your data set, you can use an AutoNumber. Access can create incremented or random AutoNumbers for your primary key.

10 Basic Design Rules Unique Records
We use the unique primary key as our link between our tables, this helps ensure we connect to the correct record. ID LastName GatorLink Phone College 1 Smith rsmith 3-5051 Pharmacy 2 COP 3 4 Thomas bthomas Medicine 5 Van Winkle sleepyguy PHHP Emp ID EmergencyContact 2 Mary Anne Smith

11 Planning our Patient Table
What have I got? Name Address Phone Age Medical Record # Emergency Contact Height Weight Date of Last Visit DOB Medications SSN Insurance Allergies Gender Age at First Visit

12 Planning our Patient Table
Does the data belong in this table? Name Address Phone Age Medical Record # Emergency Contact Height Weight Date of Last Visit DOB Medications SSN Insurance Allergies Gender Age at First Visit

13 Planning our Patient Table
Smallest Logical Parts Name First/Last Address/City/ST/Zip Phone Age Medical Record # Date of Last Visit DOB SSN Gender Age at First Visit

14 Planning our Patient Table
Unique Field Names Pt First Name Pt Last Name Pt Address Pt City Pt ST State Pt Zip Pt Phone Pt Age Pt Medical Record # Pt Date of Last Visit Pt DOB Birth Date Pt SSN Social Sec # Pt Gender Pt Age at First Visit

15 Planning our Patient Table
No Calculated or Derived Fields Pt First Name Pt Last Name Pt Address Pt City Pt State Pt Zip Pt Phone Pt Age Pt Medical Record # Pt Date of Last Visit Pt Birth Date Pt Social Sec # Pt Gender Pt Age at First Visit

16 Planning our Patient Table
Primary Key Pt First Name Pt Last Name Pt Address Pt City Pt State Pt Zip Pt Phone Pt Medical Record # Pt Birth Date Pt Social Sec # Pt Gender (AutoNumber)

17 Planning our Patient Table
Final Plan Pt Med Rec # Pt First Name Pt Last Name Pt Gender Pt Birth Date Pt Phone

18 Let’s Build our Database!


Download ppt "Creating a Simple Database with Microsoft Access 2007"

Similar presentations


Ads by Google