A database query is a question that allows the user to
extract or retrieve targeted information from a data file in a readable format.
The retrieved information may be generated as results
returned by SQL or as pictorials, graphs, or complex results, e.g., trend analyses from data mining tools. 1. Language: A database query extracts data from a database and formats it in a readable form and must be written in the language the database requires. Structured Query Language (SQL) is a domain specific language used in programming and designed for managing data held in a relational database management system. SQL format is the most common language used by database management systems.
2. Purpose: Database queries enable the manipulation of data.
They make it easier to view, add, delete, or change data in a database. Queries allow the user to inquire about the data in the tables and locate specific data quickly, calculate or summarize data, and automate data management tasks. Businesses use queries to sort through data and make decisions based on the answers Examples of queries that a business might use are: a. What are total sales by product? b. What are total sales by region? c. What is the customer retention rate? d. What is the average amount of time that inventory is held? e. What is the average collection period for customer accounts? f. What are seasonal sales patterns? g. What coupons and special offers would be best for targeting customers? DATABASE QUERY TYPES:
Select query and action query are the main types of
database queries.
1. Select Query: A select query is a primary query
type that conducts a data retrieval operation. A select query extracts data from a table or makes calculations and returns the result set in the form of a datasheet, without changing the data. the data. A total query is a type of select query that groups and summarizes data. 2. Action Query: An action query is a primary query type that copies or changes data, or deletes data. An action query asks for additional operations on the data, such as insertion, updating, or deletion. Types of action queries include the following (they are identified by an exclamation point (!) in the Navigation Pane): a. An append query is a query that takes the set results of a query and “appends” (adds) them to an existing table. b. A delete query is a query that removes all records in an underlying table from the set results of a query. c. A make-table query is a query that creates a table based on the set results of a query. d. An update query is a query that allows for one or more field in a table to be updated. 3. Parameter Query: A parameter query is a query that imposes a value or condition upon another type of query in order to retrieve the results the user desires. When using parameter query, the user may pass a parameter (limit) to a different query, such as an action query or a select query. The parameter tells the other query what to do