Answer the question
In order to leave comments, you need to log in
AUTOINCREMENT in SQLite3
I'm trying to create a simple table in SQLITE3:
CREATE TABLE IF NOT EXISTS `tbl` (
`id` int(3) NOT NULL AUTOINCREMENT,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
);
And nothing is created, swears at AUTOINCREMENT. Initially, I wrote AUTO_INCREMENT, as in MySQL, then I found the documentation, which states that it is written without underlining. No more sense, near "AUTOINCREMENT": syntax error. Tell me what am I doing wrong?
Answer the question
In order to leave comments, you need to log in
Here is a query that works.
CREATE TABLE IF NOT EXISTS `tbl` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,
`name` varchar(255) NOT NULL);
In general, to learn the SQL syntax that is used in SQLite, you need to read
In particular, at
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question