DATABASDESIGN FÖR INGENJÖRER - 1056F



Similar documents
Reasoning to Solve Equations and Inequalities

Homework 3 Solutions

Example 27.1 Draw a Venn diagram to show the relationship between counting numbers, whole numbers, integers, and rational numbers.

and thus, they are similar. If k = 3 then the Jordan form of both matrices is

Vectors Recap of vectors

EQUATIONS OF LINES AND PLANES

Vectors Summary. Projection vector AC = ( Shortest distance from B to line A C D [OR = where m1. and m

Regular Sets and Expressions

CS99S Laboratory 2 Preparation Copyright W. J. Dally 2001 October 1, 2001

Words Symbols Diagram. abcde. a + b + c + d + e

Learning Outcomes. Computer Systems - Architecture Lecture 4 - Boolean Logic. What is Logic? Boolean Logic 10/28/2010

9.3. The Scalar Product. Introduction. Prerequisites. Learning Outcomes

Binary Representation of Numbers Autar Kaw

1.2 The Integers and Rational Numbers

Review guide for the final exam in Math 233

A formal model for databases in DNA

Appendix D: Completing the Square and the Quadratic Formula. In Appendix A, two special cases of expanding brackets were considered:

A.7.1 Trigonometric interpretation of dot product A.7.2 Geometric interpretation of dot product

Unit 6: Exponents and Radicals

Bayesian Updating with Continuous Priors Class 13, 18.05, Spring 2014 Jeremy Orloff and Jonathan Bloom

Example A rectangular box without lid is to be made from a square cardboard of sides 18 cm by cutting equal squares from each corner and then folding

Integration by Substitution

FAULT TREES AND RELIABILITY BLOCK DIAGRAMS. Harry G. Kwatny. Department of Mechanical Engineering & Mechanics Drexel University

One Minute To Learn Programming: Finite Automata

Multiplication and Division - Left to Right. Addition and Subtraction - Left to Right.

Angles 2.1. Exercise Find the size of the lettered angles. Give reasons for your answers. a) b) c) Example

Mathematics. Vectors. hsn.uk.net. Higher. Contents. Vectors 128 HSN23100

Use Geometry Expressions to create a more complex locus of points. Find evidence for equivalence using Geometry Expressions.

PROF. BOYAN KOSTADINOV NEW YORK CITY COLLEGE OF TECHNOLOGY, CUNY

Or more simply put, when adding or subtracting quantities, their uncertainties add.

0.1 Basic Set Theory and Interval Notation

OUTLINE SYSTEM-ON-CHIP DESIGN. GETTING STARTED WITH VHDL August 31, 2015 GAJSKI S Y-CHART (1983) TOP-DOWN DESIGN (1)

AntiSpyware Enterprise Module 8.5

LINEAR TRANSFORMATIONS AND THEIR REPRESENTING MATRICES

5 a LAN 6 a gateway 7 a modem

MODULE 3. 0, y = 0 for all y

Rotating DC Motors Part II

Equivalence Checking. Sean Weaver

Pentominoes. Pentominoes. Bruce Baguley Cascade Math Systems, LLC. The pentominoes are a simple-looking set of objects through which some powerful

Factoring Polynomials

9 CONTINUOUS DISTRIBUTIONS

Pure C4. Revision Notes

Welch Allyn CardioPerfect Workstation Installation Guide

Babylonian Method of Computing the Square Root: Justifications Based on Fuzzy Techniques and on Computational Complexity

MA Lesson 16 Notes Summer 2016 Properties of Logarithms. Remember: A logarithm is an exponent! It behaves like an exponent!

Quick Reference Guide: One-time Account Update

Polynomial Functions. Polynomial functions in one variable can be written in expanded form as ( )

Graphs on Logarithmic and Semilogarithmic Paper

. At first sight a! b seems an unwieldy formula but use of the following mnemonic will possibly help. a 1 a 2 a 3 a 1 a 2

Concept Formation Using Graph Grammars

2 DIODE CLIPPING and CLAMPING CIRCUITS

MATH PLACEMENT REVIEW GUIDE

Physics 43 Homework Set 9 Chapter 40 Key

COMBINATORIAL HOPF ALGEBRAS FROM PROS

Lesson 2.1 Inductive Reasoning

MATH 150 HOMEWORK 4 SOLUTIONS

Scalar and Vector Quantities. A scalar is a quantity having only magnitude (and possibly phase). LECTURE 2a: VECTOR ANALYSIS Vector Algebra

Relational Algebra. Module 3, Lecture 1. Database Management Systems, R. Ramakrishnan 1

Active Directory Service

Treatment Spring Late Summer Fall Mean = 1.33 Mean = 4.88 Mean = 3.

COMPONENTS: COMBINED LOADING

Ratio and Proportion

1 Fractions from an advanced point of view

How fast can we sort? Sorting. Decision-tree model. Decision-tree for insertion sort Sort a 1, a 2, a 3. CS Spring 2009

The remaining two sides of the right triangle are called the legs of the right triangle.

RIGHT TRIANGLES AND THE PYTHAGOREAN TRIPLETS

Firm Objectives. The Theory of the Firm II. Cost Minimization Mathematical Approach. First order conditions. Cost Minimization Graphical Approach

Answer, Key Homework 10 David McIntyre 1

Health insurance exchanges What to expect in 2014

The art of Paperarchitecture (PA). MANUAL

Linear Programming in Database

Lecture 5. Inner Product

Bypassing Space Explosion in Regular Expression Matching for Network Intrusion Detection and Prevention Systems

Section 7-4 Translation of Axes

Solution to Problem Set 1

Morgan Stanley Ad Hoc Reporting Guide

Quick Guide to Lisp Implementation

Exam 1 Study Guide. Differentiation and Anti-differentiation Rules from Calculus I

Section 5-4 Trigonometric Functions

Math 135 Circles and Completing the Square Examples

Small Business Networking

In addition, the following elements form an integral part of the Agency strike prevention plan:

1. Definition, Basic concepts, Types 2. Addition and Subtraction of Matrices 3. Scalar Multiplication 4. Assignment and answer key 5.

FUNCTIONS AND EQUATIONS. xεs. The simplest way to represent a set is by listing its members. We use the notation

Lectures 8 and 9 1 Rectangular waveguides

FORMAL LANGUAGES, AUTOMATA AND THEORY OF COMPUTATION EXERCISES ON REGULAR LANGUAGES

Regular Languages and Finite Automata

Maximum area of polygon

Distributions. (corresponding to the cumulative distribution function for the discrete case).

Novel Methods of Generating Self-Invertible Matrix for Hill Cipher Algorithm

Operations with Polynomials

The Principle of No Punishment Without a Law for It LEARNING OBJECTIVES: CRLA.GAAN:

T H E S E C U R E T R A N S M I S S I O N P R O T O C O L O F S E N S O R A D H O C N E T W O R K

Small Business Networking

Protocol Analysis / Analysis of Software Artifacts Kevin Bierhoff

Volumes by Cylindrical Shells: the Shell Method

Math 314, Homework Assignment Prove that two nonvertical lines are perpendicular if and only if the product of their slopes is 1.

Warm-up for Differential Calculus

GENERAL APPLICATION FOR FARM CLASSIFICATION

Transcription:

DATABASDESIGN FÖR INGENJÖRER - 06F Sommr 00 En introuktionskurs i tssystem http://user.it.uu.se/~ul/t-sommr0/ lt. http://www.it.uu.se/eu/course/homepge/esign/st0/ Kjell Orsorn (Rusln Fomkin) Uppsl Dtse Lortory Deprtment of Informtion Technology, Uppsl University, Uppsl, Sween Kjell Orsorn 00-06-

Introuction to Reltionl Alger Elmsri/Nvthe ch 6 Kjell Orsorn & Rusln Fomkin Deprtment of Informtion Technology Uppsl University, Uppsl, Sween Kjell Orsorn 00-06-

Query lnguges Lnguges where users cn express wht informtion to retrieve from the tse. tegories of query lnguges: Proceurl Non-proceurl (eclrtive) Forml ( pure ) lnguges: Reltionl lger Reltionl clculus Tuple-reltionl clculus Domin-reltionl clculus Forml lnguges form unerlying sis of query lnguges tht people use. Kjell Orsorn 00-06-

Reltionl lger Reltionl lger is proceurl lngue Opertions in reltionl lger tkes one or two reltions s rguments n return new reltion. Reltionl lgeric opertions: Opertions from set theory: Union, Intersection, Difference, rtesin prouct Opertions specificlly introuce for the reltionl t moel: Select, Project, Join It hve een shown tht the select, project, union, ifference, n crtesin prouct opertions form complete set. Tht is ny other reltionl lger opertion cn e expresse in these. Kjell Orsorn 00-06-

Opertions from set theory Reltions re require to e union comptile to e le to tke prt in the union, intersection n ifference opertions. Two reltions R n R is si to e union-comptile if: R D x D x... x D n n R D x D x... x D n i.e. if they hve the sme egree n the sme omins. Kjell Orsorn 00-06-

6 Union opertion The union of two union-comptile reltions R n S is the set of ll tuples tht either occur in R, S, or in oth. Nottion: R S Define s: R S = {t t R or t S} For exmple: R S A B A B = A B Kjell Orsorn 00-06-

Difference opertion The ifference etween two union-comptile sets R n S is the set of ll tuples tht occur in R ut not in S. Nottion: R S Define s: R S = {t t R n t S} For exmple: R S A B A B = A B Kjell Orsorn 00-06-

8 Intersection The intersection of two union-comptile sets R n S, is the set of ll tuples tht occur in oth R n S. Nottion: R S Define s: R S = {t t R n t S} For exmple: R S A B A B = A B Kjell Orsorn 00-06-

9 rtesin prouct Let R n S e reltions with k n k rities resp. The crtesin prouct of R n S is the set of ll possile k +k tuples where the first k components constitute tuple in R n the lst k components tuple in S. Nottion: R x S Define s: R x S = {t q t R n q S} Assume tht ttriutes of r(r) n s(s) re isjoint (i.e. R S = ). If ttriutes of r(r) n s(s) re not isjoint, then renming must e use. X = Kjell Orsorn 00-06-

Kjell Orsorn 00-06- 0 UU - IT - UDBL rtesin prouct exmple A B x D c 6 = A B D c c 6 6

Selection opertion The selection opertor, σ, selects specific set of tuples from reltion ccoring to selection conition (or selection preicte) P. Nottion: σ p (R) Define s: σ p (R) = {t t R AND P(t) } (i.e. the set of tuples t in R tht fulfills the conition P) Where P is logicl expression (*) consisting of terms connecte y: (n), (or), (not) n ech term is one of: <ttriute> op <ttriute> or <constnt> where op is one from the set {=, <,,, >, } Exmple: σ SALARY>0000 (EMPLOYEE) (*) formul in propositionl clculus Kjell Orsorn 00-06-

Kjell Orsorn 00-06- UU - IT - UDBL Selection exmple = A B D 9 R σ A=B, D> (R) = A B D 9

Projection opertion The projection opertor, π, picks out (or projects) liste columns from reltion n cretes new reltion consisting of these columns. Nottion: π A,A,...,A k (R) where A, A re ttriute nmes n R is reltion nme. The result is new reltion of k columns. Duplicte rows remove from result, since reltions re sets. Exmple: π LNAME,FNAME,SALARY (EMPLOYEE) Kjell Orsorn 00-06-

Projection exmple R = A B π A, (R) = A Kjell Orsorn 00-06-

Join opertor The join opertor cretes new reltion y joining relte tuples from two reltions. Nottion: R S is the join conition which hs the form A r Θ A s, where Θ is one of {=, <, >,,, }. Severl terms cn e connecte s... k. A join opertion with this kin of generl join conition is clle Thet join. Kjell Orsorn 00-06-

Kjell Orsorn 00-06- 6 UU - IT - UDBL Exmple Thet join A D = A B 6 9 B 8 8 A B 6 9 8 8 B 8 D 9 R A D S 8 8 8 D 9 9 9 R S

Equijoin The sme s join ut it is require tht ttriute A r n ttriute A s shoul hve the sme vlue. Nottion: R S is the join conition which hs the form A r = A s. Severl terms cn e connecte s... k. Kjell Orsorn 00-06-

Kjell Orsorn 00-06- 8 UU - IT - UDBL Exmple Equijoin B= = A B D A B D 9 E e e e R B= S E e e R S

9 Nturl join Nturl join is equivlent with the ppliction of join to R n S with the equlity conition A r = A s (i.e. n equijoin) n then removing the reunnt column A s in the result. Nottion: R * Ar,As S A r,a s re ttriute pirs tht shoul fulfil the join conition which hs the form A r = A s. Severl terms cn e connecte s... k. Kjell Orsorn 00-06-

Kjell Orsorn 00-06- 0 UU - IT - UDBL Exmple Nturl join B, = A B D A B D 9 E e e e R* B, S E e e R S

Kjell Orsorn 00-06- UU - IT - UDBL omposition of opertions Expressions cn e uilt y composing multiple opertions Exmple: σ A= (R x S) σ A= (R x S) = A B x D c 6 = A B D c c 6 6 A B D 6 R x S =

Assignment opertion The ssignment opertion (P) mkes it possile to ssign the result of n expression to temporry reltion vrile. Exmple: temp P σ no = (EMPLOYEE) result P π fnme,lnme,slry (temp) The result to the right of the P is ssigne to the reltion vrile on the left of the P. The vrile my use vrile in susequent expressions. Kjell Orsorn 00-06-

Renming reltions n ttriute The ssignment opertion cn lso e use to renme reltions n ttriutes. Exmple: NEWEMP P σ no = (EMPLOYEE) ρ (FIRSTNAME,LASTNAME,SALARY) π fnme,lnme,slry (NEWEMP) Kjell Orsorn 00-06-

Division opertion Suite to queries tht inclue the phrse for ll. Let R n S e reltions on schems R n S respectively, where R = (A,...,A m,b,...,b n ) S = (B,...,B n ) The result of R S is reltion on schem R - S = (A,...,A m ) R S = {t t π R-S (R) u S tu R} Kjell Orsorn 00-06-

Exmple Division opertion R S R S A c e e B 6 B = A e Kjell Orsorn 00-06-

6 Reltion lger s query lnguge Reltionl schem: supplies(snme, inme, price) Wht is the nmes of the suppliers tht supply cheese? π snme (σ inme='heese' (SUPPLIES)) Wht is the nme n price of the items tht cost less thn $ n tht re supplie y WALMART π inme,price (σ snme='walmart' price < (SUPPLIES)) Kjell Orsorn 00-06-