What is the difference between BIT and TINYINT in MySQL?
In which cases would you use which? Is there much of a difference? Which I typically used by persistence engines to store booleans? ...
In which cases would you use which? Is there much of a difference? Which I typically used by persistence engines to store booleans? ...
Should I choose the smallest datatype possible, or if I am storing the value 1 for example, it doesn't matter what is the col datatype and the value will occupy the same memory size? The question is also, cuz I will always have to convert it and play around in the application. UPDATE I think that varchar(1) and varchar(50) is the sa...
Here's the problem. In MySQL's Connector/NET a TINYINT(1) field properly translates back and forth into a .NET bool value. If I select from a table with a TINYINT(1) column, everything is golden. However, when you use built-in MySQL v5.0 functions like: SELECT (3 BETWEEN 2 AND 4) AS oddly_not_boolean; The actual return type from the d...
Hi all, MY PLATFORM: PHP & mySQL MY SITUATION: I came across a situation where I need to store a value for user selection in one of my columns of a table. Now my options would be to: Either declare the Column as char(1) and store the value as 'y' or 'n' Or declare the Column as inyint(1) and store the value as 1 or 0 This column so...
If TINYINT can store three characters, for example, why can't it store up to the number 999? ...
Hi A default value of 0 is creeping into a Surveys app I am developing, for no reason that I can see. The problem is as follows: I have a group of Html.RadioButtons that represent the possible values a user can choose to answer a survey question (1 == Not at all, 2 == A little, 3 == A lot). I have used a tinyint datatype, that does n...
Hi all, I am working on a project using asp.net mvc 2 and linq to sql. The problem occurs when trying to insert data into a table where the table has an identity column type of tinyint. When trying to insert the following error occurs: The primary key column of type 'TinyInt' cannot be generated by the server. Does linq to sql suppor...
Hi, I have 6 buttons on my GUI. The visibility of the buttons can be configured via checkboxes. Checking the checkbox and saving means the correpsonding button should be shown. I am wondering if it is somehow possible to have one TinyInt column in the database which represents the visibility of all 6 buttons. I created an enum for the b...
Hi everybody, What's the most appropriate (read least data consuming) data field to store a true/false/1/0 value in a mySQL database? I have previously used a one character long tinyint, but I am not sure if it's the best solution? Thanks! ...
Lets assume I want to save the count of datagrid rows which can be max. 24 because each row is 1 hour. To save the row index in the database a tinyint field would be totally enough. But back in my mind I remember slightly that databases are optimized for integers?! So is it worth to use tinyint? ...
Which one is better, Tinyint with 0 and 1 values or ENUM 0,1 in MyISAM tables and MySQL 5.1? ...