Access SQL Feature Using SQL.

Slides:



Advertisements
Similar presentations
Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
Advertisements

Microsoft Office 2007 Excel Web Feature Creating Web Pages Using Excel.
Microsoft Office 2007 Excel Web Feature Creating Web Pages Using Excel.
Microsoft Office 2010 Access Chapter 1 Creating and Using a Database.
Chapter 5 Creating, Sorting, and Querying a Table
Microsoft Office 2007 Access Chapter 2 Querying a Database.
Chapter 1 Databases and Database Objects: An Introduction
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 2 Querying a Database Using the Select Query Window.
Microsoft Office 2007 Access Integration Feature Sharing Data Among Applications.
Staff Development Daze June 27 & 28 Tony Gauvin. 2 Schedule  Monday June 27  Monday June 27  9:00 – 12:00 Basic Excel  12:00 – 1:00 Lunch for all.
Staff Development Daze June 27 & 28 Tony Gauvin. Schedule  Monday June 27  Monday June 27  9:00 – 12:00 Basic Excel  12:00 – 1:00 Lunch for all workshop.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 1 Creating and Using a Database.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 3 Maintaining a Database Using the Design and Update Features of Access.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Web Feature Sharing Data among Applications.
Microsoft Access 2010 Chapter 7 Using SQL.
Pasewark & Pasewark 1 Access Lesson 4 Creating and Modifying Forms Microsoft Office 2007: Introductory.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Word Project 8 Working with Macros and Visual Basic for Applications (VBA)
Access Tutorial 10 Automating Tasks with Macros
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 4 Reports, Forms, and Combo Boxes.
Chapter 2 Querying a Database
Microsoft Office 2007 Word Integration Feature Linking an Excel Worksheet and Chart to a Word Document.
1 Access Lesson 3 Creating Queries Microsoft Office 2010 Introductory Pasewark & Pasewark.
1 Access Lesson 3 Creating Queries Microsoft Office 2010 Introductory.
Microsoft Office 2007 Access 2007 Chapter 9 Administering a Database System.
Chapter 2 Querying a Database MICROSOFT ACCESS 2010.
Advanced Form Techniques
Chapter 1 Databases and Database Objects: An Introduction
Chapter 6 Advanced Report Techniques
Microsoft Office 2007 PowerPoint Web Feature Creating Web Pages Using PowerPoint.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Web Feature Data Access Pages.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 5 Enhancing Forms with OLE Fields, Hyperlinks, and Subforms.
Microsoft Office 2007 Access 2007 Chapter 7 Advanced Report Techniques.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 6 Switchboards, PivotTables, and PivotCharts.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 5 Enhancing Forms with OLE Fields, Hyperlinks, and Subforms.
Microsoft Office 2007 Access Chapter 2 Querying a Database.
Microsoft Office 2007 Access Chapter 6 Using Macros, Switchboards, PivotTables, and PivotCharts.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Access Project 7 Advanced Report and Form Techniques.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 1 Creating and Using a Database.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 6 Creating an Application System Using Macros, Wizards, and the Switchboard.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 8 – Integrating a Database with a FrontPage.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 2 Querying a Database Using the Select Query Window.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 2 ® Building Queries.
1 Access Lesson 2 Creating Queries, Forms, and Reports Microsoft Office 2010 Fundamentals Story / Walls.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 1 Creating and Using a Database.
Integrating Office 2003 Applications and the World Wide Web
Using Macros, Switchboards, PivotTables, and PivotCharts
Maintaining a Database Using the Design and Update Features of Access
Maintaining a Database
Access Chapter 2 Querying a Database.
Plug-In T7: Problem Solving Using Access 2007
PowerPoint Web Feature
Objectives Create an action query to create a table
Querying a Database Using the Select Query Window
Administering a Database System
Sharing Data among Applications
Access Project 8 Using Visual Basic for Applications (VBA) and Creating Multi-Page Forms.
Creating and Using a Database
Enhancing Forms with OLE Fields, Hyperlinks, and Subforms
Access Chapter 5 Multi-Table Forms.
Chapter 7 Advanced Form Techniques
Microsoft Office Access 2003
Creating Reports and Forms
Chapter 4 Creating Reports and Forms
Advanced Report Techniques
Microsoft Office Access 2003
Chapter 1 Databases and Database Objects: An Introduction
Defining the Fields in a Table
Shelly Cashman: Microsoft Access 2016
Presentation transcript:

Access SQL Feature Using SQL

Objectives Change the font or font size Include fields and criteria in SQL queries Use computed fields and built-in functions in SQL queries Sort the results in SQL queries

Objectives Use multiple functions in the same command Group the results in SQL queries Join tables in SQL queries Compare with Access-generated SQL

Opening a Database Click the Start button on the Windows taskbar, point to All Programs on the Start menu, point to Microsoft Office on the All Programs submenu, and then click Microsoft Office Access 2003 on the Microsoft Office submenu If the Access window is not maximized, double-click its title bar to maximize it If the Language bar appears, right-click it and then click Close the Language bar on the shortcut menu

Opening a Database Click Open on the Database toolbar, and then click Local Disk (C:) in the Look in box. Double-click the Data folder, and then make sure the Ashton James College database is selected Click the Open button If the Security Warning dialog box appears, click the Open button When the Switchboard appears, close the Switchboard by clicking its Close button

Changing the Font Size Click Tools on the menu bar, and then click Options on the Tools menu Click the Tables/Queries tab Click the Size box arrow, and then click 10 in the list that appears Click the OK button

Changing the Font Size

Creating a New SQL Query If necessary, click the Queries object and then click the New button on the Database window toolbar Be sure Design View is selected and then click the OK button When the Show Table dialog box appears, click its Close button Be sure the Query1 : Select Query window is maximized Click the View button arrow and select SQL View

Creating a New SQL Query

Including Only Certain Fields Type SELECT [Client Number],[Name],[Amount Paid],[Current Due] as the first line of the command, and then press the ENTER key Type FROM [Client]; as the second line Click the Run button

Including Only Certain Fields

Preparing to Enter a New SQL Query Click the View button arrow Click SQL View

Including All Fields Delete the current command, type SELECT * as the first line of the command, and then press the ENTER key Type FROM [Client]; as the second line Click the Run button

Including All Fields

Using a Criterion Involving a Numeric Field Click the View button arrow, click SQL View, and then delete the current command Type SELECT [Client Number],[Name] as the first line of the command, and then press the ENTER key Type FROM [Client] as the second line, and then press the ENTER key Type WHERE [Current Due]=0; as the third line Click the Run button

Using a Criterion Involving a Numeric Field

Using a Criterion Involving a Text Field Click the View button arrow, click SQL View, and then delete the current command Type SELECT [Client Number],[Name] as the first line of the command, and then press the ENTER key Type FROM [Client] as the second line, and then press the ENTER key Type WHERE [City]='Lake Hammond'; as the third line Click the Run button

Using a Criterion Involving a Text Field

Using a Compound Criterion Click the View button arrow, click SQL View, and then delete the current command Type SELECT [Client Number],[Name] as the first line of the command, and then press the ENTER key Type FROM [Client] as the second line, and then press the ENTER key Type WHERE [City]='Lake Hammond' as the third line, and then press the ENTER key Type AND [Current Due]=0; as the fourth line and then click the Run button

Using a Compound Criterion

Using NOT in a Criterion Click the View button arrow, click SQL View, and then delete the current command Type SELECT [Client Number],[Name] as the first line of the command, and then press the ENTER key Type FROM [Client] as the second line, and then press the ENTER key Type WHERE NOT [City]='Lake Hammond'; as the third line Click the Run button

Using NOT in a Criterion

Using a Computed Field Click the View button arrow, click SQL View, and then delete the current command Type SELECT [Client Number],[Name],[Amount Paid]+[Current Due] AS [Total Amount] as the first line of the command, and then press the ENTER key Type FROM [Client] as the second line, and then press the ENTER key Type WHERE [Current Due]>0; as the third line Click the Run button

Using a Computed Field

Sorting the Results Click the View button arrow, click SQL View, and then delete the current command Type SELECT [Client Number],[Name],[Amount Paid],[Current Due],[Trainer Number] as the first line of the command, and then press the ENTER key Type FROM [Client] as the second line, and then press the ENTER key Type ORDER BY [Trainer Number],[Amount Paid]; as the third line Click the Run button

Sorting the Results

Using a Built-In Function Click the View button arrow, click SQL View, and then delete the current command Type SELECT COUNT(*) as the first line of the command, and then press the ENTER key Type FROM [Client] as the second line, and then press the ENTER key Type WHERE [Trainer Number]='42'; as the third line Click the Run button

Using a Built-In Function

Using Multiple Functions in the Same Command Click the View button arrow, click SQL View, and then delete the current command Type SELECT COUNT(*),SUM([Amount Paid]) as the first line of the command, and then press the ENTER key Type FROM [Client]; as the second line Click the Run button

Using Multiple Functions in the Same Command

Using Grouping Click the View button arrow, click SQL View, and then delete the current command Type SELECT [Trainer Number],SUM([Amount Paid]) AS [Total Paid],SUM([Current Due]) AS [Total Due] as the first line of the command, and then press the ENTER key Type FROM [Client] as the second line, and then press the ENTER key Type GROUP BY [Trainer Number] as the third line, and then press the ENTER key Type ORDER BY [Trainer Number]; as the fourth line and click the Run button

Using Grouping

Restricting the Groups that Appear Click the View button arrow and then click SQL View Click the beginning of the fourth line (ORDER BY [Trainer Number];), and then press the ENTER key Click the beginning of the new blank line, and then type HAVING SUM([Current Due])>3000 as the new fourth line Click the Run button

Restricting the Groups that Appear

Joining Tables Click the View button arrow, click SQL View, and then delete the current command Type SELECT [Client Number],[Name],[Client].[Trainer Number],[First Name],[Last Name] as the first line of the command, and then press the ENTER key Type FROM [Client],[Trainer] as the second line, and then press the ENTER key Type WHERE [Client].[Trainer Number]=[Trainer].[Trainer Number]; as the third line Click the Run button

Joining Tables

Restricting the Records in a Join Click the View button arrow, and then click SQL View If necessary, click immediately after the semicolon on the third line Press the BACKSPACE key to delete the semicolon, and then press the ENTER key Type AND [Current Due] > 0; as the fourth line Click the Run button

Restricting the Records in a Join

Joining Multiple Tables Click the View button arrow, click SQL View, and then delete the current command Type SELECT [Course Offerings].[Client Number], [Name],[Course Offerings].[Course Number],[Course Description], as the first line of the command, and then press the ENTER key Type [Total Hours],[Hours Spent] as the second line of the command, and then press the ENTER key Type FROM [Course Offerings],[Course],[Client] as the third line, and then press the ENTER key

Joining Multiple Tables Type WHERE [Course].[Course Number]=[Course Offerings].[Course Number] as the fourth line, and then press the ENTER key Type AND [Client].[Client Number]=[Course Offerings].[Client Number]; as the fifth line Click the Run button. Resize each column to best fit the data by double-clicking the right edge of its field selector

Joining Multiple Tables

Closing the Query and Restoring the Font Size Click the Close Window button for the Microsoft Access - [Query1 : Select Query] window Click Tools on the menu bar, and then click Options on the Tools Menu. Click the Tables/Queries tab Click the Size box arrow, and then click 8 in the list that appears. Click the OK button

Closing a Database and Quitting Access Click the Close Window button for the Ashton James College : Database window Click the Close button for the Microsoft Access window

Summary Change the font or font size Include fields and criteria in SQL queries Use computed fields and built-in functions in SQL queries Sort the results in SQL queries

Summary Use multiple functions in the same command Group the results in SQL queries Join tables in SQL queries Compare with Access-generated SQL

Access SQL Feature Complete