chapter.10

41
Chapter 10 Creating a Database

Upload: jdswitzer

Post on 17-Dec-2014

1.133 views

Category:

Technology


2 download

DESCRIPTION

 

TRANSCRIPT

Chapter 10Creating a Database

2Practical Microsoft Office 2010

What’s Inside and on the CD?

• In this chapter, you will be introduced to Microsoft Access and its powerful tools for:– Entering and updating information– Deleting information– Sorting data– Searching for specific data– Creating reports

3Practical Microsoft Office 2010

How is data organized in a database?

• Database software like Microsoft Access can be complex but is useful for organizing many types of data

• Access is designed for creating and accessing relational databases

• An Access database consists of tables– Each table contains a category of data

• Each table is similar to a stack of index cards

4Practical Microsoft Office 2010

How is data organized in a database?

• Each card in the stack contains similar information, which relates to a single entity.

• A database record is equivalent to one index card.

5Practical Microsoft Office 2010

How is data organized in a database?

6Practical Microsoft Office 2010

How is data organized in a database?

• Data can be displayed in different ways• The table view is a grid of rows and columns • Each row contains one record, equivalent to one

index card• Each cell in a row contains the data for one field• The table is composed of all fields in all rows,

equivalent to the entire stack of index cards

7Practical Microsoft Office 2010

How is data organized in a database?

8Practical Microsoft Office 2010

What’s in the Access window?

• To start Access:– Click Start– Click All Programs– Click Microsoft Office– Click Microsoft Office Access 2010

• When you start Access, the File tab appears. Use it to:– Connect to Microsoft Office Online– Search for an existing file– Create a new database– Open an existing database

9Practical Microsoft Office 2010

What’s in the Access window?

• With Access, you typically don’t create a new database but open an existing one to add to or edit data it contains

• Unlike other Microsoft programs, Access databases are not displayed as they will be printed

• Access provides several tools used to create, modify, and display data

10Practical Microsoft Office 2010

What’s in the Access window?

• Tools, used to create tables and simple queries, are contained in the Navigation Pane on left side of the database window

• Access offers many different ways to use each tool• Access is a complex software• In order to simplify introduction, some basic ways to

use most common tools will be introduced

11Practical Microsoft Office 2010

What’s in the Access window?

12Practical Microsoft Office 2010

How do I create a new database or open an existing database?

• Creating a database is different from a document, worksheet, or presentation

• In Access you first save an empty database, then create elements of database

• Elements include:– Tables– Reports– Forms– Queries

13Practical Microsoft Office 2010

How do I create a new database or open an existing database?

• To open an existing database:– Use the recent databases list– Use the Recent button– Use the Open button on the Access File tab.

14Practical Microsoft Office 2010

How do I create a new database or open an existing database?

15Practical Microsoft Office 2010

How do I create tables?

• You must specify the structure of tables, records, and fields before you can enter data

• A table contains records– Each record contains one or more fields

• Each field contains a type of data such as name or data

16Practical Microsoft Office 2010

How do I create tables?

• When you create a new database, Access creates an empty table named Table1

• You can create additional tables by clicking the Create tab and selecting the table tool

17Practical Microsoft Office 2010

How do I create tables?

• To define a field for a table, begin by selecting the data type– Text– Memo– Number– Date & Time– AutoNumber– Yes/No

• Enter a field name, following the Access rules for field names

18Practical Microsoft Office 2010

How do I create tables?

• Table contains an ID field designed to be used as the primary key– A field that uniquely identifies each record– Important that no two records are ever assigned

the same value for this unique field• Default data type is AutoNumber

– Can be modified to accept other primary key data• SKU’s• SSN’s• Telephone numbers

19Practical Microsoft Office 2010

How do I create tables?

20Practical Microsoft Office 2010

How do I create tables?

21Practical Microsoft Office 2010

How do I create tables?

22Practical Microsoft Office 2010

How do I save tables?

• Save frequently as a precaution against power outages or hardware glitches

• Quick way is to click the Save icon on the Quick Access toolbar– Supply name, and then table name will appear in the

tables list• If saving on a CD, DVD, or USB flash drive, do not remove

if from the computer until the Access window closes.• To open a table the next time, open the database and

then double-click the table in the Navigation pane.

23Practical Microsoft Office 2010

How do I save tables?

24Practical Microsoft Office 2010

How do I enter and edit data in a table?

• Once fields are defined for table, data for each entity becomes one record, or row, in table

• If table is not open, double-click the name of the table in the Navigation Pane

• An empty record is always displayed at bottom of table

25Practical Microsoft Office 2010

How do I enter and edit data in a table?

• You can use the Tab key to move from one field to the next

• Make sure data is consistent - for example, don't use PG-13 and PG 13 in same database

• To edit data, click cell containing data

26Practical Microsoft Office 2010

How do I enter and edit data in a table?

• Use left and right arrow keys to move insertion point within field

• Use Backspace and Delete to delete text to left or right of insertion point

• To delete entire record:– Right-click row header– Click Delete Record on shortcut menu– Click Yes button

27Practical Microsoft Office 2010

How do I enter and edit data in a table?

28Practical Microsoft Office 2010

Can I import data into a database?

• You can import data from files created with other software– Worksheets created with Excel– Databases created with older versions of Access– E-mail address books created with Outlook– Comma-delimited files

• A comma-delimited file, sometimes referred to as a CSV file, is data separated by commas

29Practical Microsoft Office 2010

Can I import data into a database?

• Many software applications offer an export option that creates a comma-delimited file

• Import a CSV file by selecting the Import text file from the External Data tab and then select the file

30Practical Microsoft Office 2010

Can I import data into a database?

31Practical Microsoft Office 2010

How do I work with tables?

• Working with data in Access can be similar to working with data in an Excel worksheet

• You can add, delete, move, sort, and search for data• Controls for these operations are on the ribbon

32Practical Microsoft Office 2010

How do I work with tables?

• Operations for working with tables include:– Modify data– Insert a record– Delete a record– Move a field– Hide a field– Sort records– Search

33Practical Microsoft Office 2010

How do I work with tables?

34Practical Microsoft Office 2010

How do I create a query using a wizard?

• Data in a table can be manipulated in many ways, e.g.:– search a company database for all customers in a

specific state• Create a query to search for records containing

particular data• A query contains criteria that specifies what you

want to find

35Practical Microsoft Office 2010

How do I create a query using a wizard?

• Use query to display some, but not all, fields in table• The Query Wizard is a quick way to learn about

simple queries and use them to locate data

36Practical Microsoft Office 2010

How do I create a query using a Wizard?

• Simple Query Wizard – What fields do you want in your query?– click a field– click button to add an individual field to query– click button to add all fields to the query– click button to remove an individual field from

query– click button to remove all fields from query

37Practical Microsoft Office 2010

How do I create a query using a Wizard?

• Simple Query Wizard – Would you like a detail or summary query?– Detail option shows all specified fields for records– The Summary option displays how many records

match your criteria• Simple Query Wizard – What title do you want for

your query?– Enter a title and click the Finish button to see the

results of your query

38Practical Microsoft Office 2010

How do I create a query using a Wizard?

• To refine search, specify query criteria – Example, to see only records of films after 1995:

• Right-click query tab• Click Design View on shortcut menu• Type >1995 in criteria row under Award Year

field• Click Run button on Query Tools Design

contextual tab

39Practical Microsoft Office 2010

How do I create a query using a Wizard?

• When window closed after viewing results of query specified by query criteria:– Message asking - Do you want to save changes to

design of query ‘Query Name’?– Click Yes if you want to use same criteria every

time you use query• After query is saved, you can use it repeatedly on all

data that matches criteria specified

40Practical Microsoft Office 2010

How do I create a query using a Wizard?

41Practical Microsoft Office 2010

How do I create a query using a Wizard?