Question

In: Computer Science

would the following SQL statement returns next sunday's date? SELECT NEXT_DAY(TO_DATE('13-01-2005','DD-MM-YYYY'),'SUN') As "Date"FROM DUAL; A)  True B)  False...

would the following SQL statement returns next sunday's date? SELECT NEXT_DAY(TO_DATE('13-01-2005','DD-MM-YYYY'),'SUN') As "Date"FROM DUAL;

A)  True
B)  False

Question 4 options:

True

False

Question 5 (2 points)

1.  Which of the given SQL statement generate the following result?

Today's date
Monday ,March 2008

A) SELECT TO_CHAR(sysdate,'day,Month yyyy') "Today's date"
FROM DUAL;
B) SELECT TO_CHAR(sysdate,'Day,Mon yyyy') "Today's date"
FROM DUAL;
C) SELECT TO_CHAR(sysdate, "Day,Month yyyy ") "Today's date"
FROM DUAL;
D) SELECT TO_CHAR(sysdate,'Day,Month yyyy') "Today's date"
FROM DUAL;

Question 7 (2 points)

Which of the following statement is NOT true for NVL function?

A) The NVL function is used to replace a null value with another value.
B) It can be used with numerical and/ or non-numerical data type values.
C) The NVL function does not affect not null condition.
D) The NVL function is also used with not null condition

Question 8 (2 points)

The NVL function

A) Assists in the distribution of output across multiple columns.
B) Allows the user to specify alternate output for non-null column values.
C) Allows the user to specify alternate output for null column values.
D) Nullifies the value of the column output.

Solutions

Expert Solution

Would the following SQL statement returns next sunday's date?

SELECT NEXT_DAY(TO_DATE('13-01-2005','DD-MM-YYYY'),'SUN') As "Date"FROM DUAL;

Answer: False

TO_DATE RR format is:

 SELECT next_day(TO_DATE('05-01-13', 'RR-MM-DD'), 'SUN')As "Date" FROM DUAL;

Question 5

D) SELECT TO_CHAR(sysdate,'Day,Month yyyy') "Today's date"
FROM DUAL;

A) SELECT TO_CHAR(sysdate,'day,Month yyyy') "Today's date"
FROM DUAL; invalid as 'd' should be capital
B) SELECT TO_CHAR(sysdate,'Day,Mon yyyy') "Today's date"
FROM DUAL; invalid 'mon' should be Monday

Question 8

Answer: Allows the user to specify alternate output for null column values

Explanation:

The NVL function is used to substitute NULL values with a meaningful value to be returned by the query.

Example: SELECT ename, NVL(last_salary,0) FROM emp;

I wasn't sure about the 7th question.

If you have any doubts, leave a comment below before rating. I'll be happy to assist you further


Related Solutions

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT