1 / 18

Query-By-Example

Query-By-Example. Ping Zhou 2008.3. Introduction to QBE. Query-By-Example A high-level database management language Alternation to SQL for querying relational database Can be translated to SQL Developed at IBM (M. Zloof) Many Databases have QBE-like extension. Why QBE?.

coen
Download Presentation

Query-By-Example

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Query-By-Example Ping Zhou 2008.3

  2. Introduction to QBE • Query-By-Example • A high-level database management language • Alternation to SQL for querying relational database • Can be translated to SQL • Developed at IBM (M. Zloof) • Many Databases have QBE-like extension Ping Zhou / CS 2310 Course Seminar

  3. Why QBE? • Convenient and unified way to query, update, define and control database • Requires little knowledge to the user, minimizes the concepts user needs to learn • Simple yet wide coverage of transactions • Graphical and tabular interface Ping Zhou / CS 2310 Course Seminar

  4. Basic Concepts • Instead of writing text SQL commands… • Programming is done within 2-D “skeleton tables” • Constant vs Variable Ping Zhou / CS 2310 Course Seminar

  5. Basic Queries (1) • Print the names and ages of all sailors… Variables that appear only once can be omitted Shorthand to print all fields Ping Zhou / CS 2310 Course Seminar

  6. Basic Queries (2) • Selections – Place constant in some field Print all sailors with rating=10 Ping Zhou / CS 2310 Course Seminar

  7. Ordering and Grouping • Order the answer using AO (ascending order) or DO (descending order) Duplicate tuples can be eliminated by using UNO. Ping Zhou / CS 2310 Course Seminar

  8. Queries Over Multiple Relations • Select tuples from two relations by placing same variable at join column Find sailors who reserved a boat for 8/24/96, and who are older than 25. Ping Zhou / CS 2310 Course Seminar

  9. Select Using Condition Box • Condition box • Express a condition involving two or more columns. E.g.: _R/_A > 0.2 • Express a condition involving aggregate operation on a group • Express a condition involving AND and OR operators Ping Zhou / CS 2310 Course Seminar

  10. Unnamed Columns • Create unnamed column for display • Display fields from more than one tables Ping Zhou / CS 2310 Course Seminar

  11. Updating Tables using QBE (1) • Insertion, Deletion and Updating are done in the same way in QBE • Insertion Ping Zhou / CS 2310 Course Seminar

  12. Updating Tables using QBE (2) • Deleting • Updating Ping Zhou / CS 2310 Course Seminar

  13. Changes Brought by QBE • User Interface • Text command -> Graphical, Tabular • User draw the table he wants directly • Easier to learn • Higher scores than SQL users in paper and pencil testing Ping Zhou / CS 2310 Course Seminar

  14. QBE / OBE • OBE: Office Procedure by Example • Incorporate QBE into office automation • Research project developed by IBM Ping Zhou / CS 2310 Course Seminar

  15. Spatial QBE • Adding spatial extension to QBE Retrieve all ATMs along Route 64 Retrieve all banks within 100 meters from Washington Hotel. Ping Zhou / CS 2310 Course Seminar

  16. Multimedia Queries with QBE • Similarity function Find all oil paintings from a Dutch painter which are similar to the given picture. Ping Zhou / CS 2310 Course Seminar

  17. References • Query-By-Example: a data base language, M. Zloof, 1977 • Query-By-Example (QBE), http://pages.cs.wisc.edu/~dbbook/openAccess/thirdEdition/qbe.pdf • A Human Factors Experimental Comparison of SQL and QBE, Minnie Yi-Miin Yen and Richard W. Scamell, 1993 • Spatial QBE Interface for Web GIS, Shapiee Abd Rahman, Subhash Bhalla, 2005 • WS-QBE: A QBE-like Query Language for Complex Multimedia Queries, Ingo Schmitt, Nadine Schulz, Thomas Herstel, 2005 Ping Zhou / CS 2310 Course Seminar

  18. Thank You! Ping Zhou / CS 2310 Course Seminar

More Related