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 byJovan Mollick
Modified over 3 years ago
1 2011.3 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);
Classwork notes Find all departments’ name which have at least five employees whose salary grater than $5000.
0 - 0.
Slide 1 Insert your own content. Slide 2 Insert your own content.
COP-5725 Practice Exercises
1 ICS 184: Introduction to Data Management Lecture Note 10 SQL as a Query Language (Cont.)
Addition 1’s to 20.
Test B, 100 Subtraction Facts
5.9 + = 10 a)3.6 b)4.1 c)5.3 Question 1: Good Answer!! Well Done!! = 10 Question 1:
SQL SeQueL -Structured Query Language SQL SQL better support for Algebraic operations SQL Post-Relational row and column types,
Introduction to Relational Database Systems 1 Lecture 4.
1 Copyright © 2010, Elsevier Inc. All rights Reserved Fig 3.1 Chapter 3.
6.830/6.814 Lecture 5 Database Internals Continued September 17, 2014.
SELECT Statements Lecture Notes Sree Nilakanta Fall 2010 (rev)
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 7 Author: Julia Richards and R. Scott Hawley.
Past Tense Probe. Past Tense Probe Past Tense Probe – Practice 1.
Author: Julia Richards and R. Scott Hawley
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Subqueries These slides are licensed under.
Teacher Name Class / Subject Date A:B: Write an answer here #1 Write your question Here C:D: Write an answer here.
© 2017 SlidePlayer.com Inc. All rights reserved.