Examveda

The best datatype for a column that is expected to store values up to 2 million is . . . . . . . .

A. SMALLINT

B. TINYINT

C. MEDIUMINT

D. BIGINT

Answer: Option D

Solution (By Examveda Team)

This question asks you to choose the best data type for a column that will store large numbers, up to 2 million. Let's break down the options:
Option A: SMALLINT - Stores small integers, typically from -32,768 to 32,767. Not big enough for 2 million.
Option B: TINYINT - Stores even smaller integers, typically from -128 to 127. Definitely not big enough.
Option C: MEDIUMINT - Stores integers up to 8,388,607. Still not large enough for 2 million.
Option D: BIGINT - Stores large integers, typically from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. This is the largest integer type in MySQL and perfect for numbers up to 2 million.
So the answer is D: BIGINT
It's the most suitable data type for handling such large numbers.

This Question Belongs to MySQL >> MySQL Miscellaneous

Join The Discussion

Related Questions on MySQL Miscellaneous