Abstract
People always learn through examples to look for the possible solutions to generate the desired results correctly. Therefore, these examples have become the important sources for end-users to gain their understandings towards the systems, thus improving their user experiences. Unexceptionally, it is also desirable to provide this convenience in various database systems, e.g., the relational database management system (RDBMS). Conventionally, without accessing the SQL and database schema, users cannot produce any meaningful results from the data. Besides, the state-of-art solutions still necessitate at least these foundations to fully utilize the data. Nevertheless, reverse engineering subverts the process of querying database, which the result tables are applied to dis-cover the corresponding SQL queries from a relational database without any technical skills provided by users. It bridges the understanding gap by letting the end-users to interpret the discovered SQL queries, and hence improving the database usability. In this dissertation, we study and design solutions for enhancing the usability of re-lational databases by evolving the concept of reverse engineering SQL queries. Online Analytics Processing (OLAP) is one of the most important features in SQL program-ming. In an OLAP query, the group-by is responsible to split the data into the distinct groups whereas the aggregation is responsible for summarizing every distinct group data into its distinct value. First, we introduce a principled solution to discover OLAP-style aggregation queries. The proposed algorithm operates in three phases, which are used to discover the group-bys, aggregations and selection ?lters respectively. Sec-ond, we propose a generic framework which can support both join and OLAP-style aggregation queries by expanding the current solution, to enhance the expressiveness. Third, we design a visual interface to allow the database end-users to implement the solution as long as they could provide the spreadsheet result tables as input examples to discover the most plausible SQL queries.