Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Oracle Apex SQL Query: In what city does Allen work? (Just one city) Handy SQL S

ID: 3765834 • Letter: O

Question

Oracle Apex SQL Query: In what city does Allen work? (Just one city)

Handy SQL Standard Table Reference

Feel free to print this page as you'll find it useful to quickly have this on hand to help you understand and create SQL statements based on these three tables created and loaded in the Oracle APEX product. The tables below are also the same ones referenced in this week's lecture notes and homework assignment.

1. The EMP table

The table EMP is used to store information about employees.

EMPNO

ENAME

JOB

MGR

HIREDATE

SAL

COMM

DEPTNO

7839

KING

PRESIDENT

-

11/17/1981

5000

-

10

7698

BLAKE

MANAGER

7839

05/01/1981

2850

-

30

7782

CLARK

MANAGER

7839

06/09/1981

2450

-

10

7566

JONES

MANAGER

7839

04/02/1981

2975

-

20

7788

SCOTT

ANALYST

7566

12/09/1982

3000

-

20

7902

FORD

ANALYST

7566

12/03/1981

3000

-

20

7369

SMITH

CLERK

7902

12/17/1980

800

-

20

7499

ALLEN

SALESMAN

7698

02/20/1981

1600

300

30

7521

WARD

SALESMAN

7698

02/22/1981

1250

500

30

7654

MARTIN

SALESMAN

7698

09/28/1981

1250

1400

30

7844

TURNER

SALESMAN

7698

09/08/1981

1500

0

30

7876

ADAMS

CLERK

7788

01/12/1983

1100

-

20

7900

JAMES

CLERK

7698

12/03/1981

950

-

30

7934

MILLER

CLERK

7782

01/23/1982

1300

-

10


2. The DEPT Table

The DEPT table contains information about departments that each employee works for.

DEPTNO

DNAME

LOC

10

ACCOUNTING

NEW YORK

20

RESEARCH

DALLAS

30

SALES

CHICAGO

40

OPERATIONS

BOSTON

3. The SALGRADE Table

Another table commonly used is SALGRADE which contains the minimum and maximum range for various salary grades.

GRADE

LOSAL

HISAL

1

700

1200

2

1201

1400

3

2001

3000

4

3001

9999

EMPNO

ENAME

JOB

MGR

HIREDATE

SAL

COMM

DEPTNO

7839

KING

PRESIDENT

-

11/17/1981

5000

-

10

7698

BLAKE

MANAGER

7839

05/01/1981

2850

-

30

7782

CLARK

MANAGER

7839

06/09/1981

2450

-

10

7566

JONES

MANAGER

7839

04/02/1981

2975

-

20

7788

SCOTT

ANALYST

7566

12/09/1982

3000

-

20

7902

FORD

ANALYST

7566

12/03/1981

3000

-

20

7369

SMITH

CLERK

7902

12/17/1980

800

-

20

7499

ALLEN

SALESMAN

7698

02/20/1981

1600

300

30

7521

WARD

SALESMAN

7698

02/22/1981

1250

500

30

7654

MARTIN

SALESMAN

7698

09/28/1981

1250

1400

30

7844

TURNER

SALESMAN

7698

09/08/1981

1500

0

30

7876

ADAMS

CLERK

7788

01/12/1983

1100

-

20

7900

JAMES

CLERK

7698

12/03/1981

950

-

30

7934

MILLER

CLERK

7782

01/23/1982

1300

-

10

Explanation / Answer

I think this will help you

SELECT EMP.ENAME,DEPT.LOC FROM EMP INNER JOIN DEPT ON EMP.DEPTNO=DEPT.DEPTNO ORDER BY EMP.ENAME

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote