Sergio Greco, Cristian Molinaro, Francesco Parisi



The paper proposes the use of preferences for querying databases. In expressing queries it is natural to express preferences among tuples belonging to the answer. This can be done in commercial DBMS, for instance, by ordering the tuples in the result. The paper presents a different proposal, based on similar approaches deeply investigated in the artificial intelligence field, where preferences are used to restrict the result of queries posed over databases. In our proposal a query over a database DB is a triple (q, P, Φ), where q denotes the output relation, P a Datalog program (or an SQL query) used to compute the result and Φ is a set of preference rules used to introduce preferences on the computed tuples. In our proposal tuples which are ”dominated” by other tuples do not belong to the result and cannot be used to infer other tuples. A new stratified semantics is presented where the program P is partitioned into strata and the preference rules associated to each stratum of P are divided into layers; the result of a query is carried out by computing one stratum at time and by applying the preference rules, one layer at time. We show that our technique is sound and that the complexity of computing queries with preference rules is still polynomial.


  1. Agrawal, R., and Wimmers, E. L. (2002). A framework for expressing and combining preferences. Proc. SIGMOD, pp. 297-306.
  2. Borzsonyi S., Kossmann D., Stocker K. (2001). The skyline operator, Proc. ICDE, 421-430.
  3. Brewka, G. (2004). Complex Preferences for Answer Set Optimization, KR, 213-223.
  4. Brewka G., Niemela I., Truszczynski M. (2003). Answer Set Optimization. IJCAI, 867-872.
  5. Chomicki, J. (2003). Preference Formulas in Relational Queries. ACM TODS, 28(4), 1-40.
  6. Chomicki, J., Godfrey, P., Gryz, J., and Liang, D. (2003). Skyline with presorting. Proc. ICDE.
  7. Delgrande, J., P., Schaub, T., Tompits, H. (2003). A Framework for Compiling Preferences in Logic Programs. TPLP, 3(2), 129-187.
  8. Gelfond, M., Son, T.C. (1997). Reasoning with prioritized defaults. LPKR, 164-223.
  9. Kossmann, D., Ramsak, F., and Rost, S. (2002). Shooting stars in the sky: An online algorithm for skyline queries. Proc. VLDB.
  10. Kostler, G., Kießling, W., Thone, H., Guntzer, U. (1995). Fixpoint iteration with subsumption in deductive databases. JIIS, 4, 123-148.
  11. Lacroix M., Lavency P.(1987). Prefences: Putting More Knowledge Into Queries. VLDB, 217-225.
  12. Papadias, D., Tao, Y., Fu, G., and Seeger, B. (2003). An optimal and progressive algorithm for skyline queries, Proc. SIGMOD, pp. 467-478.
  13. Sakama, C., Inoue, K. (2000). Priorized logic programming and its application to commonsense reasoning. Artificial Intelligence, 123, 185-222.
  14. Torlone, R., Paolo Ciaccia. (2002). Finding the Best when it's a Matter of Preference, Proc. SEBD, pp. 347-360.
  15. Ullman, J. K. (1988). Principles of Database and Knowledge-Base Systems, Vol. 1, Computer Science Press.
  16. Zhang, Y., Foo, N. (1997). Answer sets for prioritized logic programs. ILPS, 69-83.

Paper Citation

in Harvard Style

Greco S., Molinaro C. and Parisi F. (2007). PREFERENCE RULES IN DATABASE QUERYING . In Proceedings of the Ninth International Conference on Enterprise Information Systems - Volume 1: ICEIS, ISBN 978-972-8865-88-7, pages 119-124. DOI: 10.5220/0002389901190124

in Bibtex Style

author={Sergio Greco and Cristian Molinaro and Francesco Parisi},
booktitle={Proceedings of the Ninth International Conference on Enterprise Information Systems - Volume 1: ICEIS,},

in EndNote Style

JO - Proceedings of the Ninth International Conference on Enterprise Information Systems - Volume 1: ICEIS,
SN - 978-972-8865-88-7
AU - Greco S.
AU - Molinaro C.
AU - Parisi F.
PY - 2007
SP - 119
EP - 124
DO - 10.5220/0002389901190124