Query Processing. 2 Basic Concepts Query Processing – activities involved in retrieving and manipulating data from the database: SQL query translation.

Slides:



Advertisements
Similar presentations
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification.
Advertisements

The Relational Model and Relational Algebra Nothing is so practical as a good theory Kurt Lewin, 1945.
1 CHAPTER 4 RELATIONAL ALGEBRA AND CALCULUS. 2 Introduction - We discuss here two mathematical formalisms which can be used as the basis for stating and.
Management Information Systems, Sixth Edition
The Relational Database Model
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification.
Group 3 Akash Agrawal and Atanu Roy 1 Raster Database.
Introduction to Structured Query Language (SQL)
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 52 Database Systems I Relational Algebra.
CS263 Lecture 19 Query Optimisation.  Motivation for Query Optimisation  Phases of Query Processing  Query Trees  RA Transformation Rules  Heuristic.
Introduction to Structured Query Language (SQL)
Database Management Systems, R. Ramakrishnan and J. Gehrke1 Relational Algebra Chapter 4, Part A.
CH 11 Multimedia IR: Models and Languages
Database Systems More SQL Database Design -- More SQL1.
Introduction to Structured Query Language (SQL)
1 Chapter 2 Reviewing Tables and Queries. 2 Chapter Objectives Identify the steps required to develop an Access application Specify the characteristics.
CORE 2: Information systems and Databases STORAGE & RETRIEVAL 2 : SEARCHING, SELECTING & SORTING.
Query Processing Presented by Aung S. Win.
ASP.NET Programming with C# and SQL Server First Edition
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Database Performance Tuning and Query Optimization.
Chapter 3 Single-Table Queries
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor Ms. Arwa.
1 Relational Algebra and Calculus Chapter 4. 2 Relational Query Languages  Query languages: Allow manipulation and retrieval of data from a database.
Multimedia Databases (MMDB)
CSE314 Database Systems More SQL: Complex Queries, Triggers, Views, and Schema Modification Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
Database Technical Session By: Prof. Adarsh Patel.
Chapter 6 1 © Prentice Hall, 2002 The Physical Design Stage of SDLC (figures 2.4, 2.5 revisited) Project Identification and Selection Project Initiation.
Lecture2: Database Environment Prepared by L. Nouf Almujally & Aisha AlArfaj 1 Ref. Chapter2 College of Computer and Information Sciences - Information.
1 Single Table Queries. 2 Objectives  SELECT, WHERE  AND / OR / NOT conditions  Computed columns  LIKE, IN, BETWEEN operators  ORDER BY, GROUP BY,
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Chapter 18 Object Database Management Systems. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for object.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 Relational Algebra.
Views Lesson 7.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
1 Relational Algebra and Calculas Chapter 4, Part A.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
IS 230Lecture 6Slide 1 Lecture 7 Advanced SQL Introduction to Database Systems IS 230 This is the instructor’s notes and student has to read the textbook.
Creating and Maintaining Geographic Databases. Outline Definitions Characteristics of DBMS Types of database Relational model SQL Spatial databases.
Database Management Systems, R. Ramakrishnan1 Relational Algebra Module 3, Lecture 1.
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
Session 1 Module 1: Introduction to Data Integrity
9-1 © Prentice Hall, 2007 Topic 9: Physical Database Design Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
A Guide to SQL, Eighth Edition Chapter Four Single-Table Queries.
BIT 3193 MULTIMEDIA DATABASE CHAPTER 4 : QUERING MULTIMEDIA DATABASES.
Lecture 15: Query Optimization. Very Big Picture Usually, there are many possible query execution plans. The optimizer is trying to chose a good one.
11-1 © Prentice Hall, 2004 Chapter 11: Physical Database Design Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
7 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel 7.6 Advanced Select Queries SQL provides useful functions that.
LM 5 Introduction to SQL MISM 4135 Instructor: Dr. Lei Li.
 CONACT UC:  Magnific training   
1 SQL: The Query Language. 2 Example Instances R1 S1 S2 v We will use these instances of the Sailors and Reserves relations in our examples.
Concepts of Database Management, Fifth Edition Chapter 3: The Relational Model 2: SQL.
Data Resource Management Data Concepts Database Management Types of Databases Chapter 5 McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies,
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
More SQL: Complex Queries, Triggers, Views, and Schema Modification
CHAPTER 7 DATABASE ACCESS THROUGH WEB
SQL Query Getting to the data ……..
MySQL Subquery Source: Dev.MySql.com
Introduction Multimedia initial focus
Database Systems: Design, Implementation, and Management Tenth Edition
JDBC.
Relational Algebra Chapter 4, Part A
MANAGING DATA RESOURCES
Data Model.
Database Systems Instructor Name: Lecture-3.
Chapter 8 Advanced SQL.
Database Systems: Design, Implementation, and Management Tenth Edition
Query Optimization.
Presentation transcript:

Query Processing

2 Basic Concepts Query Processing – activities involved in retrieving and manipulating data from the database: SQL query translation into low-level language implementing relational algebra Query execution

3 Phases of Query Processing

4 Relational Algebra Relational algebra defines basic operations on relation instances Results of operations are also relation instances

5 Operations Most of these operation can be summarized as being concerned with: Manipulation (editing and modifying) Presentation Analysis (indexing and searching)

Range of Operations OperationTextAudioGraphicImageAnimationVideo Manipulation Character String Editing Sample Waveform Audio editing Primitive editing Structural editing Shading Geometric Pixel operation Filtering Primitive editing Structural editing Frame manipulation Pixel operation Presentation Formatting Encryption Sorting Synchronization compression Conversion Mapping compression Lighting Rendering viewing Compositing Compression conversion Synchronization Compression rendering Synchronization Compression Video effects Mixing conversion Analysis Indexing searching Indexing searching Indexing searching Indexing searching Indexing searching Indexing searching 6

7 Query Decomposition Analysis Normalization Semantic analysis Simplification Query restructuring

8 Relational Algebra Expressions The result of a relational operation is a relation instance Relational algebra expression combines relation instances using relational algebra operations Relational algebra expression produce the result of a query

9 Simple SQL Query SELECT FROM WHERE Group By Having

10 Conceptual Evaluation Strategy for Simple Query Compute the cross-product of tables in from-list Delete those rows which fail the qualification condition Delete all columns that do not appear in the select-list If DISTINCT clause is specified, eliminate duplicate rows.

11 Nested Queries Query block: Single SELECT_FROM_WHERE expression May include GROUP BY and HAVING Query block – basic unit that is translated into RA expression and optimized SQL query is decomposed into query blocks

Querying MMDBMS Process of querying multimedia can approach in two ways: ‘What’ information can be retrieved ‘How’ information can be retrieved 12

‘What’ Approach Divided into 3 levels of complexity Level 1, Retrieval of Primitive Features Such as color, shape, texture, spatial location and object movement. Query Ex.: “Find clips of objects flying from top-right to bottom-left of screen” Level 2, Retrieval of Logical Process Related to the identity of object within the media Query Ex.: “Find a clips of an aero plane taking-off” 13

‘What’ Approach (cont.) Level 3, Retrieval of Abstract Attributes Associated with an understanding of the nature or purpose of the object Query Ex.: “Find a picture of nutritional disasters” Level 2 and 3 are regarded as Semantic Media Retrieval. However, Success in answering multimedia query is largely limited to level 1. The difference between simple queries at level 1 and those at level 2 and 3 has been called the semantic gap. 14

‘How’ Approach This approach can be classified on the basis of whether is retrieved by: Attribute-based retrieval Text-based retrieval Content-based retrieval 15

‘How’ Approach Attribute-based retrieval (ABR) ABR is a method that uses a set of structured attributes in the same way as traditional DBMS. It uses essentially the similar principles, except that these must be able to cope with gigantic media object such as video clip. This method can be particularly effective with text. However, the method does not make use of the rich content of image and retrieve information so that is essentially limited to level 1 queries. 16

‘How’ Approach Text-based retrieval (TBR) TBR methods work by adding annotations, usually brief descriptions combined with some structured data. An example of system with this capability was the Kodak’s picture exchange. Disadvantage of the system is that they are very difficult in practice. 17

‘How’ Approach Content-based retrieval (CBR) CBR is developed to try to overcome some of the difficulties of TBR. The idea is that the important details can be extracted from the media by automatic method which will be more efficient for data capture and reliable for retrieval. 18

Ontology Providing a shared understanding of the application domain that can be communicated between people and computer and incorporated in the database as part of the metadata. It means that key information about the kind of object in the database can be captured and reused many times for many different queries with any kind of media data. 19

Metadata Usage in Querying Considering role of metadata for media separation Considering design to classify metadata and relate this to three type of information retrieval Content Independent – used in ABR Content Descriptive – used in TBR Content Dependent – use in CBR 20

Role of Metadata in Querying 21 Query Metadata Image Metadata Media independent metadata Meta-Correlation Text Metadata Media dependent Media preprocessor Media dependent Media preprocessor Image Text Conceptual data view Ontologies Physical Storage view Example of role of metadata in Querying

Query Language

Structured Query Language Query languages are generalized computer language that is used to interrogate database and information systems. Query languages can be classified according to database query languages or information retrieval query languages. information retrieval query languages Marina G. Erechtchoukova23

Structured Query Language (SQL) scope includes data insert, query, update and delete, schema creation and modification, and data access control.schema SQL was developed at IBM by Donald D. Chamberlin and Raymond F. Boyce in the early 1970s. This version, initially called SEQUEL (Structured English Query Language), was designed to manipulate and retrieve data stored in IBM's original quasi-relational database management system.IBMDonald D. ChamberlinRaymond F. Boyce Marina G. Erechtchoukova24

The most common operation in SQL is the query, which is performed with the declarative SELECT statement. SELECT retrieves data from one or more tables, or expressions.SELECT tables Standard SELECT statements have no persistent effects on the database. Some non-standard implementations of SELECT can have persistent effects, such as the SELECT INTO syntax that exists in some databases. Marina G. Erechtchoukova25

Queries allow the user to describe desired data, leaving the database management system (DBMS) responsible for planning, optimizing, and performing the physical operations necessary to produce that result as it chooses.database management system (DBMS)planning optimizing Marina G. Erechtchoukova26

A query includes a list of columns to be included in the final result immediately following the SELECT keyword. An asterisk ("*") can also be used to specify that the query should return all columns of the queried tables. SELECT is the most complex statement in SQL, with optional keywords and clauses that include: Marina G. Erechtchoukova27

The FROM clause which indicates the table(s) from which data is to be retrieved. The FROM clause can include optional JOIN subclauses to specify the rules for joining tables.FROMJOIN The WHERE clause includes a comparison predicate, which restricts the rows returned by the query. The WHERE clause eliminates all rows from the result set for which the comparison predicate does not evaluate to True.WHERE Marina G. Erechtchoukova28

The GROUP BY clause is used to project rows having common values into a smaller set of rows. GROUP BY is often used in conjunction with SQL aggregation functions or to eliminate duplicate rows from a result set. The WHERE clause is applied before the GROUP BY clause.GROUP BY Marina G. Erechtchoukova29

The HAVING clause includes a predicate used to filter rows resulting from the GROUP BY clause. Because it acts on the results of the GROUP BY clause, aggregation functions can be used in the HAVING clause predicate.HAVING The ORDER BY clause identifies which columns are used to sort the resulting data, and in which direction they should be sorted (options are ascending or descending). Without an ORDER BY clause, the order of rows returned by an SQL query is undefined.ORDER BY Marina G. Erechtchoukova30

Query Language Object Oriented Query Language

Evolution of Design Approach in Multimedia

Object Oriented Query Language Figure 1 : Media class and Its subclass

Object Oriented Schema Declaration

Event & Content-Based Queries for Image / Video Data Spatial Temporal

Spatial Object

Temporal Object

Queries for Multimedia Multimedia Document Retrieval Playout Control

Thanks for Your Attention