query

4 Results

Dictionary

query

To interrogate a collection of data such as records in a database. The term may also be used to search a single file or collection of files such as HTML files on the Web. However, in addition to...

Dictionary

Definition: query

To interrogate a collection of data such as records in a database. The term may also be used to search a single file or collection of files such as HTML files on the Web. However, in addition to obtaining lists of records that match the search criteria, queries to a database allow for counting items and summing amounts. A query on the Web yields only a list of matching pages and is more often called a "search."

For years, query and report programs have been the primary applications that produce output from information systems. A query implies an online request as required (look up that record), while a report implies a more elaborate printout with page headings and numbers that is typically produced at regular intervals such as end of month. See report writer.

Simple or Complex
Defining a query for a relational database can be extremely simple or very complex. If the query is based on one matching condition, such as "retrieve all customers who owe us more than $10,000," it is usually easy to define in a query language or program. However, "retrieve all customers who owe us more than $10,000 from purchasing toasters" is not easy. It requires several steps to determine how many toaster orders are in the balance due.

Tables Must Be Joined
Relational databases are designed to eliminate redundancy. The goal is to store a data item in one table and not have it duplicated in others. For example, an order record will contain the product number ordered, but often not its description. The description is stored in a product table. Thus, any printout of products ordered and their descriptions requires that the order table be linked to the product table for that query or report. Linking customer, order and product tables is a common example of "joining" tables to satisfy a query.

Contents of a Query
Most queries require at least the following conditions to be stated. First, which table or tables is the data coming from. If from two or more tables, what is the link between (typically account number or name). Next, define the selection criteria, which is the matching condition or filter. Lastly, define which fields in the tables are to be displayed or printed in the result. See SQL.


query

The Query Statement
This diagram depicts the typical conditions that have to be stated when querying a relational database.





Sponsored White Papers, Webcasts & Resources

  • Amazon Web Services launches DNS system

    AWS is allowing users to create, change and delete DNS files for any domain. AWS does this using a "hosted zone"," which acts as a phone book of sorts matching names to IP addresses.

    Blog posts | December 6, 2010 4:45am PST

  • Deep inside Wolfram Alpha

    Two CNET experts compare Wolfram Research's "computational knowledge engine" with Google's and predict whether Wolfram Alpha is something to be worried about.

    News items | May 6, 2009 6:21am PDT

  • First, a game of green. Then, fade to black

    It is truly astonishing that I mention the word Apple in a post and I get more talkbacks than pretty much anything I write about. Puh-leeze, get a grip. Anyway, just back from reluctantly leaving...

    Blog posts | May 13, 2008 7:46pm PDT

  • From facts on Google-retrieved Web pages to historical graphs

    A newly published Google Patent application entitled "Displaying Facts On A Linear Graph" appears to explain a method for extracting factual information from web pages retrieved via Google...

    Blog posts | August 3, 2007 2:25pm PDT

Additional Results

ie8 fix

The best of ZDNet, delivered

ZDNet Newsletters

Get the best of ZDNet delivered straight to your inbox

Facebook Activity

ie8 fix