Set - 3

Question 6 :

What happens if a table has one column defined as TIMESTAMP?

Answer :

That field gets the current timestamp whenever the row gets altered.


Question 7 :

But what if you really want to store the timestamp data, such as the publication date of the article?

Answer :

Create two columns of type TIMESTAMP and use the second one for your real data.


Question 8 :

Explain data type TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ?

Answer :

The column exhibits the same behavior as a single timestamp column in a table with no other timestamp columns.


Question 9 :

What does TIMESTAMP ON UPDATE CURRENT_TIMESTAMP data type do?

Answer :

On initialization places a zero in that column, on future updates puts the current value of the timestamp in.


Question 10 :

Explain TIMESTAMP DEFAULT '2006:09:02 17:38:44? ON UPDATE CURRENT_TIMESTAMP. ?

Answer :

A default value is used on initialization, a current timestamp is inserted on update of the row.