For a given preference this shows the PREFERRING
clause of a database query in different SQL dialects which support preferences.
show.query(p, dialect = "EXASOL", df = NULL)
A preference.
The preference query dialect, which determines the syntax of the returned query. This has to be one of the following (not case sensitive):
'EXASOL'
:Syntax of the "Skyline" feature of the commercial database Exasol EXASolution 5.
'Preference SQL'
or 'PSQL'
:Syntax of the Preference SQL system. This is a research prototype developed at the Chair of Databases and Information Systems of the University of Augsburg. See references for details.
Optional parameter to specify a data frame on which the preference operates causing a partial evaluation. See show.pref
for details.
There are few database systems supporting Skyline queries.
A Skyline query consists of a usual SQL query followed by a PREFERRING
-clause (in some rarely used dialects also SKYLINE OF
).
For example consider a database table r(a,b). The preference selection psel(r, low(a) * high(b))
can be expressed by (in the Exasol dialect):
SELECT * FROM r PREFERRING LOW a PLUS HIGH b
The show.query
function generates just the PREFERRING
-clause, i.e. show.query(low(a) * high(b))
returns
PREFERRING LOW a PLUS HIGH b
As usual in SQL queries, all keywords are not case sensitive, i.e., PLUS
or plus
does not make any difference.
W. Kiessling, M. Endres, F. Wenzel (2011): The Preference SQL System - An Overview. IEEE Data Engineering Bulletin, Vol. 34 No. 3, pages 12-19.
S. Mandl, O. Kozachuk, M. Endres, W. Kiessling (2015): Preference Analytics in EXASolution. 16th Conference on Database Systems for Business, Technology, and Web.
show.query(low(a) * high(b))
show.query(low(a) * high(b), dialect = 'Preference SQL')
Run the code above in your browser using DataLab