Questions tagged [sqlite]

SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.

Filter by
Sorted by
Tagged with
3192votes
11answers
452kviews

Improve INSERT-per-second performance of SQLite

Optimizing SQLite is tricky. Bulk-insert performance of a C application can vary from 85 inserts per second to over 96,000 inserts per second! Background: We are using SQLite as part of a desktop ...
1730votes
20answers
1.5mviews

Select first row in each GROUP BY group?

As the title suggests, I'd like to select the first row of each set of rows grouped with a GROUP BY. Specifically, if I've got a purchases table that looks like this: SELECT * FROM purchases; My ...
user avatar
1298votes
17answers
1.1mviews

How can I list the tables in a SQLite database file that was opened with ATTACH?

What SQL can be used to list the tables, and the rows within those tables in an SQLite database file - once I have attached it with the ATTACH command on the SQLite 3 command line tool?
user avatar
  • 47.5k
1028votes
25answers
529kviews

How do I check in SQLite whether a table exists?

How do I, reliably, check in SQLite, whether a particular user table exists? I am not asking for unreliable ways like checking if a "select *" on the table returned an error or not (is this even a ...
user avatar
  • 23k
719votes
10answers
234kviews

How can I avoid concurrency problems when using SQLite on Android?

What would be considered the best practices when executing queries on an SQLite database within an Android app? Is it safe to run inserts, deletes and select queries from an AsyncTask's ...
user avatar
695votes
9answers
311kviews

Sqlite primary key on multiple columns

What is the syntax for specifying a primary key on more than 1 column in SQLITE ?
user avatar
610votes
25answers
439kviews

Is it possible to insert multiple rows at a time in an SQLite database?

In MySQL you can insert multiple rows like this: INSERT INTO 'tablename' ('column1', 'column2') VALUES ('data1', 'data2'), ('data1', 'data2'), ('data1', 'data2'), ('data1', 'data2'); ...
user avatar
  • 210k
590votes
19answers
340kviews

SQLite - UPSERT *not* INSERT or REPLACE

http://en.wikipedia.org/wiki/Upsert Insert Update stored proc on SQL Server Is there some clever way to do this in SQLite that I have not thought of? Basically I want to update three out of four ...
user avatar
  • 8,224
539votes
17answers
183kviews

What 'additional configuration' is necessary to reference a .NET 2.0 mixed mode assembly in a .NET 4.0 project?

I have a project in which I'd like to use some of the .NET 4.0 features but a core requirement is that I can use the System.Data.SQLite framework which is compiled against 2.X. I see mention of this ...
user avatar
  • 17.1k
488votes
23answers
617kviews

How to get a list of column names on Sqlite3 database?

I want to migrate my iPhone app to a new database version. Since I don't have some version saved, I need to check if certain column names exist. This Stackoverflow entry suggests doing the select ...
user avatar
  • 5,411
473votes
6answers
235kviews

Is there an SQLite equivalent to MySQL's DESCRIBE [table]?

I'm just getting started learning SQLite. It would be nice to be able to see the details for a table, like MySQL's DESCRIBE [table]. PRAGMA table_info [table] isn't good enough, as it only has basic ...
user avatar
  • 26.7k
393votes
7answers
365kviews

Insert new column into table in sqlite?

I have a table with columns name, qty, rate. Now I need to add a new column COLNew in between the name and qty columns. How do I add a new column in between two columns?
user avatar
  • 4,295
351votes
9answers
187kviews

What are the performance characteristics of sqlite with very large database files? [closed]

2020 update, about 11 years after the question was posted and later closed, preventing newer answers. Almost everything written here is obsolete. Once upon a time sqlite was limited to the memory ...
user avatar
  • 7,466
347votes
7answers
251kviews

How to get Top 5 records in SqLite?

I have tried this which did not work. select top 5 * from [Table_Name]
user avatar
  • 54.7k
345votes
11answers
203kviews

How to set Sqlite3 to be case insensitive when string comparing?

I want to select records from sqlite3 database by string matching. But if I use '=' in the where clause, I found that sqlite3 is case sensitive. Can anyone tell me how to use string comparing case-...
user avatar
  • 3,891

15 30 50 per page
1
2 3 4 5
6075