0
I am manipulating some databases in which the vast majority of columns are with the data type VARCHAR
for fields such as Date, Price, Total Value, Birth, Date/Time and etc. Briefly, practically everything is in varchar.
At least the tables I had to create later I decided to put in the type of data that that column is intended because, for me, it is easier at the time of programming to manipulate this data.
But the people where I work "get on my case" because I decide to use different types of data from VARCHAR
. At one point he even argued about it. They said it was silly and a waste of time.
However, I believe that there are benefits in specifying the type of data, mainly because it is easier to manipulate during programming and to occupy less space in the database (my statement is correct?).
Are there more benefits in specifying the type of data each column is intended for in a bank? Better yet, there is some kind of study that addresses the benefits of using certain types of data during the storage or execution of a project program?
Most of the time fields with specified type may have a certain type of optimization for that type, besides of course, if by chance and for example there is a data validation failure and there is an attempt to insert a field that has some text that is not alphanumeric in a field in the database that is with the integer type will occur an insertion error.
– MarceloBoni
1: source and A basic example but not far from your reality (Note the comments) In this case we can have a certain performance difference between the types
varchar
andchar
depending on the type of data you want to write in the bd– MarceloBoni