Reputation: 155
I am creating a table in mysql where I want to store 'date of birth' and 'time of birth' as 2 separate fields. What data types I have to use to create these 2 columns in mysql?
Upvotes: 1
Views: 40
Reputation: 35
There are two data types DATE and Time that will help you. Here is an example:
CREATE TABLE table (
id INT PRIMARY KEY AUTO_INCREMENT,
birth_date DATE,
birth_time TIME
);
Upvotes: 1