Abstract
In this paper, we propose a new approach, called Query from Examples (QFE), to help non-expert database users construct SQL queries. Our approach, which is designed for users who might be unfamiliar with SQL, only requires that the user is able to determine whether a given output table is the result of his or her intended query on a given input database. To kick-start the construction of a target query Q, the user first provides a pair of inputs: a sample database D and an output table R which is the result of Q on D. As there will be many candidate queries that transform D to R, QFE winnows this collection by presenting the user with new database-result pairs that distinguish these candidates. Unlike previous approaches that use synthetic data for such pairs, QFE strives to make these distinguishing pairs as close to the original (D,R) pair as possible. By doing so, it seeks to minimize the effort needed by a user to determine if a new database-result pair is consistent with his or her desired query. We demonstrate the effectiveness and efficiency of our approach using real datasets from SQLShare, a cloud-based platform designed to help scientists utilize RDBMS technology for data analysis.
- Sloan digital sky survey. http://www.sdss.org/.Google Scholar
- J. Akbarnejad, G. Chatzopoulou, M. Eirinaki, S. Koshy, S. Mittal, D. On, N. Polyzotis, and J. S. V. Varman. SQL QueRIE recommendations. PVLDB, 3(1-2), 2010. Google ScholarDigital Library
- B. Alexe, L. Chiticariu, R. J. Miller, and W. C. Tan. Muse: Mapping understanding and design by example. In ICDE, 2008. Google ScholarDigital Library
- B. Alexe, L. Chiticariu, and W.-C. Tan. Spider: A schema mapping debugger. In VLDB, 2006. Google ScholarDigital Library
- U. Çetintemel, M. Cherniack, J. DeBrabant, Y. Diao, K. Dimitriadou, A. Kalinin, O. Papaemmanouil, and S. B. Zdonik. Query steering for interactive data exploration. In CIDR, 2013.Google Scholar
- G. Chatzopoulou, M. Eirinaki, and N. Polyzotis. Query recommendations for interactive database exploration. In SSDBM, 2009. Google ScholarDigital Library
- G. Chatzopoulou et al. The QueRIE system for personalized query recommendations. IEEE Data Eng. Bull., 34(2), 2011.Google Scholar
- K. Dimitriadou, O. Papaemmanouil, and Y. Diao. Explore-by-example: An automatic query steering framework for interactive data exploration. In SIGMOD, 2014. Google ScholarDigital Library
- A. Giacometti, P. Marcel, E. Negre, and A. Soulet. Query recommendations for OLAP discovery driven analysis. In DOLAP, 2009. Google ScholarDigital Library
- B. Howe, G. Cole, N. Khoussainova, and L. Battle. Automatic starter queries for ad hoc databases. In SIGMOD(demo), 2011. Google ScholarDigital Library
- B. Howe, G. Cole, E. Souroush, P. Koutris, A. Key, N. Khoussainova, and L. Battle. Database-as-a-service for long-tail science. In SSDBM, 2011. Google ScholarDigital Library
- N. Khoussainova et al. Snipsuggest: Context-aware autocompletion for SQL. PVLDB, 4(1), 2010. Google ScholarDigital Library
- N. Khoussainova, Y. Kwon, W.-T. Liao, M. Balazinska, W. Gatterbauer, and D. Suciu. Session-based browsing for more effective query reuse. In SSDBM, 2011. Google ScholarDigital Library
- H. Li, C.-Y. Chan, and D. Maier. Query from examples: An iterative, data-driven approach to query construction. Technical report, National University of Singapore, August 2015. http://www.comp.nus.edu.sg/~chancy/techreport-august-2015-qfe.pdf.Google Scholar
- H. Mannila and K.-J. Räihä. Automatic generation of test data for relational queries. J. Comput. Syst. Sci., 38(2), 1989.Google ScholarCross Ref
- F. D. Marchi, S. Lopes, and J.-M. Petit. Efficient algorithms for mining inclusion dependencies. In EDBT, 2002. Google ScholarDigital Library
- A. Nandi and H. V. Jagadish. Assisted querying using instant-response interfaces. In SIGMOD, 2007. Google ScholarDigital Library
- C. Olston, B. Reed, U. Srivastava, R. Kumar, and A. Tomkins. Pig Latin: A not-so-foreign language for data processing. In SIGMOD, 2008. Google ScholarDigital Library
- L. Qian, M. J. Cafarella, and H. V. Jagadish. Sample-driven schema mapping. In SIGMOD, 2012. Google ScholarDigital Library
- S. Shah et al. Generating test data for killing SQL mutants: A constraint-based approach. In ICDE, 2011. Google ScholarDigital Library
- Q. T. Tran, C.-Y. Chan, and S. Parthasarathy. Query reverse engineering. The VLDB Journal, 23(5), 2014. Google ScholarDigital Library
- K. Yessenov, S. Tulsiani, A. Menon, R. C. Miller, S. Gulwani, B. Lampson, and A. Kalai. A colorful approach to text processing by example. In UIST, 2013. Google ScholarDigital Library
- M. Zhang, H. Elmeleegy, C. M. Procopiuc, and D. Srivastava. Reverse engineering complex join queries. In SIGMOD, 2013. Google ScholarDigital Library
Index Terms
- Query from examples: an iterative, data-driven approach to query construction
Recommendations
Interactive Query Synthesis from Input-Output Examples
SIGMOD '17: Proceedings of the 2017 ACM International Conference on Management of DataThis demo showcases Scythe, a novel query-by-example system that can synthesize expressive SQL queries from input-output examples. Scythe is designed to help end-users program SQL and explore data simply using input-output examples. From a web-browser, ...
Query Folding
ICDE '96: Proceedings of the Twelfth International Conference on Data EngineeringQuery folding refers to the activity of determining if and how a query can be answered using a given set of resources, which might be materialized views, cached results of previous queries, or queries answerable by other databases. We investigate query ...
Click Feedback-Aware Query Recommendation Using Adversarial Examples
WWW '19: The World Wide Web ConferenceSearch engine users always endeavor to formulate proper search queries during online search. To help users accurately express their information need during search, search engines are equipped with query suggestions to refine users' follow-up search ...
Comments