
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
What is the use of ALLOW_INVALID_DATES SQL mode?
As the name suggests, enabling ALLOW_INVALID_DATES SQL mode will allow us to store invalid dates in the table. The example is given below to understand it −
Example
mysql> SET sql_mode = ALLOW_INVALID_DATES; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> Insert Into detail_bday(Name, Birth_Date) values('Sonia','1993-11-31'); Query OK, 1 row affected (0.09 sec) mysql> Insert Into detail_bday(Name, Birth_Date) values('Ram','0000-00-00'); Query OK, 1 row affected (0.10 sec) mysql> Select * from detail_bday; +----+---------+------------+ | Sr | Name | Birth_Date | +----+---------+------------+ | 1 | Saurabh | 1990-05-12 | | 2 | Raman | 1993-06-11 | | 3 | Gaurav | 1984-01-17 | | 4 | Rahul | 1993-06-11 | | 5 | Sonia | 1993-11-31 | | 6 | Ram | 0000-00-00 | +----+---------+------------+ 6 rows in set (0.00 sec)
Above result set shows that MySQL allows us to store invalid date like ‘1993-11-31’ and ‘0000-00-00’ after enabling the ALOOW_INVALID_DATES SQL mode.
- Related Articles
- What is the use of IGNORE_SPACE SQL mode?
- What is the use of NO_UNSIGNED_SUBTRACT SQL mode in handling overflow?
- What is the use of update command in SQL?
- Mean and Mode in SQL Server
- How does the precedence of || operator depend on PIPES_AS_CONCAT SQL mode?
- What is the holozoic mode of nutrition?
- What is the chemoautotrophic mode of nutrition?
- What is SQL?
- What is Mode?
- What is the architecture of Asynchronous Transfer Mode?
- What is the mode of nutrition in amoeba?
- What is the mode of nutrition in plants?
- What is the mode of nutrition in fungi?
- What is PL/SQL?
- What is SQL Injection?

Advertisements