Presentation is loading. Please wait.

Presentation is loading. Please wait.

Databases Section 4: Select Queries Presented By: Lindani Ncube Based on Materials by: M Halse.

Similar presentations


Presentation on theme: "Databases Section 4: Select Queries Presented By: Lindani Ncube Based on Materials by: M Halse."— Presentation transcript:

1 Databases Section 4: Select Queries Presented By: Lindani Ncube Based on Materials by: M Halse

2 Simple Select Queries A SIMPLE select query (can only be performed on one table) can be used to: choose one column to display choose multiple columns to display from one able limit the data in one column with Criteria limit the data in multiple specific columns Select queries vs. Simple select queries A select query retrieves data and values from one or more tables where as a simple select query can only be performed on one table. The results are displayed of both types of queries are displayed in a datasheet view.

3 Using the Query Wizard for a simple Select Query Click on Query Wizard in the Queries group in the create tab of the ribbon For both Simple select queries and normal select queries use the Simple query wizard

4 Using the Query Wizard for a simple Select Query

5 Creating a Select Query in Design View Click on the Query design button in the Queries group of the Create tab on the Ribbon A Query Tools Design tab appears on the Ribbon

6 Creating a Select Query In Design View Add all the tables you need to perform your query. This can be one or more tables. You can add more later by using the Show Table button

7 Creating a Select Query In Design View Either Click on the selection button on the design tab of the Ribbon, OR Right click on the query background area. In the context menu provided, choose Select Query from Query Type OR

8 Creating a Select Query In Design View This is what you will see when you have created your query in design view:

9 Creating a Select Query in Design View

10 You can choose to sort (ascending [A-Z] or descending [Z- A]) by one or more Fields You can choose whether you want a column to be visible in the result or not, even if you apply criteria to the column You can specify select criteria

11 Creating a Select Query in Design View This query is equivalent to the MySQL statement it creates behind the scenes: SELECT Wines.Name, Wines.[White/Red/Rose], Wines.Type, Wines.Price FROM Wines WHERE (((Wines.Price)<200)) ORDER BY Wines.Name; This can be viewed by choosing SQL View from the View button

12 Saving a Query Run the query by pressing the Run button. The results of the query look like this i.e. they will be shown to you in datasheet view. Remember to save your query with a name that will indicate what data it extracts.

13 Editing a Query Double click on the query in the Navigation Pane Switch to Design View and then edit your query. Remember to save if you want to keep the changes.

14 Section 4 Summary Using the Query Wizard for a Select Query Creating a Select Query in Design View Saving a Query Editing a query


Download ppt "Databases Section 4: Select Queries Presented By: Lindani Ncube Based on Materials by: M Halse."

Similar presentations


Ads by Google