![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What happens when you insert nothing after declaring a column “timestamp default CURRENT_TIMESTAMP”?
In this case, the current timestamp gets inserted into the table column. Let us first create a table −
mysql> create table DemoTable ( ArrivalDate timestamp default CURRENT_TIMESTAMP ); Query OK, 0 rows affected (0.55 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values(now()); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values(); Query OK, 1 row affected (0.13 sec)
Display all records from the table using select statement −
mysql> select *from DemoTable;
This will produce the following output −
+---------------------+ | ArrivalDate | +---------------------+ | 2019-09-01 14:08:47 | | 2019-09-01 14:08:50 | +---------------------+ 2 rows in set (0.00 sec)
Advertisements