SlideShare a Scribd company logo
1 of 27
Download to read offline
Tutorial 9

    Using Action Queries and
  Advanced Table Relationships
Microsoft Access 2010
            ®
Objectives                                       XP


      • Create an action query to create a table
      • Create action queries to append, delete, and
        update data
      • Define many-to-many and one-to-one
        relationships between tables
      • Learn about joining tables
      • Join a table using a self-join
      • View and create indexes for tables

New Perspectives on Microsoft Access 2010                   2
Action Queries                        XP




New Perspectives on Microsoft Access 2010        3
Action Queries                                XP


      • An action query is a query that adds, changes,
        or deletes multiple table records at a time
         – Make-table query
         – Append query
            • History table
         – Delete query
         – Update query


New Perspectives on Microsoft Access 2010                4
Creating a Make-Table Query                    XP


      • Create a select query with the necessary fields
        and selection criteria
      • In the Results group on the Design tab, click
        the Run button to preview the results
      • Switch to Design view to make any necessary
        changes to the query. When the query is
        correct, click the Make Table button in the
        Query Type group on the Design tab


New Perspectives on Microsoft Access 2010                 5
Creating a Make-Table Query                   XP


      • In the Make Table dialog box, type the new
        table name in the Table Name box. Make sure
        the Current Database option button is selected
        to include the new table in the current
        database; or, click the Another Database
        option button and enter the database name in
        the File Name box. Then click the OK button
      • Click the Run button, and then click the Yes
        button to confirm the creation of the new
        table
New Perspectives on Microsoft Access 2010                6
Creating a Make-Table Query           XP




New Perspectives on Microsoft Access 2010        7
Creating an Append Query                            XP

      • Create a select query with the necessary fields and
        selection criteria
      • In the Results group on the Design tab, click the Run
        button to preview the results
      • Switch to Design view to make any necessary changes
        to the query. When the query is correct, click the
        Append button in the Query Type group on the
        Design tab




New Perspectives on Microsoft Access 2010                       8
Creating an Append Query                             XP

      • In the Append dialog box, select the table name in
        the Table Name box. Make sure the Current Database
        option button is selected to include the new table in
        the current database; or, click the Another Database
        option button and enter the database name in the
        File Name box. Then click the OK button. Access
        replaces the Show row in the design grid with the
        Append To row
      • Click the Run button, and then click the Yes button to
        confirm appending the records to the table


New Perspectives on Microsoft Access 2010                        9
Creating an Append Query              XP




New Perspectives on Microsoft Access 2010        10
Creating a Delete Query                              XP

      • Create a select query with the necessary fields and
        selection criteria
      • In the Results group on the Design tab, click the Run
        button to preview the results
      • Switch to Design view to make any necessary changes
        to the query. When the query is correct, click the
        Delete button in the Query Type group on the Design
        tab. Access replaces the Show and Sort rows in the
        design grid with the Delete row
      • Click the Run button, and then click the Yes button to
        confirm deleting the records
New Perspectives on Microsoft Access 2010                        11
Creating a Delete Query               XP




New Perspectives on Microsoft Access 2010        12
Creating an Update Query                       XP


      • Create a select query with the necessary fields
        and selection criteria
      • In the Results group on the Design tab, click
        the Run button to preview the results
      • Switch to Design view to make any necessary
        changes to the query. When the query is
        correct, click the Update button in the Query
        Type group on the Design tab. Access replaces
        the Show and Sort rows in the design grid with
        the Update To row
New Perspectives on Microsoft Access 2010                 13
Creating an Update Query                         XP


      • Type the updated values in the Update To
        boxes for the fields you want to update
      • Click the Run button, and then click the Yes
        button to confirm changing the records




New Perspectives on Microsoft Access 2010                   14
Many-To-Many Relationship             XP




New Perspectives on Microsoft Access 2010        15
Relationships Between Database        XP
      Tables




New Perspectives on Microsoft Access 2010        16
Relationships Between Database        XP
      Tables




New Perspectives on Microsoft Access 2010        17
Defining M:N and 1:1                  XP
      Relationships Between Tables




New Perspectives on Microsoft Access 2010        18
Joining Tables                               XP


      • An inner join is a join in which the DBMS
        selects records from two tables only when the
        records have the same value in the common
        field that links the tables




New Perspectives on Microsoft Access 2010               19
Joining Tables                                  XP


      • An outer join is a join in which the DBMS
        selects all records from one table and only
        those records from a second table that have
        matching common field values




New Perspectives on Microsoft Access 2010                  20
Creating a Self-Join                              XP


      • Click the Create tab on the Ribbon
      • In the Queries group on the Create tab, click
        the Query Design button
      • In the Show Table dialog box, double-click the
        table for the self-join, double-click the table a
        second time, and then click the Close button
      • Click and drag the primary key field from one
        field list to the foreign key field in the other
        field list

New Perspectives on Microsoft Access 2010                    21
Creating a Self-Join                              XP


      • Right-click the join line between the two
        tables, and then click Join Properties to open
        the Join Properties dialog box
      • Click the first option button to select an inner
        join, or click the second option button or the
        third option button to select an outer join, and
        then click the OK button
      • Select the fields, specify the selection criteria,
        select the sort options, and set other
        properties as appropriate for the query
New Perspectives on Microsoft Access 2010                    22
Creating a Self-Join                  XP




New Perspectives on Microsoft Access 2010        23
Viewing a Table’s Existing IndexesXP
      • Open the table in Design view
      • To view an index for a single field, click the
        field, and then view the Indexed property in
        the Field Properties pane
      • To view all the indexes for a table or to view
        an index consisting of multiple fields, click the
        Indexes button in the Show/Hide group on the
        Design tab


New Perspectives on Microsoft Access 2010                   24
Viewing a Table’s Existing IndexesXP




New Perspectives on Microsoft Access 2010    25
Creating an Index                                XP


      • Open the table in Design view
      • To create an index for a single field, click the
        field, and then set the Indexed property in the
        Field Properties pane
      • To create an index consisting of multiple fields,
        click the Indexes button in the Show/Hide
        group on the Design tab, enter a name for the
        index in the Index Name box, select the fields
        in the Field Name box, and then set other
        properties as necessary for the index
New Perspectives on Microsoft Access 2010                   26
Creating an Index                     XP




New Perspectives on Microsoft Access 2010        27

More Related Content

What's hot

Defining Table Relationships
Defining Table RelationshipsDefining Table Relationships
Defining Table RelationshipsIIUI
 
basic database concepts
basic database conceptsbasic database concepts
basic database conceptsIIUI
 
Pagelayout & data tab of ms excel 2010
Pagelayout & data tab of ms excel 2010Pagelayout & data tab of ms excel 2010
Pagelayout & data tab of ms excel 2010Nitish Kumar
 
Access 2010 Unit B PPT
Access 2010 Unit B PPTAccess 2010 Unit B PPT
Access 2010 Unit B PPTokmomwalking
 
Tutorial 6: Multiple Worksheets and Workbooks
Tutorial 6: Multiple Worksheets and WorkbooksTutorial 6: Multiple Worksheets and Workbooks
Tutorial 6: Multiple Worksheets and Workbookscios135
 
Excel 2010 Unit C PPT
Excel 2010 Unit C PPTExcel 2010 Unit C PPT
Excel 2010 Unit C PPTokmomwalking
 
Access 2010 Unit C PPT
Access 2010 Unit C PPTAccess 2010 Unit C PPT
Access 2010 Unit C PPTokmomwalking
 
Tutorial Excel
Tutorial ExcelTutorial Excel
Tutorial Excelsoleicita
 
Access 2010 Unit D PPT
Access 2010 Unit D PPTAccess 2010 Unit D PPT
Access 2010 Unit D PPTokmomwalking
 
Measure the right stuff with crystal reports bb con 2011
Measure the right stuff with crystal reports   bb con 2011Measure the right stuff with crystal reports   bb con 2011
Measure the right stuff with crystal reports bb con 2011Joe Meehan
 
Access Chapter 02
Access Chapter 02Access Chapter 02
Access Chapter 02xtin101
 
Access Chapter 02
Access Chapter 02Access Chapter 02
Access Chapter 02jgardne4
 
Powerpoint 2010 Unit C PPT
Powerpoint 2010 Unit C PPTPowerpoint 2010 Unit C PPT
Powerpoint 2010 Unit C PPTokmomwalking
 
Lecture2 slides
Lecture2 slidesLecture2 slides
Lecture2 slidesCyri Jones
 
Access 2010 Unit A PPT
Access 2010 Unit A PPTAccess 2010 Unit A PPT
Access 2010 Unit A PPTokmomwalking
 

What's hot (20)

Defining Table Relationships
Defining Table RelationshipsDefining Table Relationships
Defining Table Relationships
 
basic database concepts
basic database conceptsbasic database concepts
basic database concepts
 
Access.01
Access.01Access.01
Access.01
 
Access Introduction
Access IntroductionAccess Introduction
Access Introduction
 
Pagelayout & data tab of ms excel 2010
Pagelayout & data tab of ms excel 2010Pagelayout & data tab of ms excel 2010
Pagelayout & data tab of ms excel 2010
 
Access 2010 Unit B PPT
Access 2010 Unit B PPTAccess 2010 Unit B PPT
Access 2010 Unit B PPT
 
Tutorial 6: Multiple Worksheets and Workbooks
Tutorial 6: Multiple Worksheets and WorkbooksTutorial 6: Multiple Worksheets and Workbooks
Tutorial 6: Multiple Worksheets and Workbooks
 
Excel 2010 Unit C PPT
Excel 2010 Unit C PPTExcel 2010 Unit C PPT
Excel 2010 Unit C PPT
 
Access 2010 Unit C PPT
Access 2010 Unit C PPTAccess 2010 Unit C PPT
Access 2010 Unit C PPT
 
Tutorial Excel
Tutorial ExcelTutorial Excel
Tutorial Excel
 
Access 2010 Unit D PPT
Access 2010 Unit D PPTAccess 2010 Unit D PPT
Access 2010 Unit D PPT
 
Measure the right stuff with crystal reports bb con 2011
Measure the right stuff with crystal reports   bb con 2011Measure the right stuff with crystal reports   bb con 2011
Measure the right stuff with crystal reports bb con 2011
 
Access Chapter 02
Access Chapter 02Access Chapter 02
Access Chapter 02
 
Excel 2007 Unit P
Excel 2007 Unit PExcel 2007 Unit P
Excel 2007 Unit P
 
Access Chapter 02
Access Chapter 02Access Chapter 02
Access Chapter 02
 
Powerpoint 2010 Unit C PPT
Powerpoint 2010 Unit C PPTPowerpoint 2010 Unit C PPT
Powerpoint 2010 Unit C PPT
 
Access2013 ch10
Access2013 ch10Access2013 ch10
Access2013 ch10
 
Lecture2 slides
Lecture2 slidesLecture2 slides
Lecture2 slides
 
Access 2010 Unit A PPT
Access 2010 Unit A PPTAccess 2010 Unit A PPT
Access 2010 Unit A PPT
 
Base1
Base1Base1
Base1
 

Viewers also liked

Access 2013 Unit C
Access 2013 Unit CAccess 2013 Unit C
Access 2013 Unit Cjarana00
 
Access 2013 Unit B
Access 2013 Unit BAccess 2013 Unit B
Access 2013 Unit Bjarana00
 
Computer Concepts Unit A 2013
Computer Concepts Unit A 2013Computer Concepts Unit A 2013
Computer Concepts Unit A 2013jarana00
 
Discovering Computers: Chapter 11
Discovering Computers: Chapter 11Discovering Computers: Chapter 11
Discovering Computers: Chapter 11Anna Stirling
 
Access 2016 module 4 ppt presentation
Access 2016 module 4 ppt presentationAccess 2016 module 4 ppt presentation
Access 2016 module 4 ppt presentationdgdotson
 
Discovering Computers: Chapter 10
Discovering Computers: Chapter 10Discovering Computers: Chapter 10
Discovering Computers: Chapter 10Anna Stirling
 
Access 2016 module 2 ppt presentation
Access 2016 module 2 ppt presentationAccess 2016 module 2 ppt presentation
Access 2016 module 2 ppt presentationdgdotson
 
Access 2016 module 3 ppt presentation
Access 2016 module 3 ppt presentationAccess 2016 module 3 ppt presentation
Access 2016 module 3 ppt presentationdgdotson
 
Access 2013 Unit D
Access 2013 Unit DAccess 2013 Unit D
Access 2013 Unit Djarana00
 
Access 2016 module 1 ppt presentation
Access 2016 module 1 ppt presentationAccess 2016 module 1 ppt presentation
Access 2016 module 1 ppt presentationdgdotson
 
Access 2013 Unit A
Access 2013 Unit AAccess 2013 Unit A
Access 2013 Unit Ajarana00
 
Discovering Computers: Chapter 06
Discovering Computers: Chapter 06Discovering Computers: Chapter 06
Discovering Computers: Chapter 06Anna Stirling
 
MS-ACCESS:CREATE TAB(QUERY-SELECT WITH CONDITIONS, MAKE A TABLE,DELETE,APPNED...
MS-ACCESS:CREATE TAB(QUERY-SELECT WITH CONDITIONS, MAKE A TABLE,DELETE,APPNED...MS-ACCESS:CREATE TAB(QUERY-SELECT WITH CONDITIONS, MAKE A TABLE,DELETE,APPNED...
MS-ACCESS:CREATE TAB(QUERY-SELECT WITH CONDITIONS, MAKE A TABLE,DELETE,APPNED...Ashish Saxena
 
Discovering Computers: Chapter 09
Discovering Computers: Chapter 09Discovering Computers: Chapter 09
Discovering Computers: Chapter 09Anna Stirling
 
Discovering Computers: Chapter 01
Discovering Computers: Chapter 01Discovering Computers: Chapter 01
Discovering Computers: Chapter 01Anna Stirling
 

Viewers also liked (16)

Access 2013 Unit C
Access 2013 Unit CAccess 2013 Unit C
Access 2013 Unit C
 
Access 2013 Unit B
Access 2013 Unit BAccess 2013 Unit B
Access 2013 Unit B
 
Computer Concepts Unit A 2013
Computer Concepts Unit A 2013Computer Concepts Unit A 2013
Computer Concepts Unit A 2013
 
Discovering Computers: Chapter 11
Discovering Computers: Chapter 11Discovering Computers: Chapter 11
Discovering Computers: Chapter 11
 
Access 2016 module 4 ppt presentation
Access 2016 module 4 ppt presentationAccess 2016 module 4 ppt presentation
Access 2016 module 4 ppt presentation
 
Discovering Computers: Chapter 10
Discovering Computers: Chapter 10Discovering Computers: Chapter 10
Discovering Computers: Chapter 10
 
Access 2016 module 2 ppt presentation
Access 2016 module 2 ppt presentationAccess 2016 module 2 ppt presentation
Access 2016 module 2 ppt presentation
 
Access 2016 module 3 ppt presentation
Access 2016 module 3 ppt presentationAccess 2016 module 3 ppt presentation
Access 2016 module 3 ppt presentation
 
Access 2013 Unit D
Access 2013 Unit DAccess 2013 Unit D
Access 2013 Unit D
 
Access 2016 module 1 ppt presentation
Access 2016 module 1 ppt presentationAccess 2016 module 1 ppt presentation
Access 2016 module 1 ppt presentation
 
Access 2013
Access 2013 Access 2013
Access 2013
 
Access 2013 Unit A
Access 2013 Unit AAccess 2013 Unit A
Access 2013 Unit A
 
Discovering Computers: Chapter 06
Discovering Computers: Chapter 06Discovering Computers: Chapter 06
Discovering Computers: Chapter 06
 
MS-ACCESS:CREATE TAB(QUERY-SELECT WITH CONDITIONS, MAKE A TABLE,DELETE,APPNED...
MS-ACCESS:CREATE TAB(QUERY-SELECT WITH CONDITIONS, MAKE A TABLE,DELETE,APPNED...MS-ACCESS:CREATE TAB(QUERY-SELECT WITH CONDITIONS, MAKE A TABLE,DELETE,APPNED...
MS-ACCESS:CREATE TAB(QUERY-SELECT WITH CONDITIONS, MAKE A TABLE,DELETE,APPNED...
 
Discovering Computers: Chapter 09
Discovering Computers: Chapter 09Discovering Computers: Chapter 09
Discovering Computers: Chapter 09
 
Discovering Computers: Chapter 01
Discovering Computers: Chapter 01Discovering Computers: Chapter 01
Discovering Computers: Chapter 01
 

Similar to New Perspectives: Access.09

MS ACCESS DEFINING DESIGN VIEW AND DATASHEET VIEW.ppt
MS ACCESS DEFINING DESIGN VIEW AND DATASHEET VIEW.pptMS ACCESS DEFINING DESIGN VIEW AND DATASHEET VIEW.ppt
MS ACCESS DEFINING DESIGN VIEW AND DATASHEET VIEW.pptJoshCasas1
 
Access Chapter 01
Access Chapter 01Access Chapter 01
Access Chapter 01jgardne4
 
Access Chapter 01
Access Chapter 01Access Chapter 01
Access Chapter 01xtin101
 
Access slide show
Access slide showAccess slide show
Access slide showjhaastrup1
 
Access2013 ch03
Access2013 ch03Access2013 ch03
Access2013 ch03xtin101
 
Excel chapter 05
Excel chapter 05Excel chapter 05
Excel chapter 05teeworthy
 
Word Lesson 7A PPT
Word Lesson 7A PPTWord Lesson 7A PPT
Word Lesson 7A PPTdeborahburns
 
Word Lesson 7B PPT
Word Lesson 7B PPTWord Lesson 7B PPT
Word Lesson 7B PPTdeborahburns
 
Tutorial 11: Connecting to External Data
Tutorial 11: Connecting to External DataTutorial 11: Connecting to External Data
Tutorial 11: Connecting to External Datacios135
 
Understand Charts in Excel - Chapter.03
Understand Charts in Excel - Chapter.03Understand Charts in Excel - Chapter.03
Understand Charts in Excel - Chapter.03chazaabdul
 
Excel chapter 03
Excel chapter 03Excel chapter 03
Excel chapter 03teeworthy
 
Excel Chapter 03
Excel Chapter 03Excel Chapter 03
Excel Chapter 03jgardne4
 
creating data
creating datacreating data
creating datasabinji
 
M0DULE 1-MS ACCESS Databases and Database Objects.pdf
M0DULE 1-MS ACCESS Databases and Database Objects.pdfM0DULE 1-MS ACCESS Databases and Database Objects.pdf
M0DULE 1-MS ACCESS Databases and Database Objects.pdfJoshCasas1
 

Similar to New Perspectives: Access.09 (20)

MS ACCESS DEFINING DESIGN VIEW AND DATASHEET VIEW.ppt
MS ACCESS DEFINING DESIGN VIEW AND DATASHEET VIEW.pptMS ACCESS DEFINING DESIGN VIEW AND DATASHEET VIEW.ppt
MS ACCESS DEFINING DESIGN VIEW AND DATASHEET VIEW.ppt
 
a2-110.ppt
a2-110.ppta2-110.ppt
a2-110.ppt
 
Access.01.ppt
Access.01.pptAccess.01.ppt
Access.01.ppt
 
Access Chapter 01
Access Chapter 01Access Chapter 01
Access Chapter 01
 
Access Chapter 01
Access Chapter 01Access Chapter 01
Access Chapter 01
 
Access2013 ch09
Access2013 ch09Access2013 ch09
Access2013 ch09
 
Access slide show
Access slide showAccess slide show
Access slide show
 
Access2013 ch03
Access2013 ch03Access2013 ch03
Access2013 ch03
 
Excel chapter 05
Excel chapter 05Excel chapter 05
Excel chapter 05
 
Excel Basics
Excel BasicsExcel Basics
Excel Basics
 
Word Lesson 7A PPT
Word Lesson 7A PPTWord Lesson 7A PPT
Word Lesson 7A PPT
 
Word Lesson 7B PPT
Word Lesson 7B PPTWord Lesson 7B PPT
Word Lesson 7B PPT
 
Tutorial 11: Connecting to External Data
Tutorial 11: Connecting to External DataTutorial 11: Connecting to External Data
Tutorial 11: Connecting to External Data
 
PPT Lesson 4
PPT Lesson 4PPT Lesson 4
PPT Lesson 4
 
Understand Charts in Excel - Chapter.03
Understand Charts in Excel - Chapter.03Understand Charts in Excel - Chapter.03
Understand Charts in Excel - Chapter.03
 
Excel chapter 03
Excel chapter 03Excel chapter 03
Excel chapter 03
 
Excel Chapter 03
Excel Chapter 03Excel Chapter 03
Excel Chapter 03
 
creating data
creating datacreating data
creating data
 
M0DULE 1-MS ACCESS Databases and Database Objects.pdf
M0DULE 1-MS ACCESS Databases and Database Objects.pdfM0DULE 1-MS ACCESS Databases and Database Objects.pdf
M0DULE 1-MS ACCESS Databases and Database Objects.pdf
 
Word.t03
Word.t03Word.t03
Word.t03
 

More from Anna Stirling

Technology Training in the California Community College System
Technology Training in the California Community College SystemTechnology Training in the California Community College System
Technology Training in the California Community College SystemAnna Stirling
 
Discovering Computers: Chapter 15
Discovering Computers: Chapter 15Discovering Computers: Chapter 15
Discovering Computers: Chapter 15Anna Stirling
 
Discovering Computers: Chapter 14
Discovering Computers: Chapter 14Discovering Computers: Chapter 14
Discovering Computers: Chapter 14Anna Stirling
 
Discovering Computers: Chapter 13
Discovering Computers: Chapter 13Discovering Computers: Chapter 13
Discovering Computers: Chapter 13Anna Stirling
 
Discovering Computers: Chapter 12
Discovering Computers: Chapter 12Discovering Computers: Chapter 12
Discovering Computers: Chapter 12Anna Stirling
 
Discovering Computers: Chapter 08
Discovering Computers: Chapter 08Discovering Computers: Chapter 08
Discovering Computers: Chapter 08Anna Stirling
 
Discovering Computers: Chapter 07
Discovering Computers: Chapter 07Discovering Computers: Chapter 07
Discovering Computers: Chapter 07Anna Stirling
 
Discovering Computers: Chapter 05
Discovering Computers: Chapter 05Discovering Computers: Chapter 05
Discovering Computers: Chapter 05Anna Stirling
 
Discovering Computers: Chapter 04
Discovering Computers: Chapter 04Discovering Computers: Chapter 04
Discovering Computers: Chapter 04Anna Stirling
 
Discovering Computers: Chapter 03
Discovering Computers: Chapter 03Discovering Computers: Chapter 03
Discovering Computers: Chapter 03Anna Stirling
 
Discovering Computers: Chapter 02
Discovering Computers: Chapter 02Discovering Computers: Chapter 02
Discovering Computers: Chapter 02Anna Stirling
 

More from Anna Stirling (11)

Technology Training in the California Community College System
Technology Training in the California Community College SystemTechnology Training in the California Community College System
Technology Training in the California Community College System
 
Discovering Computers: Chapter 15
Discovering Computers: Chapter 15Discovering Computers: Chapter 15
Discovering Computers: Chapter 15
 
Discovering Computers: Chapter 14
Discovering Computers: Chapter 14Discovering Computers: Chapter 14
Discovering Computers: Chapter 14
 
Discovering Computers: Chapter 13
Discovering Computers: Chapter 13Discovering Computers: Chapter 13
Discovering Computers: Chapter 13
 
Discovering Computers: Chapter 12
Discovering Computers: Chapter 12Discovering Computers: Chapter 12
Discovering Computers: Chapter 12
 
Discovering Computers: Chapter 08
Discovering Computers: Chapter 08Discovering Computers: Chapter 08
Discovering Computers: Chapter 08
 
Discovering Computers: Chapter 07
Discovering Computers: Chapter 07Discovering Computers: Chapter 07
Discovering Computers: Chapter 07
 
Discovering Computers: Chapter 05
Discovering Computers: Chapter 05Discovering Computers: Chapter 05
Discovering Computers: Chapter 05
 
Discovering Computers: Chapter 04
Discovering Computers: Chapter 04Discovering Computers: Chapter 04
Discovering Computers: Chapter 04
 
Discovering Computers: Chapter 03
Discovering Computers: Chapter 03Discovering Computers: Chapter 03
Discovering Computers: Chapter 03
 
Discovering Computers: Chapter 02
Discovering Computers: Chapter 02Discovering Computers: Chapter 02
Discovering Computers: Chapter 02
 

New Perspectives: Access.09

  • 1. Tutorial 9 Using Action Queries and Advanced Table Relationships Microsoft Access 2010 ®
  • 2. Objectives XP • Create an action query to create a table • Create action queries to append, delete, and update data • Define many-to-many and one-to-one relationships between tables • Learn about joining tables • Join a table using a self-join • View and create indexes for tables New Perspectives on Microsoft Access 2010 2
  • 3. Action Queries XP New Perspectives on Microsoft Access 2010 3
  • 4. Action Queries XP • An action query is a query that adds, changes, or deletes multiple table records at a time – Make-table query – Append query • History table – Delete query – Update query New Perspectives on Microsoft Access 2010 4
  • 5. Creating a Make-Table Query XP • Create a select query with the necessary fields and selection criteria • In the Results group on the Design tab, click the Run button to preview the results • Switch to Design view to make any necessary changes to the query. When the query is correct, click the Make Table button in the Query Type group on the Design tab New Perspectives on Microsoft Access 2010 5
  • 6. Creating a Make-Table Query XP • In the Make Table dialog box, type the new table name in the Table Name box. Make sure the Current Database option button is selected to include the new table in the current database; or, click the Another Database option button and enter the database name in the File Name box. Then click the OK button • Click the Run button, and then click the Yes button to confirm the creation of the new table New Perspectives on Microsoft Access 2010 6
  • 7. Creating a Make-Table Query XP New Perspectives on Microsoft Access 2010 7
  • 8. Creating an Append Query XP • Create a select query with the necessary fields and selection criteria • In the Results group on the Design tab, click the Run button to preview the results • Switch to Design view to make any necessary changes to the query. When the query is correct, click the Append button in the Query Type group on the Design tab New Perspectives on Microsoft Access 2010 8
  • 9. Creating an Append Query XP • In the Append dialog box, select the table name in the Table Name box. Make sure the Current Database option button is selected to include the new table in the current database; or, click the Another Database option button and enter the database name in the File Name box. Then click the OK button. Access replaces the Show row in the design grid with the Append To row • Click the Run button, and then click the Yes button to confirm appending the records to the table New Perspectives on Microsoft Access 2010 9
  • 10. Creating an Append Query XP New Perspectives on Microsoft Access 2010 10
  • 11. Creating a Delete Query XP • Create a select query with the necessary fields and selection criteria • In the Results group on the Design tab, click the Run button to preview the results • Switch to Design view to make any necessary changes to the query. When the query is correct, click the Delete button in the Query Type group on the Design tab. Access replaces the Show and Sort rows in the design grid with the Delete row • Click the Run button, and then click the Yes button to confirm deleting the records New Perspectives on Microsoft Access 2010 11
  • 12. Creating a Delete Query XP New Perspectives on Microsoft Access 2010 12
  • 13. Creating an Update Query XP • Create a select query with the necessary fields and selection criteria • In the Results group on the Design tab, click the Run button to preview the results • Switch to Design view to make any necessary changes to the query. When the query is correct, click the Update button in the Query Type group on the Design tab. Access replaces the Show and Sort rows in the design grid with the Update To row New Perspectives on Microsoft Access 2010 13
  • 14. Creating an Update Query XP • Type the updated values in the Update To boxes for the fields you want to update • Click the Run button, and then click the Yes button to confirm changing the records New Perspectives on Microsoft Access 2010 14
  • 15. Many-To-Many Relationship XP New Perspectives on Microsoft Access 2010 15
  • 16. Relationships Between Database XP Tables New Perspectives on Microsoft Access 2010 16
  • 17. Relationships Between Database XP Tables New Perspectives on Microsoft Access 2010 17
  • 18. Defining M:N and 1:1 XP Relationships Between Tables New Perspectives on Microsoft Access 2010 18
  • 19. Joining Tables XP • An inner join is a join in which the DBMS selects records from two tables only when the records have the same value in the common field that links the tables New Perspectives on Microsoft Access 2010 19
  • 20. Joining Tables XP • An outer join is a join in which the DBMS selects all records from one table and only those records from a second table that have matching common field values New Perspectives on Microsoft Access 2010 20
  • 21. Creating a Self-Join XP • Click the Create tab on the Ribbon • In the Queries group on the Create tab, click the Query Design button • In the Show Table dialog box, double-click the table for the self-join, double-click the table a second time, and then click the Close button • Click and drag the primary key field from one field list to the foreign key field in the other field list New Perspectives on Microsoft Access 2010 21
  • 22. Creating a Self-Join XP • Right-click the join line between the two tables, and then click Join Properties to open the Join Properties dialog box • Click the first option button to select an inner join, or click the second option button or the third option button to select an outer join, and then click the OK button • Select the fields, specify the selection criteria, select the sort options, and set other properties as appropriate for the query New Perspectives on Microsoft Access 2010 22
  • 23. Creating a Self-Join XP New Perspectives on Microsoft Access 2010 23
  • 24. Viewing a Table’s Existing IndexesXP • Open the table in Design view • To view an index for a single field, click the field, and then view the Indexed property in the Field Properties pane • To view all the indexes for a table or to view an index consisting of multiple fields, click the Indexes button in the Show/Hide group on the Design tab New Perspectives on Microsoft Access 2010 24
  • 25. Viewing a Table’s Existing IndexesXP New Perspectives on Microsoft Access 2010 25
  • 26. Creating an Index XP • Open the table in Design view • To create an index for a single field, click the field, and then set the Indexed property in the Field Properties pane • To create an index consisting of multiple fields, click the Indexes button in the Show/Hide group on the Design tab, enter a name for the index in the Index Name box, select the fields in the Field Name box, and then set other properties as necessary for the index New Perspectives on Microsoft Access 2010 26
  • 27. Creating an Index XP New Perspectives on Microsoft Access 2010 27