Home Page
About Us


Tinyint is one of the Exact number data types that use integer data.


A varchar or variable character field is a set of character data of indeterminate length.



As varchar n takes spaces much more than tinyint and your main table is table2 so the second scenario is more optimize

from question  

Is it more efficient to have a table with one of its columns mostly empty or make a new table and refer to it?

Using varchar is less efficient than using tinyint like aju john suggested in his comment but unless i m dealing with a really performance-critical or a huge table - i find it easier to deal with

from question  

Alternative to ENUM Datatype in MySQL

I think tinyint is better than varchar in this case

from question  

Managing user points on Q&A site

I always use tinyint;it takes up less space than a varchar and is much better for speed and indexing

from question  

Flag columns, Varchar or INT?

Back to Home
Data comes from Stack Exchange with CC-BY-SA-4.0