2
votes
Accepted
What is the best data type for an array like structure in SQLite?
Just split the data into two tables:
create table tracks(trackid);
create table sectors(trackid, sectorid, times);
insert into tracks values('track1');
insert into tracks values('track2');
insert ...
1
vote
SQLite: How to include an Sqlean define statement in a `.sql` file?
Answering my own question. According to @nbk user, UDF are not part of the database, but of the session. Fortunately, SQLite offers a .read command which can execute a SQL file. So, under the SQLite ...
1
vote
Accepted
Select random records until a cumulative total is exceeded
In other words, the task is to get a list of records with a sum less then threshold, and one additional record to go over the threshold?
This can be achieved by using with and union clauses:
with
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
sqlite × 690database-design × 69
mysql × 45
performance × 40
postgresql × 37
select × 29
join × 27
query-performance × 26
index × 23
foreign-key × 23
trigger × 22
sql-server × 21
query × 21
python × 19
optimization × 17
insert × 17
subquery × 16
sqlite3 × 16
update × 14
group-by × 12
schema × 10
primary-key × 10
aggregate × 10
cte × 10
datatypes × 9