show.query: Show Preferences in Database Query Languages

View source: R/show-pref.r

show.queryR Documentation

Show Preferences in Database Query Languages

Description

For a given preference this shows the PREFERRING clause of a database query in different SQL dialects which support preferences.

Usage

show.query(p, dialect = "EXASOL", df = NULL)

Arguments

p

A preference.

dialect

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.

df

Optional parameter to specify a data frame on which the preference operates causing a partial evaluation. See show.pref for details.

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.

References

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.

Examples


show.query(low(a) * high(b))

show.query(low(a) * high(b), dialect = 'Preference SQL')


rPref documentation built on Feb. 16, 2023, 6:09 p.m.