The INVOICE table has a QTY_SOLD column of data type NUMBER and an INVOICE_DATE column of data type DATE. NLS_DATE_FORMAT is set to DD-MON-RR. Which two are true about data type conversions involving these columns in query expressions? (Choose two.)
A.
CONCAT (qty_sold, invoice_date) : requires explicit conversion
B.
invoice_date = '15-march-2019' : uses implicit conversion
C.
invoie_date > '01-02-2019' : uses implicit conversion
D.
qty_sold BETWEEN '101' AND '110' : uses implicit conversion
sorry but you are wrong.
Oracle always converts string to number and string to date.
VARCHAR → NUMBER
VARCHAR → DATE
only D and E are correct.
as the NLS_DATE_FORMAT is set to DD-MON-RR then B and C can not use implicit conversion because the showed dates are not in defined NLS format.
A is also incorrect
Right, i agree.
A is false cause CONCAT doesn't require explicit conversion.
B is false cause it gives to me error ORA-00933 is not the correct format (should be 15-MAR-2019)
C is false cause the month is not valid
D and E are true!
B (invoice_date = '15-march-2019' : uses implicit conversion) is wrong because the format in condition is 'DD-MONTH-YYYY' not like the NLS_DATE_FORMAT.
A : FALSE because invoice_date will be automatically converted, no explicit conversion is required
B & C : FALSE because the VARCHAR given does not respect the format expected by NLS_DATE_FORMAT
D & E : TRUE : VARCHAR will be converted automatically to NUMBER
Provided answer are corrects, but in the exam the E answer is formulated like this:
E. qty_sold = "˜0554982' : requires explicit conversion
As it is written now, it is also a plausible case. So be careful in the exam which are answer are provided!
A: select concat(2,'30-NOV-22') from dual; -- 230-NOV-22 implicit conversion
B: select to_char(sysdate,'DD-month-RR') from dual; -- need explicit conversion
C: select to_char(sysdate,'DD-mm-RR') from dual; -- need explicit conversion
D: select * from employees where employee_id between '101' and '110'; -- employee_id is NUMBER datatype, it may use implicit conversion
E: like D option
BDE are correct
select salary from employees where salary between '2000' and '3000';
select salary from employees where salary = '012008';
select start_date from job_history where start_date = '24-march-2006';
Again a question with 3 correct answers and not two. Assuming that the values supplied in answers D and E should read '101' AND '110', and '0554982' respectively (we have seen "mistakes" like this on the site before), the we can easily test the options against the sample HR schema. I tested all the options against Oracle 12.2.0.1.
A is wrong. Oracle performs implicit conversion here.
B is correct. Implicit conversion does work here. The supplied date format is DD-month-YYYY, it is close enough to the default DD-MON-RR, which allows Oracle to do the conversion.
C is wrong. Oracle cannot perform implicit conversion here. The supplied format is DD-MM-YYYY, the MONTH portion of the format causes the issue here, it is supplied in a number format where the default MON format requires a text based value. Error ORA-01843: not a valid month is returned.
D is correct. Oracle will convert the supplied values of 101 and 110 into number format to match the data type of the column.
E is correct. Oracle will convert the supplied value into a number format to match the data type of the column. The preceding 0 will also be dropped after conversion.
Is that a type in D and E as they are not quoted properly
upvoted 2 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
NowOrNever
Highly Voted 4 years, 3 months agoEkos
4 years agoGuhborges
3 years, 1 month agoioio
Highly Voted 3 years, 9 months agoleozanon94
3 years, 4 months agoamorimleandro
Most Recent 1 month, 3 weeks agopiipoh
6 months, 3 weeks agohoangHai_Pro
10 months ago[Removed]
1 year, 4 months agosheilawu
1 year, 3 months agoauwia
1 year, 6 months agoRaNik69
1 year, 7 months agoivanadj
1 year, 10 months agoivanadj
1 year, 10 months agoFelipeC
1 year, 10 months agoTunglinfo9
2 years, 1 month agosaimmuz
2 years, 3 months agoFranky_T
2 years, 8 months agoryuah
3 years agoescoletsgo1
4 years, 3 months agoChansi
4 years, 5 months ago