Set - 3

Question 1 :

What is SERIAL data type in MySQL?

Answer :


Question 2 :

What happens when the column is set to AUTO INCREMENT and you reach the maximum value for that table?

Answer :

It stops incrementing. It does not overflow to 0 to prevent data losses, but further inserts are going to produce an error, since the key has been used already.

Question 3 :

Explain the difference between BOOL, TINYINT and BIT. ?

Answer :

Prior to MySQL 5.0.3: those are all synonyms. After MySQL 5.0.3: BIT data type can store 8 bytes of data and should be used for binary data.

Question 4 :

Explain the difference between FLOAT, DOUBLE and REAL. ?

Answer :

FLOATs store floating point numbers with 8 place accuracy and take up 4 bytes. DOUBLEs store floating point numbers with 16 place accuracy and take up 8 bytes. REAL is a synonym of FLOAT for now.

Question 5 :

If you specify the data type as DECIMAL (5,2), what's the range of values that can go in this table?

Answer :

999.99 to -99.99. Note that with the negative number the minus sign is considered one of the digits.