A result set is the set of results returned by a query, usually in the same format as the
database
In computing, a database is an organized collection of data or a type of data store based on the use of a database management system (DBMS), the software that interacts with end users, applications, and the database itself to capture and a ...
the query is called on.
For example, in
SQL, which is used in conjunction with
relational databases, it is the result of a
SELECT
query on a
table or
view and is itself a non-permanent table of rows, and could include
metadata
Metadata (or metainformation) is "data that provides information about other data", but not the content of the data itself, such as the text of a message or the image itself. There are many distinct types of metadata, including:
* Descriptive ...
about the query such as the column names, and the types and sizes of each
column. In an
object database, the result set is usually a
collection of objects from the database.
Depending on the database, the number of rows in the result set may or may not be known. Usually, this number is not known up front because the result set is built
on the fly. A
cursor can be used by client applications to fetch a few rows of the result set at a time.
Sorting
In SQL, there is no guarantee that the rows of a result set returned by a
SELECT
query are in any particular order unless the
ORDER BY
clause is used in the query, which sorts the rows of the result set in ascending or descending order based on one or more columns.
References
Databases
{{database-software-stub