Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6 The Relational Algebra and Relational Calculus تنبيه : شرائح العرض.

Slides:



Advertisements
Similar presentations
Exercise 2 Relational Calculus
Advertisements

Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Database System - Assignment #3 Sept. 2012Yangjun Chen ACS Assignment #3 due Wed., Nov. 14, (30) Exercise 7.17 on Page 235 Show the result.
Copyright © 2004 Ramez Elmasri and Shamkant Navathe Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition Chapter 15-1 Query Processing and.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 19 Algorithms for Query Processing and Optimization.
Chapter 15 Algorithms for Query Processing and Optimization Copyright © 2004 Pearson Education, Inc.
Lecture 1 Relational Algebra and Relational Calculus.
The Relational Algebra
Data Definition Languages Atif Farid Mohammad UNCC.
LAB 4 FIGURES.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 8- 1.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 1- 1.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 8- 1.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 6- 1.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 2- 1.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 8 SQL-99: SchemaDefinition, Constraints, and Queries and Views.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2004 Pearson Education, Inc.. Chapter 6 The Relational Algebra and Relational Calculus.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Jyh-haw Yeh Dept. of Computer Science Boise State University
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 6- 1.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 7 Relational Database Design by ER- Mapping.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Chapter 7 Relational Database Design by ER- and EER-to-Relational Mapping Copyright © 2004 Pearson Education, Inc.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 6 The Relational Algebra and Calculus.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 7 Relational Database Design by ER- to-Relational Mapping.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 7 Relational Database Design by ER- Mapping.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 6 The Relational Algebra and Calculus.
CS 380 Introduction to Database Systems Chapter 7: The Relational Algebra and Relational Calculus.
METU Department of Computer Eng Ceng 302 Introduction to DBMS The Relational Algebra by Pinar Senkul resources: mostly froom Elmasri, Navathe and other.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 6- 1.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 4 Applications of the Derivative.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1 Functions.
Database Management Systems. NESTING OF QUERIES  Some queries require that existing values in the database be retrieved and then used in a comparison.
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 6 The Relational Algebra.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 6 The Relational Algebra.
Al-Maarefa College for Science and Technology INFO 232: Database systems Chapter 3 “part 2” The Relational Algebra and Calculus Instructor Ms. Arwa Binsaleh.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 5 Integration.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 11.6 Calculus of Vector-Valued Functions.
Slide 6- 1 Additional Relational Operations Aggregate Functions and Grouping A type of request that cannot be expressed in the basic relational algebra.
Chapter 6 The Relational Algebra and Calculus Copyright © 2004 Ramez Elmasri and Shamkant Navathe.
Chapter 15 Algorithms for Query Processing and Optimization Copyright © 2004 Pearson Education, Inc.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 340 Introduction to Database Systems.
603 Database Systems Senior Lecturer: Laurie Webster II, M.S.S.E.,M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 11 A First Course in Database Systems.
7-1 Chapter 7 The Relational Data Model, Relational Constraints, and the Relational Algebra.
1Fundamentals of Database Systems 기본키에 밑줄을 그은 COMPANY 관계 데이타베이스 스키마 FNAMEMINITLNAMESSNBDATEADDRESSSEXSALARYSUPERSSNDNO EMPLOYEE DNAMEDNUMBERMGRSSNMGRSTARTDATE.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Introduction to Query Processing (1) Query optimization: The process of choosing a suitable execution.
603 Database Systems Senior Lecturer: Laurie Webster II, M.S.S.E.,M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 20 A First Course in Database Systems.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 9 Relational Database Design by ER- and EER- to-Relational Mapping.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4 Basic SQL تنبيه : شرائح العرض (Slides) هي وسيلة لتوضيح الدرس واداة.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4 Basic SQL تنبيه : شرائح العرض (Slides) هي وسيلة لتوضيح الدرس واداة.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4 Basic SQL تنبيه : شرائح العرض (Slides) هي وسيلة لتوضيح الدرس واداة.
Copyright © 2011 Ramez Elmasri and Shamkant Navathe Lecture 8 Relational Algebra April 26, 2015.
Chapter 7 Relational Database Design by ER- and EERR-to-Relational Mapping Copyright © 2004 Pearson Education, Inc.
10/3/2017.
The Relational Algebra and Calculus
6/22/2018.
CS4222 Principles of Database System
Company Requirements.
SQL Grouping, Ordering & Arithmetics Presented by: Dr. Samir Tartir
SQL: Set Operations & Nested Queries. Presented by: Dr. Samir Tartir
Presentation transcript:

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6 The Relational Algebra and Relational Calculus تنبيه : شرائح العرض (Slides) هي وسيلة لتوضيح الدرس واداة من الادوات في ذلك. حيث المرجع الاساسي للمادة هي الكتاب المعتمد في وصف المقرر

Copyright © 2011 Ramez Elmasri and Shamkant B. Navathe Slide 6- 2 Database State for COMPANY All examples discussed below refer to the COMPANY database shown here.

Copyright © 2011 Ramez Elmasri and Shamkant B. Navathe Employee Slide 6- 3

Copyright © 2011 Ramez Elmasri and Shamkant B. Navathe Department Slide 6- 4

Copyright © 2011 Ramez Elmasri and Shamkant B. Navathe Project Slide 6- 5

Copyright © 2011 Ramez Elmasri and Shamkant B. Navathe Query 1 Find the name and address of all employees who work for the ‘Research‘ department. Slide 6- 6

Copyright © 2011 Ramez Elmasri and Shamkant B. Navathe Query 1 Find the name and address of all employees who work for the ‘Research‘ department. Slide 6- 7 FNAMELNAMEAddress JohnSmith731 Fondren, Houston, TX FranklinWong638 Voss, Houston, TX RameshNarayan975 Fire Oak, Humble, TX JoyceEnglish5631 Rice, Houston, TX

Copyright © 2011 Ramez Elmasri and Shamkant B. Navathe Query 1 Find the name and address of all employees who work for the ‘Research‘ department. Slide 6- 8 RESEARCH_DEPT   DNAME=’Research’ (DEPARTMENT) RESEARCH_EMPS  (RESEARCH_DEPT Dnumber= DNO EMPLOYEE) RESULT   FNAME, LNAME, ADDRESS (RESEARCH_EMPS)

Copyright © 2011 Ramez Elmasri and Shamkant B. Navathe Query 2 For every project located in 'Stafford', list the project number, the controlling department number, and the department manager's last name, address, and birth date Slide 6- 9

Copyright © 2011 Ramez Elmasri and Shamkant B. Navathe Query 2 For every project located in 'Stafford', list the project number, the controlling department number, and the department manager's last name, address, and birth date Slide PNUMBERDNUMLNAMEADDRESSBDATE 104Wallace291 Berry, Bellaire, TX20-JUN Wallace291 Berry, Bellaire, TX20-JUN-31

Copyright © 2011 Ramez Elmasri and Shamkant B. Navathe Query 2 For every project located in 'Stafford', list the project number, the controlling department number, and the department manager's last name, address, and birth date Slide STAFFORD_PROJS   Plocation=’Stafford’ (PROJECT) CONTR_DEPT  (STAFFORD_PROJS Dnum = Dnumber DEPARTMENT) PROJ_DEPT_MGR  (CONTR_DEPT MgrSSN= SSN EMPLOYEE) RESULT   Pnumber, Dnum,Lname, Address,Bdate (PROJ_DEPT_MGR )

Copyright © 2011 Ramez Elmasri and Shamkant B. Navathe Query 3 Find the names of all employees who work on all the projects controlled by department number 5. Slide 6- 12

Copyright © 2011 Ramez Elmasri and Shamkant B. Navathe Query 3 Find the names of all employees who work on all the projects controlled by department number 5. Results : empty because no tuples satisfy the criteria Slide 6- 13

Copyright © 2011 Ramez Elmasri and Shamkant B. Navathe Query 3 Find the names of all employees who work on all the projects controlled by department number 5. Slide DEPT5_PROJS(Pno)   Pnumber(  Dnum=5 (PROJECT) EMP_PROJ   Essn, Pno (WORKS_ON ) RESULT_EMP_SSNS  (EMP_PROJ ÷ DEPT5_PROJS) RESULT   Lname,Fname (RESULT_EMP_SSNS * EMPLOYEE)

Copyright © 2011 Ramez Elmasri and Shamkant B. Navathe Query 4 List the names of employees who have no dependents. Slide 6- 15

Copyright © 2011 Ramez Elmasri and Shamkant B. Navathe Query 4 List the names of employees who have no dependents. Slide LNAMEFNAME ZelayaAlicia NarayanRamesh EnglishJoyce JabbarAhmad BorgJames

Copyright © 2011 Ramez Elmasri and Shamkant B. Navathe Query 4 List the names of employees who have no dependents. Slide ALL_EMPS   SSN (EMPLOYEE) EMPS_WITH_DEPS ( SSN )   ESSN ( DEPENDENT ) EMPS_WITHOUT_DEPS  (ALL_EMPS - EMPS_WITH_DEPS) RESULT   LNAME, FNAME (EMPS_WITHOUT_DEPS * EMPLOYEE)