1 2011.3 Classwork notes. 2 Find the names of all employees whose salary greater than all managers salary.

Slides:



Advertisements
Similar presentations
Author: Julia Richards and R. Scott Hawley
Advertisements

Whether it rains, Whether it pours, Wherever I go,
Slide 1 Insert your own content. Slide 2 Insert your own content.
1 Copyright © 2010, Elsevier Inc. All rights Reserved Fig 3.1 Chapter 3.
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 4 Author: Julia Richards and R. Scott Hawley.
1 Chapter 58 - Clinical Syndromes of Metabolic Alkalosis Copyright © 2013 Elsevier Inc. All rights reserved.
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 7 Author: Julia Richards and R. Scott Hawley.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 14.
Quest ion 1? A.) answer B.) answer C.) correct answerD.) answer L C.) correct answer F.
Combining Like Terms. Only combine terms that are exactly the same!! Whats the same mean? –If numbers have a variable, then you can combine only ones.
Copyright © 2011 California Department of Education, Child Development Division with WestEd Center for Child and Family Studies, Desired Results T&TA Project.
0 - 0.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
ADDING INTEGERS 1. POS. + POS. = POS. 2. NEG. + NEG. = NEG. 3. POS. + NEG. OR NEG. + POS. SUBTRACT TAKE SIGN OF BIGGER ABSOLUTE VALUE.
SUBTRACTING INTEGERS 1. CHANGE THE SUBTRACTION SIGN TO ADDITION
MULT. INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Teacher Name Class / Subject Date A:B: Write an answer here #1 Write your question Here C:D: Write an answer here.
Addition Facts
Equipment Quiz. 1. What is the name of this appliance?
Introduction to Relational Database Systems 1 Lecture 4.
CS4026 Formal Models of Computation Running Haskell Programs – power.
Empty Box Problems Subtraction = 3 If you start on 6 and jump back 3 spaces you land on
ZMQS ZMQS
Displaying Data from Multiple Tables. Objectives After completing this lesson, you should Be able to do the following: Write SELECT statements to accessWrite.
O X Click on Number next to person for a question.
© S Haughton more than 3?
5.9 + = 10 a)3.6 b)4.1 c)5.3 Question 1: Good Answer!! Well Done!! = 10 Question 1:
1 Directed Depth First Search Adjacency Lists A: F G B: A H C: A D D: C F E: C D G F: E: G: : H: B: I: H: F A B C G D E H I.
Past Tense Probe. Past Tense Probe Past Tense Probe – Practice 1.
Combine Like Terms. Simplify the Given Expression Below:
Limits (Algebraic) Calculus Fall, What can we do with limits?
Properties of Exponents
Addition 1’s to 20.
25 seconds left…...
Test B, 100 Subtraction Facts
Click your mouse to move the card ahead! Work with a buddy using two Abacuses. First click and follow along using your abacus. After each click talk about.
11 = This is the fact family. You say: 8+3=11 and 3+8=11
Week 1.
Bottoms Up Factoring. Start with the X-box 3-9 Product Sum
1 Unit 1 Kinematics Chapter 1 Day
O X Click on Number next to person for a question.
Copyright  Oracle Corporation, All rights reserved. 3 Displaying Data from Multiple Tables.
COP-5725 Practice Exercises
6.830/6.814 Lecture 5 Database Internals Continued September 17, 2014.
Operators: SQL supports various arithmetic, logical, character, and relational r operators. Arithmetic Operators: Arithmetic operators in SQL will return.
1 Normalization. 2 Normal Forms v If a relation is in a certain normal form (BCNF, 3NF etc.), it is known that certain kinds of redundancies are avoided/minimized.
Copyright  Oracle Corporation, All rights reserved. 6 Writing Correlated Subqueries.
Classwork notes Find all departments’ name which have at least five employees whose salary grater than $5000.
 Th ờ i gian thi: 90 phút  Hình th ứ c thi: lý thuy ế t (tr ắ c nghi ệ m + tr ả l ờ i ng ắ n) + bài t ậ p (đ ề m ở )  C ấ u trúc bài thi: ◦ A. Lý thuy.
1 ICS 184: Introduction to Data Management Lecture Note 10 SQL as a Query Language (Cont.)
Joins & Sub-queries. Oracle recognizes that you may want data that resides in multiple tables drawn together in some meaningful way. One of the most important.
SELECT Statements Lecture Notes Sree Nilakanta Fall 2010 (rev)
SQL SeQueL -Structured Query Language SQL SQL better support for Algebraic operations SQL Post-Relational row and column types,
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Subqueries These slides are licensed under.
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Relational State Assertions These slides.
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Collection Operators These slides are.
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Grouping These slides are licensed under.
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Collection Operators These slides are.
Comparison Operators Relational Operators.
SQL-lab Download sql script file sailors.txt
Interacting with the Oracle Server
Generalization.
الفصل الثاني الصيغة العامة لجمله select*
جملة الاستعلام الأساسية
EXAMPLE Emp table: SS# Name Age Salary dno 1 Joe Mary 20
Introduction to Relational databases
Copyright © Ellis Cohen
Database Programming Using Oracle 11g
Practice Project Practice to know SQL
Presentation transcript:

Classwork notes

2 Find the names of all employees whose salary greater than all managers salary.

3 select Ename from EMP where sal > all (select sal from EMP where E# in ( select mgr from DEPT)) select Ename from EMP where sal > (select max(sal) from EMP where E# in ( select mgr from DEPT))

4 select e.ename from e emp Where not exist (select d# from d dept Where d.mgrsal > e.sal); select ename from emp Where sal > sal Sal in (select max(sal) from mgr )

5 Select ename from emp where emp.sal > (select distinct sal from MNQ where MNG.sal = MAX(mng.sal))

6 select ename from emp Where sal > some (select sal from manager); select name from emp Where emp.sal > every (select sal from manager )

7 Find all departments name which have at least five employees whose salary grater than $5000.

8 Select dname From Dept Where dname in (select salary, count(distinct ename) From EMP where salary>5000 group by dept

9 Select dname From Dept, Emp Where (select count(*) From EMP where salary>5000 and dept.d#)>4

10 Select dname From Dept,Emp Where Dept.dname=Emp.ename AND (select count(dname) From Dept,Emp where Dept.dname=Emp.ename AND salary>5000)>5

11 Select d#, dname From Dept,Emp Where Dept.d#=Emp.d# AND (select num, count(dname) From Dept,Emp group by emp.d# having salary>5000)>=5

12 Select dname From Dept, Emp Where count (select * From Emp where salary>5000 AND d#=Emp.d#);

13 Select dept.dname from emp, dept Where dept.d#=emp.d# and emp.sal>5000 Group by dept.dname Having count(*) >=5 ;

14 Select d.dname From Dept d Where d.d# in (select e.d# From Emp e where e.sal>5000 Group by e.d# Having count(*)>5);