Using the Oracle Database Write ONLY ONE SQL statement which produces the follow
ID: 3570277 • Letter: U
Question
Using the Oracle Database
Write ONLY ONE SQL statement which produces the following output:
DEPARTMENT_ID
EMP_COUNT
DEPT_PERCENTAGE
0
0
10
1
.009433962
20
2
.018867925
30
6
.056603774
40
1
.009433962
50
45
.424528302
60
5
.047169811
70
1
.009433962
80
34
.320754717
90
3
.028301887
100
6
.056603774
110
2
.018867925
DEPARTMENT_ID
EMP_COUNT
DEPT_PERCENTAGE
0
0
10
1
.009433962
20
2
.018867925
30
6
.056603774
40
1
.009433962
50
45
.424528302
60
5
.047169811
70
1
.009433962
80
34
.320754717
90
3
.028301887
100
6
.056603774
110
2
.018867925
Explanation / Answer
Hi,
Please find the sql statement below:
SELECT DEPARTMENT_ID,EMP_COUNT,DEPT_PERCENTAGE FROM DEPT_TABLE WHERE (DEPARTMENT_ID LIKE '%0' OR DEPARTMENT_ID IS NULL );
if there is limitation for department_id the following statement will be fine.
SELECT DEPARTMENT_ID,EMP_COUNT,DEPT_PERCENTAGE FROM DEPT_TABLE WHERE (DEPARTMENT_ID LIKE '%0' OR DEPARTMENT_ID IS NULL ) AND DEPARTMENT_ID < 111
Thank U
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.