Wednesday, June 2, 2010

Wooden Colector Series T

11b) Query Types and Aggregate Functions

A query is a specific request for recovery, creating, changing or deleting data in a database. There are several types of queries: Query
The selection, ie those that retrieve data from one or more tables and display the recordset in a datasheet. You can also use a select query to group data and calculate sums, counts, averages, and other types of totals. A
Query parameter displays when running a dialog box that prompts you to enter information to be used as criteria of the query. You can design a parameter query so that strings are in demand for information, for example, two dates. Then Access will retrieve all data with values \u200b\u200bbetween those two dates.
A Crosstab Query have a recordset in order to facilitate the display, using row and column. You can view the data in terms of two categories at a time. The
queries, ie those procedures that insert, modify or delete data. This type of query creates a new table or modify an existing table by adding data, deleting data or updating it, is particularly powerful, as it actually changes the table data.
Among the latter we have:
- Append Query values. Create a new line and insert literal values \u200b\u200bin specific columns.
- Append Query . Create new rows by copying existing rows from a table in another, or in the same table.
- Update Query
. Changing the values \u200b\u200bof individual columns in one or more existing rows in a table.
- Delete Query
. Removes one or more rows from a table. ( A Delete query removes entire rows from the table. To delete values \u200b\u200bfrom the individual columns of data, use an update query).
-
table query. Create a new table with rows that are copied to the query results.

When we synthesize data from a table, we can create an aggregate query that will run once a single line with the summary information. The
Aggregate Functions are functions native to standard SQL that allow us to obtain numerical values \u200b\u200band / or perform calculations according to specific queries. Allow both to perform statistical calculations on the data of compattattare data for certain values. The main functions:

  • SUM - Calculates the sum of the values.
  • AVG - Calculate the mean (average) values.
  • MIN - Extracts the minimum value.
  • MAX - Extract the maximum value.
  • COUNT - Count the number of values.
  • STDEV - Computes the standard deviation.
  • VAR - Calculate the variance of values.
  • FIRST - Returns the first value.
  • LAST - Returns the last value.
E 'possible to calculate the total number of members to Wisdom in the current year, creating a table through a query Iscritti_tot going to add up the column data members. The iscruzione in SQL would be as follows:
Select Sum (wisdom) iscritti_tot
From Registered

0 comments:

Post a Comment