Home
You may like this!
26.
What does TIMESTAMP ON UPDATE CURRENT_TIMESTAMP data type do?

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

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

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

28.
If I created a column with data type VARCHAR(3), what would I expect to see in MySQL table?

- CHAR(3), since MySQL automatically adjusted the data type.

29.
How would you change a table to InnoDB?

ALTER TABLE techpreparation_questions ENGINE innodb;

30.
When you create a table, and then run SHOW CREATE TABLE on it, you occasionally get different results than what you typed in. What does MySQL modify in your newly created tables?

  1. VARCHARs with length less than 4 become CHARs
  2. CHARs with length more than 3 become VARCHARs.
  3. NOT NULL gets added to the columns declared as PRIMARY KEYs
  4. Default values such as NULL are specified for each column