SQLf is a
SQL
Structured Query Language (SQL) (pronounced ''S-Q-L''; or alternatively as "sequel")
is a domain-specific language used to manage data, especially in a relational database management system (RDBMS). It is particularly useful in handling s ...
extended with
fuzzy set theory
Fuzzy or Fuzzies may refer to:
Music
* Fuzzy (band), a 1990s Boston indie pop band
* Fuzzy (composer), Danish composer Jens Vilhelm Pedersen (born 1939)
* ''Fuzzy'' (album), 1993 debut album of American rock band Grant Lee Buffalo
* "Fuzzy", a ...
application for expressing flexible (
fuzzy) queries to traditional (or ″Regular″) Relational Databases. Among the known extensions proposed to SQL, at the present time, this is the most complete, because it allows the use of diverse fuzzy elements in all the constructions of the language SQL.
SQLf is the only known proposal of flexible query system allowing linguistic quantification over set of rows in queries, achieved through the extension of SQL nesting and partitioning structures with fuzzy quantifiers. It also allows the use of quantifiers to qualify the quantity of search criteria satisfied by single rows. Several mechanisms are proposed for query evaluation, the most important being the one based on the derivation principle.
This consists in deriving classic queries that produce, given a threshold ''t'', a ''t''-cut of the result of the fuzzy query, so that the additional processing cost of using a fuzzy language is diminished.
Basic block
The fundamental querying structure of SQLf is the multi-relational block. The conception of this structure is based on the three basic operations of the
relational algebra
In database theory, relational algebra is a theory that uses algebraic structures for modeling data and defining queries on it with well founded semantics (computer science), semantics. The theory was introduced by Edgar F. Codd.
The main applica ...
:
projection
Projection or projections may refer to:
Physics
* Projection (physics), the action/process of light, heat, or sound reflecting from a surface to another in a different direction
* The display of images by a projector
Optics, graphics, and carto ...
,
cartesian product
In mathematics, specifically set theory, the Cartesian product of two sets and , denoted , is the set of all ordered pairs where is an element of and is an element of . In terms of set-builder notation, that is
A\times B = \.
A table c ...
and
selection
Selection may refer to:
Science
* Selection (biology), also called natural selection, selection in evolution
** Sex selection, in genetics
** Mate selection, in mating
** Sexual selection in humans, in human sexuality
** Human mating strat ...
, and the application of fuzzy sets’ concepts. The result of a SQLf query is a fuzzy set of rows that is a fuzzy relation instead of a regular relation.
A basic block in SQLf consists of a
SELECT
clause, a
FROM
From may refer to:
People
*Isak From (born 1967), Swedish politician
*Martin Severin From (1825–1895), Danish chess master
* Sigfred From (1925–1998), Danish chess master
Media
* ''From'' (TV series), a sci-fi-horror series that debuted ...
clause and an optional
WHERE
clause. The semantic of this query structure is:
* The
SELECT
clause corresponds to the projection. It specifies the relations’ attributes (or attribute expressions) that will be selected. The resulting table is a fuzzy set and it is given in decreasing ordered of satisfaction degree.
* The
SELECT
clause specifies also a calibration that is intended to restrict the set of rows retrieved. There are two kinds of calibrations: quantitative and qualitative. In quantitative calibration the user specifies the number of results to be retrieved, so that the query will retrieve the rows with highest membership degrees up to the number of required answers. In qualitative calibration the user specifies a minim level of satisfaction that must have any retrieved row.
* The
FROM
clause corresponds to the Cartesian Product. The consult is made on the Cartesian Product of the relations that are specified in this clause.
* The
WHERE
clause corresponds to the selection. It specifies the condition for which the satisfaction degree will be calculated. Rows that do not satisfy at all the condition are rejected. This condition is a fuzzy predicate that may involve any attribute of the relations.
The following is an example of a
SELECT
query that returns a list of hotels that are cheap. The query retrieves all rows from the ''Hotels'' table that satisfice the fuzzy predicate ''cheap'' defined by the fuzzy set
μ=(, , 25, 30). The result is sorted in descending order by the membership degree of the query.
SELECT name, address
FROM Hotels
WHERE price = cheap;
References
{{Query languages
Data modeling languages
Declarative programming languages
Query languages
Relational database management systems
SQL
Fuzzy logic
Non-classical logic
Database management systems