Database_DataShow_04 - Database Systems Lecture#4 Dr Sherin ElGokhy Chapter 3 Relational Algebra and Calculus.to be continue Queries A query is a

Database_DataShow_04 - Database Systems Lecture#4 Dr Sherin...

This preview shows page 1 - 10 out of 28 pages.

Database Systems Lecture #4 Dr Sherin ElGokhy
Image of page 1
Chapter 3: Relational Algebra and Calculus…..to be continue
Image of page 2
Queries 3 A query is a function from database instances to relations. Queries are formulated in relational algebra by means of expressions over relations . Database Systems (P. Atzeni, S. Ceri, S. Paraboschi and R. Torlone) Chapter 3: Relational Algebra and Calculus
Image of page 3
A database for the examples 4 EMPLOYEES SUPERVISION Database Systems (P. Atzeni, S. Ceri, S. Paraboschi and R. Torlone) Chapter 3: Relational Algebra and Calculus Number Name Age Salary 101 Mona Salem 34 40 103 Mona Ahmed 23 35 104 Amr Khalil 38 61 105 Ihab Zohdy 44 38 210 Medhat Aly 49 60 231 Samia Elkholy 50 60 252 Ihab Zohdy 44 70 301 Samir Salem 34 70 375 Mona Salem 50 65 Head Employee 210 101 210 103 210 104 231 105 301 210 301 231 375 252
Image of page 4
Example1: 5 Write a relational algebra expression for the following query: Find the numbers, names and ages of employees earning more than 40 thousands. Database Systems (P. Atzeni, S. Ceri, S. Paraboschi and R. Torlone) Chapter 3: Relational Algebra and Calculus Number Name Age 104 Amr Khalil 38 210 Medhat Aly 49 231 Samia Elkholy 50 252 Ihab Zohdy 44 301 Samir Salem 34 375 Mona Salem 50 Number, Name, Age ( Salary > 40 (EMPLOYEES))
Image of page 5