Examveda

If a column is expected to store values up to 2 million, the best datatype for it is . . . . . . . .

A. SMALLINT

B. TINYINT

C. MEDIUMINT

D. BIGINT

Answer: Option D

Solution (By Examveda Team)

This question is asking about the best data type to store a large number in a MySQL database.
Let's break down the options:
TINYINT can store small numbers from -128 to 127.
SMALLINT stores numbers from -32,768 to 32,767.
MEDIUMINT stores numbers from -8,388,608 to 8,388,607.
BIGINT stores numbers from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.

Since we need to store values up to 2 million, BIGINT is the best choice because it can handle the largest range of numbers.

Answer: D) BIGINT

This Question Belongs to MySQL >> MySQL Miscellaneous

Join The Discussion

Related Questions on MySQL Miscellaneous