Which three statements describe how the strict SQL mode provides added security?

Which three statements describe how the strict SQL mode provides added security?

Which three statements describe how the strict SQL mode provides added security?

A.
It rejects statements that try to insert out-of-range values

B.
It rejects invalid dates.

C.
It limits the operations that the server can perform.

D.
It rejects queries that produce out-of-range values.

E.
It rejects dates with zero day or month values.

Explanation:



Leave a Reply 14

Your email address will not be published. Required fields are marked *


karthik R

karthik R

CDE

mutex

mutex

strict is only about INSERT/UPDATE

mutex

mutex

A-true, throws “data too long”
B- true, Invalid dates like ’13-13-2001′ are rejected
C- true, it limits INSERT|UPDATE
D- false, it only affects INSERT|UPDATE, not SELECT
E- false, you can do

SET @@SESSION.SQL_MODE=’STRICT_TRANS_TABLES’;
CREATE TABLE t(d datetime);
INSERT INTO t(d) VALUES (‘2001-00-00’);
SELECT YEAR(d) FROM t; — 2001

ssq

ssq

agree with you

none

none

C is false, it does not limit the INSERT | UPDATE on server. The server can still perform all operations ( INSERT / UPDATE / DELETE / SELECT )

Only the strict sql mode itself is limited to INSERT | UPDATE.

ssq

ssq

limit is not reject,OK?

Jdo

Jdo

https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_strict_trans_tables

====================
Strict mode affects whether the server permits dates in which the year part is nonzero but the month or day part is 0 (dates such as ‘2010-00-01’ or ‘2010-01-00’):

If strict mode is not enabled, dates with zero parts are permitted and inserts produce no warning.

If strict mode is enabled, dates with zero parts are not permitted and inserts produce an error, unless IGNORE is given as well. For INSERT IGNORE and UPDATE IGNORE, dates with zero parts are inserted as ‘0000-00-00’ (which is considered valid with IGNORE) and produce a warning.
=============================================