jagomart
digital resources
picture1_Data Processing Ppt 72429 | Classppt


 229x       Filetype PPT       File size 0.17 MB       Source: courses.cs.washington.edu


File: Data Processing Ppt 72429 | Classppt
relational query languages query languages allow manipulation and retrieval of data from a database relational model supports simple powerful qls strong formal foundation based on logic allows for much optimization ...

icon picture PPT Filetype Power Point PPT | Posted on 31 Aug 2022 | 3 years ago
Partial capture of text on file.
       Relational Query Languages
   Query languages:  Allow manipulation and 
    retrieval of data from a database.
   Relational model supports simple, powerful QLs:
     – Strong formal foundation based on logic.
     – Allows for much optimization.
   Query Languages != programming languages!
     – QLs not expected to be “Turing complete”.
     – QLs not intended to be used for complex calculations.
     – QLs support easy, efficient access to large data sets.
                                   
                                                                    2
           Formal Relational Query 
           Languages
          Two mathematical Query Languages form 
             the basis for “real” languages (e.g. SQL), 
             and for implementation:
          Relational Algebra:  More operational, very 
             useful for representing execution plans.
            Relational Calculus:   Lets users describe 
             what they want, rather than how to 
             compute it.  (Non-operational, declarative.)
    Understanding Algebra & Calculus is key to 
    understanding SQL, query processing! 
                                                    
                                                                                                      3
       Preliminaries
     A query is applied to relation instances, and 
      the result of a query is also a relation 
      instance.
       – Schemas of input relations for a query are fixed 
         (but query will run regardless of instance!)
       – The schema for the result of a given query is also 
         fixed! Determined by definition of query 
         language constructs.
     Positional vs. named-field notation:  
       – Positional notation easier for formal definitions, 
         named-field notation more readable.  
       – Both used in Relational Algebra and SQL
                                   
                                                                    4
                                     R1 sid bid        day
       Example Instances22 101 10/10/96
                                         58   103 11/12/96
  “Sailors” and “Reserves”        sid   sname rating age
    relations for our          S1
    examples.                      22    dustin    7     45.0
  We’ll use positional or         31    lubber    8     55.5
    named field notation,          58    rusty     10    35.0
    assume that names of 
    fields in query results    S2 sid sname rating age
    are `inherited’ from           28    yuppy     9     35.0
    names of fields in query       31    lubber    8     55.5
    input relations.
                                   44    guppy     5     35.0
                                   58    rusty     10    35.0
                                  
                                                                  5
       Relational Algebra
    Basic operations:
     – Selection  (     )    Selects a subset of rows from relation.
                  
     – Projection  (     )   Deletes unwanted columns from relation.
     –             
       Cross-product  (     )  Allows us to combine two relations.
     – Set-difference  (     )  Tuples in reln. 1, but not in reln. 2.
                       
     – Union  (  )  Tuples in reln. 1 and in reln. 2.
                      
    Additional operations:
     – Intersection, join, division, renaming:  Not essential, but (very!) 
       useful.
    Since each operation returns a relation, operations can be 
     composed! (Algebra is “closed”.)
                                  
                                                                  6
The words contained in this file might help you see if this file matches what you are looking for:

...Relational query languages allow manipulation and retrieval of data from a database model supports simple powerful qls strong formal foundation based on logic allows for much optimization programming not expected to be turing complete intended used complex calculations support easy efficient access large sets two mathematical form the basis real e g sql implementation algebra more operational very useful representing execution plans calculus lets users describe what they want rather than how compute it non declarative understanding is key processing preliminaries applied relation instances result also instance schemas input relations are fixed but will run regardless schema given determined by definition language constructs positional vs named field notation easier definitions readable both in r sid bid day example sailors reserves sname rating age our s examples dustin we ll use or lubber rusty assume that names fields results inherited yuppy guppy basic operations selection selects s...

no reviews yet
Please Login to review.