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

Select True or False from each pull-down menu, depending on whether the corresponding statement is true...
Select True or False from each pull-down menu, depending on whether the corresponding statement is true or false.   ?    True    False      1. Using the standard normal curve, the z−z−score representing the 90th percentile is 1.28.   ?    True    False      2. The mean and standard deviation of a normally distributed random variable which has been standardized are one and zero, respectively.   ?    True    False      3. A random variable XX is normally distributed with a mean of 150 and a variance of 36. Given that X=120X=120, its corresponding z−z−...
Select the TRUE statement from the following: Select one: a. The outermost electrons of Fe3+ are...
Select the TRUE statement from the following: Select one: a. The outermost electrons of Fe3+ are more energetic than the outermost electrons of Fe0 b. When the Cr atom loses electrons to become positively charged, the first electrons lost are from the 3d subshell. c. For any given element, the anion will be smaller than the neutral atom. d. For any given element, the cation will be smaller than the neutral atom.
Is the following statement true or false:  "The correlation between (U.S.) stock market returns and long-term U.S....
Is the following statement true or false:  "The correlation between (U.S.) stock market returns and long-term U.S. treasury bond returns is generally negative during times when equity markets are crashing." True False Is the following statement true or false: " Consider a strategy that buys 1-year US treasury bonds, holds them to maturity, and uses the proceeds from the maturing bonds to buy new 1-year bonds. In this case, the actual/realized returns is uncertain, but it is always positive." True False...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT