What is the outcome?

View the Exhibit and examine the data in the EMPLOYEES table.

You want to generate a report showing the total compensation paid to each employee to date.
You issue the following query:

What is the outcome?

View the Exhibit and examine the data in the EMPLOYEES table.

You want to generate a report showing the total compensation paid to each employee to date.
You issue the following query:

What is the outcome?

A.
It generates an error because the alias is not valid.

B.
It executes successfully and gives the correct output.

C.
It executes successfully but does not give the correct output.

D.
It generates an error because the usage of the ROUND function in the expression is not valid.

E.
It generates an error because the concatenation operator can be used to combine only two
items.

Explanation:
ROUND(column|expression, n) Rounds the column, expression, or value to n decimal places or, if
n is omitted, no decimal places (If n is negative, numbers to the left of decimal point are rounded.)



Leave a Reply 10

Your email address will not be published. Required fields are marked *


sh3342

sh3342

I guess the reason why C is the correct answer is because the Round function automate round the number and not keep the decimal. The original calculation should be:
(SYSDATE-HIREDATE)/365 *SAL + COMM

Igor

Igor

C – because it counts salary paid only once per year (/365)

SQL student

SQL student

i think its because some comm values are null….giving a null result. so people will have null as their total compensation

Sagar

Sagar

Answer should be E as without any concatenation operator, this query will throw “FROM keyword not found” exception.

Eamon

Eamon

@Sagar, yes, I think you are right.

john

john

i have execute same query but it gives an error from where not where expected.

Mr. T

Mr. T

None of the answers is correct.
It gives “ORA-00923: FROM keyword not found where expected”

user

user

answer c is correct. when we add anything with null value the result will be null so in the above query the result will be null for those who do not have a commission

The Tuk

The Tuk

SQL> select ename || ‘joined on’ || hiredate || ‘.the total compensation paid is’ ||
2 to_char(round(round(sysdate – hiredate)/265) * sal + comm) “compen util date” from EMPLOYEES_Q48;

compen util date
——————————————————————————–
SMITHjoined on17-DEC-00.the total compensation paid is
ALLENjoined on20-FEB-99.the total compensation paid is41900
WARDjoined on22-FEB-95.the total compensation paid is39250
JONESjoined on02-APR-98.the total compensation paid is
MARTINjoined on28-SEP-99.the total compensation paid is32650
BLAKEjoined on01-MAY-97.the total compensation paid is