Docstoc

My first Access database

Document Sample
My first Access database Powered By Docstoc
					My first Access database

       A phone book
        Relational Database
• Things we will do to our database:
  – Design the database
  – Create the database
  – Populate the database (insert data into it)
  – Query the database
• Other things?
  – Modify a database’s design
  – Modify a database’s data
    Designing the database…
• We must first consider these questions:

  – What data do I want to store?

  – How is it related?

  – What will I use the data for in the future?
        What data do I want to store?
 • If we are working with a phone book we
   may want to store data such as:
                             Phonebook Entries




        Name                        Address                  Phone Number


First    MI    Last   Line1 Line2    City     State   Zip   Area Phone   Ext
                      How is it related?
 • For every phonebook entry there is some
   name, address, and phone number
                              Phonebook Entries




        Name                         Address                  Phone Number


First    MI    Last    Line1 Line2    City     State   Zip   Area Phone   Ext
    How will I use the data in the
                future?
• I may want to…
  – Find the phone number of an individual when
    I only know their name
  – Find the phone number of an individual at a
    particular address
  – Find the name of an individual who owns a
    particular phone number
  – Print a list of names and phone numbers of
    people who have a particular zip code
  – Etc.
      Other considerations…
• Will multiple people share same phone
  number, address, or name?

• Will I have new needs for this database in
  the future?
  – How can I plan ahead to accommodate
    potential changes?
     Creating the database…
• Decide which information to store as fields
  in the same table

• Every record must have a unique ID

• Decide a type for each field in a table

• Decide any relationship between tables
 Which fields to store in the same
               table?
• Database designers are typically urged to
  keep information separate. This allows for
  more convenient storage, faster searches,
  and a more flexible database…
• We are going to ignore that for now and
  store our data in one table called
  PhoneEntries…
           What fields will we use?
Table: PhoneEntries


  First   MI     Last   Line1 Line2   City   State   Zip   Area Phone   Ext




   What types will each field use?
Table: PhoneEntries
  First   MI     Last   Line1 Line2   City   State   Zip   Area Phone   Ext

  Text    Text   Text   Text   Text   Text   Text    Num   Num   Num    Num
      Populating the database
• In Datasheet view it is like editing a row of
  an Excel spreadsheet

				
DOCUMENT INFO
Shared By:
Categories:
Stats:
views:11
posted:9/2/2011
language:English
pages:11