The Rule Query Language (RQL) is an SQL-like pattern mining language that extends and generalizes functional dependencies to new and unexpected rules. It brings to the data analysts' desktop a convenient tool to discover logical implications between attributes of the database. Such implications may reveal data quality problems or surprising correlations between attributes over some part of the database. The computation of RQL queries is based on a query rewriting technique that pushes as much processing as possible to the underlying DBMS. This contribution is an attempt to bridge the gap between pattern mining and databases and facilitates the use of data mining techniques by SQL-aware analysts and students.