A popular open-source embeddable (i.e. non client-server) RDBMS implemented as a C library.

learn more… | top users | synonyms

4
votes
1answer
244 views

SQL query to compute longest travel time for each id number

I am a novice in SQL and I have a problem as follows. There are two tables TRNSCTN_TAB: CREATE TABLE TRNSCTN_TAB( `transactionId` int , `UniqueId` int , `transactionTimeStamp` ...
0
votes
1answer
31 views

How to get average of views before clicking on advertisement?

I've got two tables containing information about viewing and clicking on advertisement by each user: Clicks: userID Action Time 123 c 2016-01-08 01:57:00 123 c 2016-01-11 ...
0
votes
1answer
679 views

Constructing an SQL query with time intervals

I've a simple but large table in an SQL database which has four fields (id(int PK), time (unix timestamp, not null), value (double, not null) and an ID_fk (integer foreign key). Data is recorded ...
2
votes
2answers
31 views

Finding opening and closing price using sqlite GROUP BY statement (accessing main query alias in subquery)

I want to preface this post by saying that I am a SQL(ite) newbie. My main goal is to find the opening/closing/high/low/average prices of each 5 minute interval of these stock prices. I can get the ...
1
vote
2answers
319 views

Using SQLite ODBC without installing a driver

I am currently trying to access a SQLite database via an ODBC connection but the system that I am working on is extremely locked down and it is therefore not possible to install the drivers. Is there ...
0
votes
1answer
104 views

SQLite optimizations for possible huge data storage

I want use SQLite database as the storage for possible huge data size, I need some comments about optimization to keep stability (like unexpexted epic fails, BSOD for example) with fast access speed. ...
0
votes
1answer
10 views

A different number of AFTER INSERT trigger alarms in SQLite and SQL Server

I have trigger CREATE TRIGGER [Foo] AFTER INSERT ON [Bar] BEGIN UPDATE Log SET count = count + 1; END When i execute query insert into Bar (ColumnName) values ('SomeValue1'), ('SomeValue2'), ...
-1
votes
1answer
30 views

No INDEX variation seems to speed up the query

I have this query that orders prices based on the customer's NO being a possible pricegroup too (this is nicely cached as an ID in the pricegroups table too tho). SELECT p.`variant_id`, ...
0
votes
0answers
17 views

SQLite text columns

When having a table in SQLite that has a TEXT data type, is there any implication if the length of the contained string differ significantly?
1
vote
1answer
50 views

Sqlite, DB clients & BLOB's: Practical DB Use

I'm looking for an SQLite client that can help me to make practical use of the DB. The plan is to insert mp3's as BLOBs (or perhaps just as references to external files). Each record will also ...
0
votes
2answers
183 views

sqlite group_concat error while executing query

I have table: CREATE TABLE www ( Col_1 VARCHAR, Col_2 VARCHAR ); select count(*) from www; --1496 And I have error: "Error while executing query: aggregate function are not allowed in ...
1
vote
1answer
48 views

Take 5 minute averages from second data

I want to preface this post by saying that I am a complete newbie with SQL and any help will be highly appreciated. For some project I am working with high frequency stock data, below is a small ...
1
vote
0answers
22 views

SQLite vs MemSQL vs other SQLAlchemy compatible in memory databses

What is the recommended in-memory database which connects to SQLAlchemy? Requirements: Connects to SQLAlchemy. Minimal memory usage when empty (it will store <50MB). Easy to work with (e.g. ...
1
vote
2answers
79 views

Bus timetable Database structure

I am creating a database for bus timetable in android app. I have created four tables: stops, route, detail_route and schedule. columns in each table are as follows. Database structure route (id, ...
0
votes
0answers
24 views

Recover data from a corrupted, encrypted SQLite database file

We use the System.Data.SQLite library to use SQLite in .NET applications, which allows the database file to be encrypted with a password. We have a user who is getting an error that the database disk ...
3
votes
1answer
44 views

How to maintain trees and their roots in SQLite

I have a (SQLite) database with a table representing nodes in a forest (set of trees): create table "Node" ( "id" Text primary key, "parent" Text references "Node" ("id") -- parent node ...
1
vote
2answers
64 views

How to optimize a large join to create a WHERE IN

The following sqlite database query takes about 40 seconds on my Core i7. SELECT t.a FROM titles t WHERE t.a IN ( SELECT e.id FROM erpubtbl e JOIN abstract_mesh am ON am.pmid = e.pmid ...
1
vote
0answers
31 views

Would it be good practice to represent MongoDB ObjectId as a String or a Blob type in SQL Lite (RDMS world)?

All: We have a software application with 1) Web-based component 2) Mobile-based component Our 1) Web-based component uses a) MongoDB as the Database b) ASP.NET C# Our 2) Mobile-based component ...
1
vote
0answers
22 views

How to add in carriage-return/line-feeds without starting a new row in a tabbed txt SQLite import

I'm using a tab-delimited .txt file to save my data before importing it into a SQLite database with the SQLite Manager add-on for Firefox. I've tried a couple of ways to add ...
2
votes
1answer
69 views

Finding interval overlap between two tables

I have two tables that have top_depth, bottom_depth, lith_type. One defines the different layers found in a borehole and the other define where samples are extracted in each of the layers. I would ...
0
votes
1answer
37 views

Trigger with multiple inserts based on JSON data

I am using sqlite and have its json1 extension available. I have the following tables (reduced to a minimal example): -- table filled from external source, -- with only a little possible impact on ...
2
votes
2answers
81 views

How to optimize this crazy SQL Query (Specific)

In short, I have this SQLite3 query that uses up 30% of CPU when being run. SELECT s.* ,r.RaagEnglish ,( SELECT w.WriterEnglish FROM Writer w WHERE w.WriterID = ( ...
3
votes
2answers
102 views

SQLite Like clause match whole word only

I have a SQLite database with a table named: minecraft +----+----------------------+ | id | name | +----+----------------------+ | 1 | Pocket Mine MP | | 2 | Open Computers ...
2
votes
1answer
33 views

sqlite3 foreign keys ignored

I am working on a small sqlite3 database for a small simple mailserver. I have created a new sqlite3 database and add executed this to pürepare it for data: BEGIN TRANSACTION; CREATE TABLE ...
2
votes
2answers
2k views

Create database with multiple columns using SQLite in Android Studio

I want to create a database with 3 columns (name of point of interest, longitude and latitude). Since I am completely new to databases I am using an example I found online and try to change it to my ...
2
votes
1answer
1k views

Is it possible to store and query JSON in SQLite?

I need to store JSON objects in a SQLite database, and then do complex queries on it. I did a table like this: +--------------------------------------+ |document | property | string | number| ...
0
votes
1answer
17 views

Matching separate unicode characters as one

I am writing a C# program, and I'm querying a SQLite database. I have multiple diacritical characters (e.g ã, õ, ó, ê) which I need to match in my search. I have the command "SELECT * FROM ...
1
vote
0answers
11k views

how to import .xls file into SQLite database?

I have an issue with importing .xls file into SQLite database. I am working on windows xp and using a SQLite manager for maintain the database. I can import the .csv file to the database by using ...
1
vote
1answer
31 views

Two queries run much longer when combined into one

The first two queries below are very similar. The third is practically the union of the first two: sql> SELECT sigla_partido, SUM(receita_valor) FROM prestacao_conta_eleicao_candidato_2014 ...
0
votes
0answers
29 views

Sync, not import, CSV files with SQLite

In MySQL I have observed that under table options, the storage engine can be configured as a CSV file. This gives me a nice clean csv file in the database directory. This file doesn't come with column ...
2
votes
2answers
67 views

Update function to enter random/unique GUID per row

I am new to SQL and am trying to do the following. i am using SQLite browser to edit the current file I have I do have a SQLite database with around 1500 rows of data that I would like to create a ...
3
votes
0answers
77 views

Is this user-storage database system efficient, effective and secure?

I am using: PHP Version 5.2.17-MIT-BACKPORT-GnuTLS SQLite 2.8.17 I have a database called users, which currently has a table called root. There will be others, once I get all the rows for root ...
0
votes
0answers
291 views

trying to a lag a column in SQLite

Sorry if this is too basic for this forum, but I have had no luck in StackOverflow. I am a newbie to SQL. I am using SQLite. I have a table where rows represent individuals in a point in time. I am ...
0
votes
1answer
42 views

SQLite3 foreign key mismatch

I have following SQLite3 statement inside Qt/C++ class method: bool UeSettings::ueSaveSettings(const QString& address, const QString& port, ...
0
votes
1answer
36 views

Can sqlite dump database schema in a fixed order?

I am using SQLiteStudio 3.0.7 to dump the database schema regularly for versioning purposes and it seems to change the order of the table definitions at random. This wreaks havoc on the diffs as even ...
1
vote
0answers
58 views

how to directly import a csv gzip'ed file into SQlite 3?

I'd like to import a 15GB file comma delimited gzip compressed file into Sqlite 3 without having to use temporary files. I'd like to run a command like: zcat input/surgical_code.csv.gz | tail -n ...
1
vote
1answer
68 views

Square root in SQLite studio

SQLite studio does not support square root function, so I have defined it in function editor as proc SqrtA {num} { set ans [expr {sqrt($num)}] return $ans } with function nameSqrtA and one input ...
0
votes
0answers
42 views

Optimization beyond creating indexes

From the Explain query Output i already created db.execute("CREATE INDEX x1 ON TRAVELDAYS(Day, Value);") db.execute("CREATE INDEX x2 ON TRAINS(TrainDaysUID);") db.execute("CREATE INDEX x3 ON ...
0
votes
1answer
54 views

sqlite database table with 1000's of columns

I am using sqlite3 in an application to conduct an alalysis of distances between sets of points. Distances between these points have been precomputed using dijkstra's algorithim and left me with a ...
0
votes
0answers
58 views

How to get row position in sqlite after sorting?

I have table, UUID | INT | LONG AAA | 1 | 123 BBB | 3 | 241 CCC | 2 | 145 And i sort it by INT value. SELECT * FROM table ORDER BY int_val DESC then i want to get a row from table and ...
1
vote
1answer
59 views

Which database should I look at for analyzing ~30gb, 700M records dataset?

I'm looking at analyzing a kaggle dataset which is pretty normalized, specifically joining, grouping, slicing and dicing the 3 tables patients(2M) <-> diagnosis(700M) <-> doctors(2M). I ...
1
vote
1answer
88 views

SQLite query rows nearest to hour

My question is similar to the one asked here. I'm new to SQL and I'm creating a weather app that stores part of the data locally in a db, so I'm writing the query using the sqlitedatabase java class ...
-1
votes
1answer
33 views

Inserting longer numbers in SQLite

Which data type is suitable to insert larger numbers in SQLite. Can anybody please guide me? I want to insert numbers greater than 10 digits.
3
votes
1answer
96 views

Store different rows type in single table

I'd like to create a DB to store different rows type. It will be kind of event list with time stamp. So I'd like to have an Event table with relations to other tables - each table will be a row type ...
3
votes
1answer
51 views

Finding records not present across 3 tables - Sqlite3

From the diagram provided, what I'm trying to achieve is to get all the Users of a particular workspace that are NOT associated with a task within user_task. user_workspace table contains two FKs: ...
0
votes
1answer
69 views

Having four different tables or having one table with one more field?

I have a website with 4 translation (That is Arabic with 4 different Persian translation), and I had exported each of these translations to different tables. Which one of these ways are faster and ...
3
votes
2answers
67 views

How to use LIKE with subquery?

In a SQLITE3 DB, I have a table A with a column 'word' containing search words that partially match a column in another table B. I'd like to SELECT all rows FROM table B WHERE B.name LIKE ...
2
votes
2answers
69 views

Create Sqlite3 database

I am simply trying to create a database. In my account's home directory, I type in sqlite3 test.db Then once I am in sqlite, I type .quit That should create the database file in the ...
2
votes
1answer
736 views

SQLite disk I/O error (3850)

I can't seem to figure out what is causing the I/O Error: $sqlite3 db.sqlite < data.sql (3850) disk I/O error Error: near line 2: disk I/O error (3850) disk I/O error Error: near line 3: disk ...
1
vote
0answers
36 views

Merge databases with sql only: firefox places and visits

I have two tables in each of two dbs: places: id, url (unique), visits: id, place_id, timestamp, type. I need to merge those databases: There are one main database and one "to-merge". The unique ...