Session 3 Welcome: To session 3-the 8th. learning sequence

Slides:



Advertisements
Similar presentations
The Build-up of the Red Sequence at z
Advertisements

CH4 EXERCISES 4.2. Given two relations R1 and R2, where R1 contains N1 tuples, R2 contains N2 tuples, and N2 > N1 > 0, give the min and max possible sizes.
Database Languages Chapter 7. The Relational Algebra.
1 Welcome: To the fifth learning sequence “ Possible representation (2) “ Recap : In the previous learning sequence, we discussed four possible representations.
1 Session 3 Welcome: To session 3 - the 7 th. learning sequence “Relational algebra “ Recap : In the previous learning sequences, we discussed some operators.
CS34311 The Entity- Relationship Model Part II.. CS34312 Database Design Stages Application Requirements Conceptual Design Logical Design Physical Design.
VARIABLES AND EXPRESSIONS NUMERICAL EXPRESSION A NAME FOR A NUMBER VARIABLE OR ALGEBRAIC EXPRESSION AN EXPRESSION THAT CONTAINS AT LEAST ONE VARIABLE.
1 Inventory Systems and Supply Ordering. 2 Inventory Systems and Ordering Supplies List of the stock and assets in the dental office Inventory includes.
ECONOMICS 211 CLICKER QUESTIONS Chapter 4 – Question Set #3.
1 SELECT statement. 2 Sample database Supplier Part supplies (0,n) colour s# snamep# pname amount citydob price qualitydate.
1 Session 3 Welcome: To session 3-the 8 th. learning sequence “Relational algebra “ Recap : In the previous learning sequence, we discussed some example.
1.2 – Evaluate and Simplify Algebraic Expressions A numerical expression consists of numbers, operations, and grouping symbols. An expression formed by.
1 Session 3 Welcome: To session 3- the first learning sequence “ Introduction to Relational Model“ Recap : In the previous learning sequences, we discussed.
Level 2 Training ~ Part 2A: Shift 2: Coherence How does coherence affect classroom instruction?
Algebraic Expressions. Definitions Variable – A variable is a letter or symbol that represents a number (unknown quantity). 8 + n = 12.
1-1 Variables and Expressions Algebra One CP2 Chapter 1.
Reports 5.02 Understand database queries, forms, and reports used in business.
Database Management Systems,1 Relational Calculus.
Forms and Subforms 5.02 Understand database queries, forms, and reports used in business.
Thinking Mathematically
Perform DFS from A A B C D E F G. Perform BFS from A A B C D E F G.
An Introduction to SQL For CS Overview of SQL  It is the standard language for relational systems, although imperfect  Supports data definition.
Properties of Logarithms. Basic Properties All logarithmic functions have certain properties. The basic properties are:
1 Session 3 Welcome: To session 3-the fourth learning sequence “Relational algebra “ Recap : In the previous learning sequences, we discussed the four.
1 Basic Definitions Fundamentals of Data Base Dr. Rashid Al_Zubaidy.
ALGEBRA VOCABULARY. Vocabulary: Expression Definition: A math phrase built from constants, variables and operations EXAMPLE: 3X - 2Y.
1 Welcome: To the forth learning sequence “ Possible representation (1) “ Recap : In the previous learning sequence, we discussed the basic definitions.
Reports. Reports display information retrieved from a database in an attractive printed format. Reports can be created directly from tables, but More.
Algebra Arithmetic Sequences and Series. Vocabulary Sequence – A list of numbers in a particular order Arithmetic Sequence – A sequence of numbers.
1 Session 3 Welcome: To session 3-the third learning sequence “ Relational algebra “ Recap : In the previous learning sequences, we discussed the four.
January 28, 2010 – Evening Session Why is today perfect?
Answers to Chap 8 “Purchasing and Receiving Terms” Fill in as we go…….
SQL Exercises. 1) Names of suppliers. Suppliers(sid, sname, address) Parts(pid, pname, color) Catalog(sid, pid, cost)
STRUCTURE OF PRESENTATION :
“ Possible representation (3) “
GSE Algebra 1 Unit 1 Day 1 & 2.
Session 3 Welcome: To session 3-the fourth learning sequence
1-2 Algebraic Expressions Key Concept
Fundamentals of Databases
The number of times a number or expression (called a base) is used as a factor of repeated multiplication. Also called the power. 5⁴= 5 X 5 X 5 X 5 = 625.
Aim: What is the law of supply and demand?
Session 3 Welcome: To session 3-the fifth learning sequence
CS 480: Database Systems Lecture 8 February 1, 2013.
Arithmetic Sequences and Series
ALGEBRAIC REPRESENTATION OF SUPPLY, DEMAND, AND EQUILIBRIUM
Modeling Your Data Chapter 2 cs542
SUPPLY CHECK! Take out the following materials:
Demand, Supply, and Market Equilibrium
Unit 1 : Simplifying & Writing Expressions
Algebraic Sequences.
Session 3 Welcome: To session 3 - the 7th. learning sequence
Relational Algebra Chapter 4 - part I.
5.02 Understand database queries, forms, and reports used in business.
Session 3 Welcome: To session 3-the second learning sequence
Session 3 Welcome: To session 3-the sixth learning sequence
Φροντιστήριο SQL (από το βιβλίο του Date)
Session 2 Welcome: The seventh learning sequence
Market Effects of Changes in Demand or Changes in Supply
Relational Model.
Relational Algebra.
Shifts in both Supply and Demand What happens to Price
Evaluating Algebraic Expressions
Basic Definitions.
“ Possible representation (2) “
“ Possible representation (1) “
STRUCTURE OF PRESENTATION :
실습 4주차.
Review For Unit 1- Quiz #3 Interpreting Expressions
Learn to identify and evaluate expressions.
Evaluating Algebraic Expressions
Presentation transcript:

Session 3 Welcome: To session 3-the 8th. learning sequence “Relational algebra “ Recap : In the previous learning sequence, we discussed some example queries. Present learning: We shall explore the following topic: - Another example Queries.

Relational Algebra

Relational Algebra A basic expression in the relational algebra consists of either one of the following: A relation in the database A constant relation

Relational Instances for the Purchasing System The Supplier relation: S-number S-name S-city S100 Ahmed Amman S200 Ali Jarash S300 Kasim Irbid S400 Jasim Aqaba S500 Rana

The Part relation: P-number P-name Color Price P-city P1 TV Silver 300 Amman P2 Camera Black 100 Jarash P3 Video 200 P4 PC 400 Irbid P5 Printer Red P6 Scanner silver 150 5

The shipment relation: S-number P-number Quantity S100 P1 100 P2 150 P3 200 P4 160 S200 S300 400 S400 80 S500 6

Q1- Get names of suppliers who supply at least one silver part.

Q1- Get names of suppliers who supply at least one silver part. Temp1   P-color = ‘silver’ (Part)

Q1- Get names of suppliers who supply at least one silver part. Temp1   P-color = ‘silver’ (Part) P-number P-name Color Price P-city P1 TV Silver 300 Amman P4 PC 400 Irbid P6 Scanner silver 150 Jarash Temp1

Q1- Get names of suppliers who supply at least one silver part. Temp1   P-color = ‘silver’ (Part) Temp2  Shipment Temp1

Q1- Get names of suppliers who supply at least one silver part. Temp1   P-color = ‘silver’ (Part) Temp2  Shipment Temp1 S-number P-number Quantity P-name Color Price P-city S100 P1 100 TV Silver 300 Amman P4 160 PC 400 Irbid S200 200 S400 80 S500 Temp2

Q1- Get names of suppliers who supply at least one silver part. Temp1   P-color = ‘silver’ (Part) Temp2  Shipment Temp1 Temp3   S-number (Temp2) S-number S100 S200 S400 S500 Temp3

Q1- Get names of suppliers who supply at least one silver part. Temp1   P-color = ‘silver’ (Part) Temp2  Shipment Temp1 Temp3   S-number (Temp2) Temp4  Supplier Temp3 S-number S-name S-city S100 Ahmed Amman S200 Ali Jarash S400 Jasim Aqaba S500 Rana Temp4

Q1- Get names of suppliers who supply at least one silver part. Temp1   P-color = ‘silver’ (Part) Temp2  Shipment Temp1 Temp3   S-number (Temp2) Temp4  Supplier Temp3 Result   S-name (Temp4) S-name Ahmed Ali Jasim Rana Result

Q2- Get the names and cities of suppliers who supply parts stored in Irbid.

Q2- Get the names and cities of suppliers who supply parts stored in Irbid. Temp1   P-city = ‘Irbid’ (Part)

Q2- Get the names and cities of suppliers who supply parts stored in Irbid. Temp1   P-city = ‘Irbid’ (Part) P-number P-name Color Price P-city P4 PC Silver 400 Irbid P5 Printer Red 100 Temp1

Temp1   P-city = ‘Irbid’ (Part) Temp2  Shipment Temp1 Q2- Get the names and cities of suppliers who supply parts stored in Irbid. Temp1   P-city = ‘Irbid’ (Part) Temp2  Shipment Temp1 Temp2 S-number P-number Quantity P-name Color Price P-city S100 P4 160 PC Silver 400 Irbid P5 50 Printer Red 100 S400 80 S500

Temp1   P-city = ‘Irbid’ (Part) Temp2  Shipment Temp1 Q2- Get the names and cities of suppliers who supply parts stored in Irbid. Temp1   P-city = ‘Irbid’ (Part) Temp2  Shipment Temp1 Temp3   S-number (Temp2) S-number S100 S400 S500 Temp3

Q2- Get the names and cities of suppliers who supply parts stored in Irbid. Temp1   P-city = ‘Irbid’ (Part) Temp2  Shipment Temp1 Temp3   S-number (Temp2) Temp4  Supplier Temp3

Temp1   P-city = ‘Irbid’ (Part) Temp2  Shipment Temp1 Q2- Get the names and cities of suppliers who supply parts stored in Irbid. Temp1   P-city = ‘Irbid’ (Part) Temp2  Shipment Temp1 Temp3   S-number (Temp2) Temp4  Supplier Temp3 S-number S-name S-city S100 Ahmed Amman S400 Jasim Aqaba S500 Rana Temp4

Q2- Get the names and cities of suppliers who supply parts stored in Irbid. Temp1   P-city = ‘Irbid’ (Part) Temp2  Shipment Temp1 Temp3   S-number (Temp2) Temp4  Supplier Temp3 Result   S-name , S-city (Temp4)

Temp1   P-city = ‘Irbid’ (Part) Temp2  Shipment Temp1 Q2- Get the names and cities of suppliers who supply parts stored in Irbid. Temp1   P-city = ‘Irbid’ (Part) Temp2  Shipment Temp1 Temp3   S-number (Temp2) Temp4  Supplier Temp3 Result   S-name , S-city (Temp4) S-name S-city Ahmed Amman Jasim Aqaba Rana Result

Q3- Find supplier names for suppliers who supply all parts.

Q3- Find supplier names for suppliers who supply all parts. Temp1   P-number (Part)

Q3- Find supplier names for suppliers who supply all parts. Temp1   P-number (Part) P-number P1 P2 P3 P4 P5 P6 Temp1

Q3- Find supplier names for suppliers who supply all parts. Temp1   P-number (Part) Temp2   S-number , P-number (Shipment)

Q3- Find supplier names for suppliers who supply all parts. Temp1   P-number (Part) S-number P-number S100 P1 P2 P3 P4 P5 P6 S200 S300 S400 S500 Temp2   S-number , P-number (Shipment) Temp2

Q3- Find supplier names for suppliers who supply all parts. Temp1   P-number (Part) Temp2   S-number , P-number (Shipment) Temp3  Temp2  Temp1

Q3- Find supplier names for suppliers who supply all parts. Temp1   P-number (Part) Temp2   S-number , P-number (Shipment) Temp3  Temp2  Temp1 S-number S100 Temp3

Q3- Find supplier names for suppliers who supply all parts. Temp1   P-number (Part) Temp2   S-number , P-number (Shipment) Temp3  Temp2  Temp1 Temp4  Supplier Temp3

Q3- Find supplier names for suppliers who supply all parts. Temp1   P-number (Part) Temp2   S-number , P-number (Shipment) Temp3  Temp2  Temp1 Temp4  Supplier Temp3 Temp4 S-number S-name S-city S100 Ahmed Amman

Q3- Find supplier names for suppliers who supply all parts. Temp1   P-number (Part) Temp2   S-number , P-number (Shipment) Temp3  Temp2  Temp1 Temp4  Supplier Temp3 Result   S-name (Temp4)

Q3- Find supplier names for suppliers who supply all parts. Temp1   P-number (Part) Temp2   S-number , P-number (Shipment) Temp3  Temp2  Temp1 Temp4  Supplier Temp3 Result   S-name (Temp4) S-name Ahmed Result

Q4- How many parts they have?

Q4- How many parts they have? g count (P-number) (Part) P-number 7

Q5- Find the total quantities supplied by each supplier.

Q5- Find the total quantities supplied by each supplier. S-number g sum (Quantity) (Shipment)

Q5- Find the total quantities supplied by each supplier. S-number g sum (Quantity) (Shipment) S-number Quantity S100 610 S200 350 S300 400 S400 230 S500 100

Q5- Find the total quantities supplied by each supplier. S-number g sum (Quantity) as ( sum-quantity) (Shipment) S-number Sum-Quantity S100 730 S200 350 S300 400 S400 250 S500 100

Relational Algebra Summary: In this learning sequence, we discussed another example queries about purchasing system.

END