What’s a result set?

Print anything with Printful



A database result set is a table of rows from a database with metadata, used to produce information in response to a query. The “Order by” command in SQL organizes the results. Some metadata may not be available, such as the number of rows in a result set.

A database result set is a table containing a selected block of rows from a database. It includes the information stored in those rows along with the “meta-information” for those rows. The metainformation includes details about the arrangement of the rows, such as the total number of columns and the names of the individual columns. The end user typically uses result sets to produce information in response to a query, which is a structured request for information from a database.

When an end user makes a query, they are requesting specific information from a database. An example query might seek to generate a list of the names of all employees hired in June of the previous year. When required, the database scans its contents, finds files that meet the required criteria, and populates those files into a result set. The result set is then displayed on the screen along with its metadata.

Viewing a result set can be a chaotic experience, because without parameters, a computer has no way to organize the returned data. The “Order by” command in Structured Query Language (SQL) resolves this conflict by allowing the end user to dictate how the computer’s database program should display the results. For example, organization through literacy is common. In the above example, the results could be sorted by hire date.

Some metadata may not be available, depending on the specific database program used. For example, asking the database to pre-calculate the number of rows in a result set often proves impossible, because this information is not available in advance. Thus, a request asking the database to provide the exact number of employees over the age of 25 who earn $10,000 US Dollars (USD) per year or more, in other words, the number of rows that would be in a set of results for the query — may return a null result, since the program can’t “know” the answer without first generating the entire result set by running the actual query. Knowing this information might be necessary when the end user wants to have a count of the result, but does not require a complete set of results; in other words, where employee names and other information are irrelevant or irrelevant to the request.




Protect your devices with Threat Protection by NordVPN


Skip to content