The TIME type is a data type used to store time. The format in which ‘HH:MM:SS’ is the basis when inputting time as a string.
here is a sample.
mysql> create table timetest(
-> id int auto_increment primary key,
-> starttime time,
-> endtime time
-> )
-> ;
Query OK, 0 rows affected (0.17 sec)
mysql> select * from timetest;
Empty set (0.00 sec)
mysql> describe timetest;
+-----------+---------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+---------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| starttime | time | YES | | NULL | |
| endtime | time | YES | | NULL | |
+-----------+---------+------+-----+---------+----------------+
3 rows in set (0.07 sec)
mysql> insert into timetest(starttime, endtime) values('08:00', '12:00');
Query OK, 1 row affected (0.07 sec)
mysql> select * from timtetest;
ERROR 1146 (42S02): Table 'test.timtetest' doesn't exist
mysql> select * from timetest;
+----+-----------+----------+
| id | starttime | endtime |
+----+-----------+----------+
| 1 | 08:00:00 | 12:00:00 |
+----+-----------+----------+
1 row in set (0.00 sec)
I see.