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.)
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.)
When comparing the date '15-march-2019' to the invoice_date column, Oracle will attempt to implicitly convert the string to a date according to the NLS_DATE_FORMAT settings, even if the format is not an exact match. However, for qty_sold = '0554982', Oracle will implicitly convert the string '0554982' to a number since qty_sold is of type NUMBER. Implicit conversion is generally allowed between strings and numbers or dates to match the column data type.
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 E. qty_sold = '0554982' uses implicit conversion ABDE - producing no errors BDE - are the correct ones
i agree
B is wrong, it is in the wrong format, the NLS_DATE_FORMAT is set to DD-MON-RR, and the answer B the date is set to DD-MONTH-YYYY
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!
BD is the answer
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!
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.
BDE , All tested on 19c
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';
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
Is that a type in D and E as they are not quoted properly
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
Explicit conversion : C Implicit conversion : A,B,D,E Answer ==> B,D,E
B,D,E are correct
HEY it's only 2 answers but you have 3
with NLS_DATE_FORMAT = DD-MON-RR you must use '15-march-19' not '15-march-2019', so B is incorrect.
https://www.examtopics.com/discussions/oracle/view/21058-exam-1z0-071-topic-2-question-39-discussion/
https://www.examtopics.com/discussions/oracle/view/21058-exam-1z0-071-topic-2-question-39-discussion/
D,E is correct