The examples that follow will show you how to utilise the Date data type in a variable.
Example 1:
Establishing a Student
Information table
Student Id, First name, Last name, Date of Birth, Class, and Contact Details columns make up this list.
among which the Date Of Birth column's data type is DATE.
Data entry into the Table -
Use the following command as follows to verify.
SELECT * FROM StudentDetails ;
Output :
Therefore, the DATE data-type has been correctly placed in the Date Of Birth Column.
Example 2:
building a table of orders Source: Safalta.com
There are columns for the OrderNumber, OrderDate, ShippedDate, and DeliveryDate.
Inserting data into the Table –
Use the following command as follows to verify.
SELECT * FROM Orders;
Output :