RELATIONAL ALGEBRA II - California Institute of Technology
RELATIONAL ALGEBRA II
CS121: Relational Databases Fall 2018 ? Lecture 3
Last Lecture
2
? Query languages provide support for retrieving information from a database
? Introduced the relational algebra
? A procedural query language ? Six fundamental operations:
n select, project, set-union, set-difference, Cartesian product, rename
? Several additional operations, built upon the fundamental operations
n set-intersection, natural join, division, assignment
Extended Operations
3
? Relational algebra operations have been extended in various ways
? More generalized ? More useful!
? Three major extensions:
? Generalized projection ? Aggregate functions ? Additional join operations
? All of these appear in SQL standards
Generalized Projection Operation
4
? Would like to include computed results into relations
? e.g. "Retrieve all credit accounts, computing the current `available credit' for each account."
? Available credit = credit limit ? current balance
? Project operation is generalized to include computed results
? Can specify functions on attributes, as well as attributes themselves
? Can also assign names to computed values ? (Renaming attributes is also allowed, even though this is also
provided by the r operator)
Generalized Projection
5
? Written as: P (E) F1, F2, ..., Fn
? Fi are arithmetic expressions ? E is an expression that produces a relation ? Can also name values: Fi as name
? Can use to provide derived attributes
? Values are always computed from other attributes stored in database
? Also useful for updating values in database
? (more on this later)
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- 075 2009 renaming in batches sas
- relational algebra ii california institute of technology
- relational algebra and sql cornell university
- directquery in sql server 2016 analysis services
- guide to using sql synonyms and the rename statement oracle
- pro power bi desktop semantic scholar
- nested queries and aggregation cheriton school of computer science
- automatically renaming common variables before merging
- renaming a computer that hosts a stand alone sql server instance
- cs 450 relational algebra 1 george mason university