We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!
Presentation is loading. Please wait.
Published byArleen Robertson
Modified about 1 year ago
LAB 4 FIGURES
RENAMING OPERATION Note : Ssn shouldn’t be underlined.
SET DIFFERENCE (OR MINUS)
NATURAL JOIN OPERATION
LEFT OUTER JOIN
RIGHT OUTER JOIN
AGGREGATE FUNCTIONS ᵨ R(Dno,No_of_employees,Average_sal)(Dno COUNT Ssn, AVERAGE Salary (EMPLOYEE)) No renaming :
AGGREGATE FUNCTIONS ᵨ R(Dno,No_of_employees,Average_sal)(Dno COUNT Ssn, AVERAGE Salary (EMPLOYEE)) No grouping :
QUERY 1 Retrieve the name and address of all employees who work for the ‘Research’ department.
QUERY 1 RESEARCH_DEPT <- σ Dname=’Research’ (DEPARTMENT) RESEARCH_EMPS <- (RESEARCH_DEPT Dnumber=Dno EMPLOYEE) RESULT <- ∏ Fname, Lname, Address (RESEARCH_EMPS) OR ∏ Fname, Lname, Address (σ Dname=’Research’ (DEPARTMENT Dnumber=Dno (EMPLOYEE)))
QUERY 2 List the names of employees with two or more dependents.
QUERY 2 T1(Ssn, No_of_dependents) <- Essn COUNT Dependent_name (DEPENDENT) T2 2 (T1) RESULT <- ∏ Lname, Fname (T2 * EMPLOYEE)
QUERY 3 Find the names of employees who work on all the projects controlled by department number 5.
QUERY 3 DEPT5_PROJS <- ᵨ (Pno) (∏ Pnumber (σ Dnum=5 (PROJECT))) EMP_PROJ <- ᵨ (Ssn,Pno) (∏ Essn,Pno (WORKS_ON))
QUERY 3 RESULT_EMP_SSNS <- EMP_PROJ DEPT5_PROJS RESULT <- ∏ Lname, Fname (RESULT_EMP_SSNS * EMPLOYEE)
QUERY 4 List the names of managers who have at least one dependent.
Exercise 2 Relational Calculus Database System-dww.
Chapter 6 The Relational Algebra Dr. Bernard Chen Ph.D. University of Central Arkansas.
Multiple Table Queries A Guide to SQL – Chapter 5.
Ihr Logo Fundamentals of Database Systems Fourth Edition El Masri & Navathe Chapter 8 SQL-99: Schema Definition, Basic Constraints, and Queries.
SQL Rohit Khokher. INTRODUCTION Structured Query Language (SQL) is the standard command set that allows the users to interact with the relational database.
More on Structured Query Language Indra Budi
Week 5 Relational Database Design by ER- -to-Relational Mapping.
Relational operators 1 Lecture 7 Relational Operators.
SQL/PL SQL Oracle By Rana Umer. Quiz 2 Q1.Create a table called "Persons" that contains five columns: PersonID, LastName, FirstName, Address, and City.
SQL: The Query Language Part 2 R & G - Chapter 5 1.
Yet More SQL SELECT Database Systems Lecture 9 Natasha Alechina.
Chapter 3: Relational Model Structure of Relational Databases Relational Algebra Tuple Relational Calculus Domain Relational Calculus Extended Relational-Algebra-Operations.
The Basics of Efficient SQL Written for myself –Writing doesnt make you rich Proof of what works –and what doesnt Three parts: –Data Model Tuning –SQL.
ER Modeling Case Studies. 2 BanksDatabase :ER Case Study u Consider the following set of requirements for a Bank database that is used to keep track of.
7 Copyright © 2004, Oracle. All rights reserved. Using the Set Operators.
Chapter 3: Relational Model Structure of Relational Databases Normal forms (chap. 7) Reduction of an E-R Schema to Relational (Sect. 2.9) Relational.
Dr. Alexandra I. Cristea CS 319: Theory of Databases: C4.
SQL-II Reading: C&B, Chap 6, 7, 8 & 9. Dept. of Computing Science, University of Aberdeen2 In this lecture you will learn how to sort and group query.
Query Processing Reading: CB, Chaps 5 & 23. Dept of Computing Science, University of Aberdeen2 In this lecture you will learn the basic concepts of Query.
SQL Database for a Book Store Clinton McKay. Explanation The database contains information about the books held in stock, their authors, publishers, customers,
Practice for SQL and Constraints (Product-PC-Laptop-Printer)
McGraw-Hill/Irwin Copyright © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. ENTERPRISE INFORMATION SYSTEMS A PATTERN BASED APPROACH Chapter.
Chapter 7 Relational Database Design by ER- and EERR-to-Relational Mapping Copyright © 2004 Pearson Education, Inc.
1 Database Systems 10.8, 2008 Lecture #4. 2 Course Administration Assignment #1 is due next Wed (outside 336/338). Course slides will now have black background.
Advanced SQL (part 1) CS263 Lecture 7. Processing Multiple Tables – Joins The real power of the relational model derives from its storage of data in many.
SQL: Queries. Relational Schema Sailors (sid, sname, rating, age) Boats (bid, bname, color) Reserves (sid, bid, day)
Relations. Tuples Given a collection of types T i (i=1,2,….n), a tuple value on those types is a set of ordered.
Chapter 4: SQL Basic Structure Data Definition Language Modification of the Database Set Operations Aggregate Functions Null Values Nested.
Classwork notes. 2 Find the names of all employees whose salary greater than all managers salary.
Simple Databases. Setting Up SQLite in Eclipse Use SQLite – already installed on the linux machines Download one of the following two SQLite JDBC drivers.
© 2016 SlidePlayer.com Inc. All rights reserved.