Description

Description

Introduction to Queries/ What is a Query? Why Use Queries?

Introduction to Queries/ What is a Query? Why Use Queries?





What is a Query?

In the strictest sense, a query is a way to answer questions about the data in your tables. It allows you to retrieve items in a database that meet a set of criteria that you specify. However, within the realm of modern databases, a specialized form of a query can also be used to:



  1. Define database objects
  2. Perform Calculations
  3. Make new tables
  4. Append, delete, or update records
  5. Produce data summaries



Access contains some other features that are not strictly classified as queries but they can be used to achieve query-like results. These are sorting and filter. Sorting was covered in the Introduction to Access workshop and we will discuss filters today before we tackle actual queries. Wildcards (*,?,NULL) will also work for filters and queries.


Why Use Queries?

In most cases, the real reason for using a database to store data records is so they can be retrieved using some criteria that is specified interactively, Since this is the definition of a query, we could logically assume that queries are the main reason for using a database. Access gives you a great deal of flexibility and power with queries. You can use them to:




  1. Choose fields: You can select the exact fields needed to satisfy the query. You do not have to include all of the fields of a record in a query.
  2. Choose records: You can select records from a table based on a specified criteria.
  3. Sort records: You can view the results of the query in a specified order.
  4. Access multiple tables: You can select data from several different tables and place the results in a single dynaset, You can even access data from other database management systems.
  5. Perform calculations: You can add new fields in the dynaset that contains the results of Calculations involving other fields.
  6. Provide data source: You can use a query as a source of data for forms, reports, and other queries.
  7. Update data: You can update, delete, or append a group of records in one step. You can even create a new table that includes some or all of the records from an existing table or tables.


Using a Query

Microsoft Access contains a number of query wizards or you can create one from scratch using a form of Query by Example-where you specify the retrieval criteria by placing typical values in columns. You can then treat the columns of sample data as an example for the query. This is the exact same concept that we used for the advanced filter earlier. However, a query is more complex than a filter, since it can:



  1. Apply to multiple tables
  2. Select individual fields instead of full records
  3. Be saved and reused


Type Of Queries

Query Type Description
Select Query A select query is used to view, analyze, or update the data in one or more tables. It is the most common type of query In Access and it is very similar to the previously discussed filter.
Crosstab A crosstab query is used to present the data in rows and columns like a spreadsheet. It can summarize large amounts of data in an easy-to-read format and it blends well with reports and charts.
*Make Table Query Creates a new table from a dynaset. It can be used to make table backups, to archive old data, or to create an extract of a table for exporting.
*Update Query Lets you make global changes to data in one or more tables. Allows you to enter one set of changes that could be posted to many records with minimal effort.
*Append Query Allows you to add records to the end of a table. It can be used to merge tables together by appending one table to the end of another.
*Delete Query Deletes a group of records from one or more tables. Could be used in conjunction with the Make Table query to delete archived records from a table after an archive table was created and filled.
Union Query A union query is used to combine the matching fields from two or more tables.
Pass-Through Query A pass-through query is used to send commands to a SQL database.
Data Definition Query A data definition query creates, changes, or deletes tables in a Access database using SQL statements.


These are action queries. When these queries are run, design or content changes are made to the database in some manner.

COMMENTS

Passage$type=right

Essay$type=left

Name

CBSE,1,Essay Writing,7,G.K & Current Affairs,7,Information & Technology,21,Letter Writing,8,News Letter,10,Passage Writing,3,Report Writing,2,SEBA,1,
ltr
item
Teacher Notes: Introduction to Queries/ What is a Query? Why Use Queries?
Introduction to Queries/ What is a Query? Why Use Queries?
Introduction to Queries/ What is a Query? Why Use Queries?
https://images.hasgeek.com/embed/file/6fd27120d3754c0aa0ad99398157606e
Teacher Notes
https://www.freeteachernotes.com/2019/11/Introduction-to-queries.html
https://www.freeteachernotes.com/
https://www.freeteachernotes.com/
https://www.freeteachernotes.com/2019/11/Introduction-to-queries.html
true
2332357964370966229
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy