Using MS Access for SQL CIS 523 Fall 2009 McCoey
MS Access Query QBE design SQL statement Used to ask questions of tables in the database Two different approaches QBE design Query by Example SQL statement Structured Query Statements
How to get to the QUERY menu First open MS Access Browse to find the database you wish to open When the database is open, you are going to have the list of database tables on the left and an blank screen in the middle
Click on the CREATE Menu Item Click on the create option
Get to the QUERY Options Click on the option QUERY design
Default is QBE Grid This is the default view. We are going to change it to the SQL view. Click on the option to CLOSE the list of tables
Move to SQL View Click on the option SQL VIEW
SQL Query View This is the default SQL view. You will type your SQL statements right here.
Using the SQL Query This is a basic query statement to display all the records in the staff table. The statement ends with a semicolon
Running SQL Query To make the statement Execute, click on the Exclamation statement with the RUN
Results of the Query This sample DB does not have any records. The result displays in a table view.
Return to SQL Query View Click on the drop-down VIEW Select the option SQL VIEW
Saving the QUERY Click on the X to close the QUERY. You will get the request to save the design. Click on YES
Naming the QUERY Another box will open asking for the QUERY Name. Type the name for this query in the box and click on OK. The query will be saved with the DATABASE
Finding your queries Click on the DOWN arrow and select The option for OBJECT TYPES. The objects Will reorder based on the types
See the QUERY The query is listed here. To rerun the query Just double click on the name