Third: What would be produced? Explain! Note the tables below are sample tables that come with Oracle. SQL SELECT ename, job, sal, comm, grade 2 FROM emp, salgrade 3 WHERE sal BETWEEN losal and hisal and sal > comm * 2; Salgrade table GRADE LOSAL HISAL 700 1201 1401 2001 1200 1400 2000 3000 9999 3001 Emp table EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO 7369 SMITH 7499 ALLEN 7521 WARD CLERK SALESMAN SALESMAN MANAGER SALESMAN MANAGER MANAGER 7902 17-DEC-80 7698 20-FEB-81 7698 22-FEB-81 7839 02-APR-81 7698 28-SEP-81 7839 01-MAY-81 7839 09-JUN-81 800 1600 1250 300 500 20 30 30 20 30 7566 JONES 7654 MARTIN 7698 BLAKE 7782 CLARK 2975 1250 2850 2450 3000 1400 10 20 7788 SCOTT 7839 KING 7844 TURNER 7876 ADAMS 7900 JAMES 7902 FORD 7934 MILLER ANALYST PRESIDENT SALESMAN CLERK CLERK ANALYST CLERK 7566 19-APR-87 17-NOV-81 5000 1500 7698 08-SEP-81 7788 23-MAY-87 7698 03-DEC-81 7566 03-DEC-81 7782 23-JAN-82 1100 950 3000 1300 20 30 20 10 OOO 000 312 320 N

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Please clarify how you got the answer!

Third: What would be produced? Explain! Note the tables below are sample tables that come with Oracle.
SQL SELECT ename, job, sal, comm, grade
2 FROM emp, salgrade
3 WHERE sal BETWEEN losal and hisal and sal > comm * 2;
Salgrade table
GRADE
LOSAL
HISAL
700
1200
2
1201
1400
1401
2000
2001
3001
4
3000
9999
Emp table
ΕΜEΝΟ ΕΝΑΜΕ
JOB
MGR
HIREDATE
SAL
COMM
DEPTNO
----- ---
---------
7369 SMITH
CLERK
7902 17-DEC-80
800
20
7499 ALLEN
SALESMAN
7698 20-FEB-81
1600
300
30
7521 WARD
7566 JONES
7654 MARTIN
7698 BLAKE
SALESMAN
7698 22-FEB-81
1250
500
30
MANAGER
7839 02-APR-81
2975
20
7698 28-SEP-81
7839 01-MAY-81
SALESMAN
1250
1400
30
MANAGER
2850
30
7782 CLARK
MANAGER
7839 09-JUN-81
2450
10
7788 SCOTT
7839 KING
ANALYST
7566 19-APR-87
3000
20
17-NOV-81
7698 08-SEP-81
PRESIDENT
5000
10
7844 TURNER
SALESMAN
1500
30
7876 ADAMS
7788 23-MAY-87
7698 03-DEC-81
CLERK
1100
20
7900 JAMES
CLERK
950
30
7902 FORD
ANALYST
7566 03-DEC-81
3000
1300
20
7934 MILLER
CLERK
7782 23-JAN-82
10
Transcribed Image Text:Third: What would be produced? Explain! Note the tables below are sample tables that come with Oracle. SQL SELECT ename, job, sal, comm, grade 2 FROM emp, salgrade 3 WHERE sal BETWEEN losal and hisal and sal > comm * 2; Salgrade table GRADE LOSAL HISAL 700 1200 2 1201 1400 1401 2000 2001 3001 4 3000 9999 Emp table ΕΜEΝΟ ΕΝΑΜΕ JOB MGR HIREDATE SAL COMM DEPTNO ----- --- --------- 7369 SMITH CLERK 7902 17-DEC-80 800 20 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30 7521 WARD 7566 JONES 7654 MARTIN 7698 BLAKE SALESMAN 7698 22-FEB-81 1250 500 30 MANAGER 7839 02-APR-81 2975 20 7698 28-SEP-81 7839 01-MAY-81 SALESMAN 1250 1400 30 MANAGER 2850 30 7782 CLARK MANAGER 7839 09-JUN-81 2450 10 7788 SCOTT 7839 KING ANALYST 7566 19-APR-87 3000 20 17-NOV-81 7698 08-SEP-81 PRESIDENT 5000 10 7844 TURNER SALESMAN 1500 30 7876 ADAMS 7788 23-MAY-87 7698 03-DEC-81 CLERK 1100 20 7900 JAMES CLERK 950 30 7902 FORD ANALYST 7566 03-DEC-81 3000 1300 20 7934 MILLER CLERK 7782 23-JAN-82 10
Fourth: What would be produced? Explain for each of the three selects below. Note the table is the donor table with data shown in #2 above.
SQL SELECT contact, AVG (yrgoal)
2 FROM donor
3 GROUP BY contact;
SQL SELECT state, contact, AVG (yrgoal)
2 FROM donor
3 GROUP BY state, contact;
SQL select state, contact, avg (yrgoal)
2 from donor
3 group by state;
SQL> select state, avg (yrgoal)
from donor
where yrgoal > 100
group by state
5 having state - 'MA';
Transcribed Image Text:Fourth: What would be produced? Explain for each of the three selects below. Note the table is the donor table with data shown in #2 above. SQL SELECT contact, AVG (yrgoal) 2 FROM donor 3 GROUP BY contact; SQL SELECT state, contact, AVG (yrgoal) 2 FROM donor 3 GROUP BY state, contact; SQL select state, contact, avg (yrgoal) 2 from donor 3 group by state; SQL> select state, avg (yrgoal) from donor where yrgoal > 100 group by state 5 having state - 'MA';
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY