Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Queries

799 views

Published on

Published in: Education
  • Be the first to comment

  • Be the first to like this

Queries

  1. 1. Queries<br />CIS-145<br />
  2. 2. Select Queries<br />Method to find, organize, summarize data & create information<br />Uses data from tables, other queries<br />Can include calculations<br />
  3. 3. Design View<br />Identify where to get data<br />Specify which rows to use <br />Identify fields, calculations to return<br />How to order the results<br />
  4. 4. Datasheet View<br />“Dynaset” is the result of a query<br />“Dynamic subset”<br />Saving a query saves the “question” not the answer<br />
  5. 5. Select Query Design View<br />Run Button<br />Table<br />Criteria<br />
  6. 6. Select Query Dynaset<br />The results of the query<br />are displayed as a dynaset<br />
  7. 7. Creating a Query<br />Identify where the data is coming from<br />Determine which rows are part of your answer<br />Identify any groups or summaries needed<br />Specify which groups are part of the answer<br />Select the fields or calculations to include in the result<br />Apply sorting to help users understand result<br />
  8. 8. Query Data Sources<br />Queries can use tables or queries as data sources<br />If more than one table is needed for the query result a join is required<br />Make sure that there is a connection (join) to each table<br />Make sure you can find common values to connect each table<br />
  9. 9. Joins<br />Connect tables temporarily when query executes<br />Access will create a join automatically where tables have a relationship<br />Join fields should be on fields that are the same data type<br />
  10. 10. Types of Joins<br />Inner Join<br />Default join<br />Looking for matching values in both tables<br />If a table has a value not found in the second table nothing is returned<br />Outer Join<br />Allows query to return rows that don’t have a match in the other table<br />Cartesian Join<br />Combines all rows whether match or not<br />
  11. 11. Query Criteria<br />Which rows should be included?<br />Criteria are True/False conditions/comparisons<br />Conditions can use:<br />Relational operators (=, >, <, <=, >=, <>)<br />Between<br />Like (patterns, Wild cards)<br />
  12. 12. Wild Cards<br />Wild cards can help describe patters<br />? – one character in a particular space<br />* - zero, one, or morecharacters<br />S?ND returns SAND, SEND<br />S*ND returns SAND, SENT, STAND, SOUND<br />
  13. 13. Logical Operators<br />Needed when there are multiple criteria<br />AND condition: all tests must be passed<br />OR condition: as long as one test is passed the row is included<br />NOT creates the inverse<br />If something returns True, NOT makes it False<br />
  14. 14. Grouping<br />Grouping (“totals queries” in Access) provides summaries about data<br />Can create summary values using Aggregate functions<br />How many? (Count)<br />How much? (Sum)<br />Can summarize all rows or find common values to create groups<br />Total Credits v. Total Credits for each department<br />
  15. 15. Sorting<br />Query results can be sorted<br />Access works from left to right when sorting if multiple fields are sorted<br />

×