Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does it matter if i write "INTEGER" or "int" in sql command inside java?[sqlite]

When i execute sql commands, i.e. create table inside java code, does it matter if i write :

db.execSQL("create table mytable ("
                    + "scores int, "
                    + ");");
        }

Or this:

db.execSQL("create table mytable ("
                        + "scores INTEGER,"
                        + ");");
            }

Or it is both same thing, just different syntax?

like image 909
ERJAN Avatar asked Aug 28 '15 04:08

ERJAN


Video Answer


1 Answers

Sqlite3 documentation says if you use INT then the column has "resulting affinity" : INTEGER. Typenames INT, INTEGER, TINYINT, SMALLINT, MEDIUMINT, BIGINT, UNSIGNED BIG INT, INT2, INT8 from the CREATE TABLE statement or CAST expression: give INTEGER affinity for the column.

For Sqlite2 see this answer

like image 105
Developer Marius Žilėnas Avatar answered Oct 19 '22 17:10

Developer Marius Žilėnas