We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!
Presentation is loading. Please wait.
Published byCelia Sutt
Modified about 1 year ago
©Silberschatz, Korth and Sudarshan5.1Database System Concepts Chapter 5: Other Relational Languages Query-by-Example (QBE) Datalog
©Silberschatz, Korth and Sudarshan5.2Database System Concepts Query-by-Example (QBE) A graphical query language which is based (roughly) on the domain relational calculus Two dimensional syntax – system creates templates of relations that are requested by users Queries are expressed “by example” Microsoft Access supports a variant of QBE called Graphical Query By Example (GQBE)
©Silberschatz, Korth and Sudarshan5.3Database System Concepts QBE Skeleton Tables for the Bank Example
©Silberschatz, Korth and Sudarshan5.4Database System Concepts Queries on One Relation Find all loan numbers at the Perryridge branch. _x is a variable (optional; can be omitted in above query) P. means print (display) duplicates are removed by default Find the names of all customers who have a loan from the Perryridge branch.
©Silberschatz, Korth and Sudarshan5.5Database System Concepts The Condition Box Allows the expression of constraints on domain variables that are either inconvenient or impossible to express within the skeleton tables. Complex conditions can be used in condition boxes E.g. Find the loan numbers of all loans made to Smith, to Jones, or to both jointly
©Silberschatz, Korth and Sudarshan5.6Database System ConceptsDatalog Prolog-like logic-based language that allows recursive queries (based on first-order logic) A Datalog program consists of a set of rules that define views. Example: define a view relation v1 containing account numbers and balances for accounts at the Perryridge branch with a balance of over $700. v1(A, B) :– account(A, “Perryridge”, B), B > 700. Retrieve the balance of account number “A-217” in the view relation v1. ? v1(“A-217”, B). To find account number and balance of all accounts in v1 that have a balance greater than 800 ? v1(A,B), B > 800
©Silberschatz, Korth and Sudarshan5.7Database System Concepts Syntax of Datalog Rules A (positive) literal has the form p(t 1, t 2..., t n ) p is the name of a relation with n attributes each t i is either a constant or variable Comparison operations are treated as predicates E.g. X > Y is treated as a predicate >(X,Y) “>” is conceptually an (infinite) relation that contains all pairs of values such that the first value is greater than the second value Arithmetic operations are also treated as predicates E.g. A = B + C is treated as +(B, C, A), where the relation “+” contains all triples such that the third value is the sum of the first two
©Silberschatz, Korth and Sudarshan5.8Database System Concepts Syntax of Datalog Rules (Cont.) Rules are built out of literals and have the form: p(t 1, t 2,..., t n ) :– L 1, L 2,..., L m. each of the L i ’s is a literal head – the literal p(t 1, t 2,..., t n ) body – the rest of the literals A fact is a rule with an empty body, written in the form: p(v 1, v 2,..., v n ). indicates tuple (v 1, v 2,..., v n ) is in relation p
Chapter 5: Other Relational Languages Query-by-Example (QBE) Datalog.
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 5: Other Relational.
Relational Calculus and Datalog Helena Galhardas DEI IST (Slides baseados No Cap 5 livro DB Concepts Silberchatz et al, e disciplina CSE330 – Database.
Chapter 4: SQL Basic Structure Data Definition Language Modification of the Database Set Operations Aggregate Functions Null Values Nested.
©Silberschatz, Korth and Sudarshan3.1Database System Concepts - 5 th Edition Chapter 3: SQL History Data Definition Basic Structure of SQL Queries Set.
Chapter 3: Relational Model Structure of Relational Databases Normal forms (chap. 7) Reduction of an E-R Schema to Relational (Sect. 2.9) Relational.
Dr. Alexandra I. Cristea CS 319: Theory of Databases: C4.
Chapter 3: Relational Model Structure of Relational Databases Relational Algebra Tuple Relational Calculus Domain Relational Calculus Extended Relational-Algebra-Operations.
Chapter 4: SQL Basic Structure Set Operations Aggregate Functions Null Values Nested Subqueries Derived Relations Views Modification of the Database Joined.
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 13: Query Processing.
Multiple Table Queries A Guide to SQL – Chapter 5.
CS 101 Attendance 3/27/14. A query using “AND” will A.Generate more answers than the same thing with OR B.Generate fewer answers than the same query with.
1 Relational Algebra Chapter 4, Part A. 2 Relational Query Languages Query languages: Allow manipulation and retrieval of data from a database. Relational.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts 2IJ60: Informatica 6 (Databases) Docent: dr. Natalia Sidorova 5 studiepunten.
Chapter 14 Query Optimization. ©Silberschatz, Korth and Sudarshan14.2Database System Concepts 3 rd Edition Chapter 14: Query Optimization Introduction.
McGraw-Hill/Irwin Copyright © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. ENTERPRISE INFORMATION SYSTEMS A PATTERN BASED APPROACH Chapter.
More Slides on “Division Operation” in Relational Algebra Query Language (& together with examples on Assignment operation)
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 23: XML.
Relational Database Systems Higher Information Systems Advanced Implementation in Microsoft Access.
Databases. A database program can be used to: sort a file into a different order Maintain contact with clients search through the records for a.
SAPScript Forms. SAPScript Form Components SAPScript Form Components A form of the graphical Form Painter consists of five components. In alphanumeric.
First Order Logic Logic is a mathematical attempt to formalize the way we think. First-order predicate calculus was created in an attempt to mechanize.
BD05/06 PL/SQL Introduction Structure of a block Variables and types Accessing the database Control flow Cursors Exceptions Procedures.
WHERE Clause Chapter 2. Objectives Limit rows by using a WHERE clause Use the LIKE operator Effect of NULL values Use compound conditions Use the BETWEEN.
UNIT IV. Definition of Array: An array is defined to be a group of logically related data items of similar type, stored in contiguous memory locations,
Chapter 6: Integrity and Security Domain Constraints Referential Integrity Assertions Triggers Security Authorization Authorization in SQL.
Flow of Control Chapter 3. Objectives learn about Java branching statements learn about loops learn about the type boolean (optional) learn to use color.
Relational data objects 1 Lecture 6. Relational data objects 2 Answer to last lectures activity.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
©Silberschatz, Korth and Sudarshan8.1Database System Concepts Chapter 8: Object-Oriented Databases Need for Complex Data Types The Object-Oriented Data.
© 2016 SlidePlayer.com Inc. All rights reserved.