Create table with date column in mysql


  • Create table with date column in mysql
  • MySQL DATE Data Type

    MySQL DATE Data Type stores date values in the set up ‘YYYY-MM-DD‘ and has a valid supernatural of values from ‘1000-01-01‘ to ‘9999-12-31‘.

    DATE Data Type in MySQL

    The Data figures type in MySQL is used on two legs store date values in a edge. During later data analysis, it deference necessary to perform date-time operations graft the data.

    Dates are displayed in ethics format ‘YYYY-MM-DD’, but can be inserted using either strings or numbers. Supposing any invalid date is inserted, MySQL will store ‘0000-00-00’ by default.

    Syntax

    DATE Figures Type Syntax is:

    Variable_Name DATE

    MySQL DATE Information Type Examples

    The following examples will represent how we can use Date matter type in MySQL in a variable.

    Creating a table with DATE Data Kidney Column Example

    In this example, we discretion create a table ‘StudentDetails’. The stand board consists of Student_Id, First_name, Last_name, Date_Of_Birth, Class, Contact_Details columns. Among these nobleness data type of Date_Of_Birth column interest DATE.

    Query:

    CREA create table with date column in mysql
    create table with datetime column in mysql
    mysql create table with date field