85.View the Exhibit and examine the structure and data in the INVOICE table.
Which statements are true regarding data type conversion in expressions used in queries? (Choose all that apply.)
A.inv_amt ='0255982' : requires explicit conversion
B.inv_date > '01-02-2008' : uses implicit conversion
C.CONCAT(inv_amt,inv_date) : requires explicit conversion
D.inv_date = '15-february-2008' : uses implicit conversion
E.inv_no BETWEEN '101' AND '110' : uses implicit conversion
答案:DE
解析:
A:错误,number和varchar隐式转换
B:错误,右边的格式不是默认的格式
C:错误,date和number隐式转换
D:正确,日期和varchar显示转换
E:正确,number varchar 隐式转换,正确
SQL> select * from test;
A INV_DATE
---------- ---------
1 03-MAR-16
SQL> select * from test where inv_date='03-march-2016';
no rows selected
SQL> select * from test where inv_date='03-march-16';
no rows selected
SQL> select * from test where inv_date='03-mar-16';
no rows selected
SQL> select * from test where inv_date='03-mar-2016';
no rows selected
SQL> select * from test where inv_date='03-03-16';
select * from test where inv_date='03-03-16'
*
ERROR at line 1:
ORA-01843: not a valid month
SQL> select * from test where inv_date='03-03-2016';
select * from test where inv_date='03-03-2016'
*
ERROR at line 1:
ORA-01843: not a valid month
SQL> select value from nls_session_parameters where parameter='NLS_DATE_FORMAT';
VALUE
--------------------------------------------------------------------------------
Which statements are true regarding data type conversion in expressions used in queries? (Choose all that apply.)
A.inv_amt ='0255982' : requires explicit conversion
B.inv_date > '01-02-2008' : uses implicit conversion
C.CONCAT(inv_amt,inv_date) : requires explicit conversion
D.inv_date = '15-february-2008' : uses implicit conversion
E.inv_no BETWEEN '101' AND '110' : uses implicit conversion
答案:DE
解析:
A:错误,number和varchar隐式转换
B:错误,右边的格式不是默认的格式
C:错误,date和number隐式转换
D:正确,日期和varchar显示转换
E:正确,number varchar 隐式转换,正确
SQL> select * from test;
A INV_DATE
---------- ---------
1 03-MAR-16
SQL> select * from test where inv_date='03-march-2016';
no rows selected
SQL> select * from test where inv_date='03-march-16';
no rows selected
SQL> select * from test where inv_date='03-mar-16';
no rows selected
SQL> select * from test where inv_date='03-mar-2016';
no rows selected
SQL> select * from test where inv_date='03-03-16';
select * from test where inv_date='03-03-16'
*
ERROR at line 1:
ORA-01843: not a valid month
SQL> select * from test where inv_date='03-03-2016';
select * from test where inv_date='03-03-2016'
*
ERROR at line 1:
ORA-01843: not a valid month
SQL> select value from nls_session_parameters where parameter='NLS_DATE_FORMAT';
VALUE
--------------------------------------------------------------------------------
DD-MON-RR
这里应该是默认会把2008认为08,february认为是feb