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
34
votes
7answers
50k views

Database design for a school system

This system has to manage students, teachers, staff and grading. This is for production and is not a school assignment. As such, please let me know if I can improve on any aspect. :) My main concern ...
17
votes
1answer
21k views

Myth-busting SQLite3 performance w. pysqlite

I've read most of the posts I could find on optimizing SQLite3 performance, such as: How do I improve the performance of SQLite?, Is it possible to insert multiple rows at a time in an SQLite ...
15
votes
3answers
797 views

Sample game code for applying to a development firm

I am contemplating working with a development firm, and had asked for this piece of sample code. Could you please take a look and let me know if this is a quality piece of work, or if it needs ...
14
votes
3answers
2k views

Find my colleagues

I recently finished the Using Databases with Python course. To figure out whether I really understood what was being taught, I build an application which does roughly the same but uses a different ...
12
votes
4answers
5k views

Inserting robot moves into an SQLite3 database

I'm just wondering if you would consider this to be safe from SQL injection. A peculiarity of my program is I need to dynamically access table names depending on my scenario. This is not for ...
11
votes
3answers
44k views

Using an AsyncTask to populate a ListView in a Fragment From a SQLite table

This is the first time that I have played around with AsyncTask in Android and I wanted to make sure I'm using it correctly. The idea is I'm grabbing all the rows from a table in the database using <...
10
votes
3answers
2k views

Python class to manage a table in SQLite

Module name: database.py Code: ...
10
votes
2answers
2k views

Another way to run reports on a SpiceWorks SQLite database using a linked server in SSMS?

I created a linked server in SSMS so that I could run reports on a SpiceWorks SQLite database. there are a few quirks in the whole system. These simple queries are becoming some of the most ...
9
votes
3answers
498 views

School House Points (Python + SQLite)

I am creating a database to store house points for our school running events. I would like to be able to tally all the points for the houses and it is working fine, however, I think it may be a bit ...
9
votes
2answers
155 views

FizzBuzz in SQLite 2

This query performs a FizzBuzz in SQLite 2.8.17 without creating any tables or sprocs. First attempt: ...
8
votes
2answers
2k views

Fetch live data from SQLite

I'm writing a small Python script which needs to fetch live data from a database (I'm using SQLite 3 for now). I may reuse this function for a lot of scripts. Can this code be made better? ...
8
votes
1answer
813 views

Generic asynchronous SQLite search builder

I am writing a database manager that reads and writes to a local SQLite database on a mobile device. It works pretty well for the most part, but read access is somewhat slow - it takes about 2-5 ...
8
votes
1answer
26k views

Optimize JSON insertion to SQLite (insert … on duplicate key ignore)

In current task, I'm refactoring the code of converting JSON file into SQLite database on Android device. Code compliant with Java 6. As a benchmark, grabbing the code from remote server takes ...
7
votes
4answers
430 views

Storing .h files in SQLite using SQLJet

I’m trying to learn as much as I can on my own by reading lots of examples, documentations, and asking here. I would like to improve my style to write efficient code and adhere to Java standards. In ...
7
votes
1answer
879 views

Android “Search” Activity and corresponding XML

Below is an Android Activity and corresponding XML layout. The function of the class is to search an ...
7
votes
2answers
5k views

SQLite Helper Class in C#

Here is a SQLite Helper Class I created. Any input appreciated, including security and simplification. ...
7
votes
2answers
348 views

Terrain height map generator

I wrote a Perl script that implements the algorithm described in this article to generate terrain height maps. The idea is to raise a random hill \$i\$ of size \$r_i\$ centered at point \$(x_i, y_i)\$...
7
votes
1answer
221 views

BananaQuery - Android one-line query

I created this library just for fun. Since I was a bit tired to write 10 lines of code to execute a simple select query in Android, I created a way make it simple. It's not so advanced and some ...
7
votes
1answer
5k views

Optimizing SQLite SELECT Performance

I need to read Databases which contain 44-50 Tables, with around 5 Million entries in Total (~ 100k entries per Table). The Data consists of Positional Tracking Data in Sports (Players,Refs and the ...
7
votes
1answer
242 views

Importing XML dump of Stack Overflow questions and answers into SQLite3

I have a 60gb+ XML file and, as you can see, I am using a Python script to extract the data and execute 'INSERT' statements to update my database. Being that the file is so large, will I run into ...
7
votes
1answer
2k views

Efficiently adding huge amounts of data from CSV files into an SQLite DB in Java

I'm trying to parse values from a CSV file to a SQLite DB, however the file is quite large (~2,500,000 lines). I ran my program for a few hours, printing where it was up to, but by my calculation, the ...
6
votes
2answers
727 views

Adding to an index of authors

I'm new to SQLite but have programmed in BASIC (and other languages) for pushing 50 years. Given the sample code extract, please offer suggestions for improvement: ...
6
votes
2answers
6k views

Saving and Loading data with SQLite

I'm in the process of learning SQLite in C# and I've come up with some generic methods for finding and updating data. I would appreciate any pointers with the design of my methods and/or my SQL syntax....
6
votes
3answers
6k views

Create SQLite backups

I have this script for creating SQLite backups, and I was wondering whether you'd have any suggestions on how to improve this. I was thinking that maybe it should create the backup ...
6
votes
2answers
178 views

Database data insertion

...
6
votes
1answer
2k views

Multiple Choice Guessing Game

I've built an app for members of an organization I'm in--the app shows the picture of a member with four multiple choice buttons, and the user then tries to guess the member's name. Pretty simple, ...
6
votes
3answers
1k views

Optimization for SQLite result set parsing

I am retrieving information from an SQLite database that gives me back around 20 million rows that I need to process. This information is then transformed into a dict of lists which I need to use. I ...
6
votes
2answers
775 views

Loading records from an XML file into SQLite

I have a script and I need to optimize it to reduce the execution time of this, currently, 6000 lines takes 1 minute and 38 seconds, I would like to reduce the time to take much less and I do not know ...
6
votes
1answer
451 views

Using SQL to reorder items in a list view - is this efficient?

I'm writing an application for work that requires me to process a list of transactions. The list is small (5 records at the most) and I'm required to display that data in an android ...
6
votes
1answer
1k views

Expense Tracker for keeping track of payment information

This system is a expense tracker. It allows ordinary people to track expenses, like bills , car notes, and keep up with the payments they make. I had this idea after my father and mother began to mess ...
6
votes
1answer
203 views

Car leasing system - add lease to database

I just came back to programming and decided to create a car leasing system (GitHub page here.) to teach myself about databases, gui programming and web development. And I would like some input on what ...
6
votes
1answer
809 views

Android ListAdapter design advice

I want to write an Android ListAdapter to serve data from a database that look like this: ...
6
votes
1answer
467 views

Database interaction logic

I have a database-intensive app, almost every activity requires access to the database, both reading and writing. I had a lot of problems with separate threads and activities on the stack closing ...
6
votes
0answers
3k views

Real-time bitcoin data feed and storage using websocket framework

I'm trying to create data feed script for real time bitcoin data for OkCoin exchange using their websocket API (documentation) and a database manager for storing. There are two channels I am ...
5
votes
2answers
452 views

Searching for a word in a list of tuple extracted from a db via SQL

Python 3.6 and Sqlite3. I have a database with something like 300K entries, each entry has several fields (date, username, etc) and a "text" one. I have a list of 200 words and for each word i have ...
5
votes
2answers
1k views

Flagging employees whose spending is close to the budgeted amount

I am working with an SQLite database. Is this code written the best way it can be and correct? The code: Selects from the db adding a column for the percentage difference between two columns Loops ...
5
votes
2answers
446 views

Python update SQLite DB Values

At the moment I try to get used to SQLite and Python. I started with insert, select and so on. But now i want to get a bit further. Now I have a DB with 200 rows for testing and in want to update two ...
5
votes
3answers
3k views

Schema design for user profile management

Is this a good design? I would like to create a view on user table to get a list of users based on filtered conditions. Please suggest ways of improving this schema design. A view example that I ...
5
votes
2answers
1k views

Benchmarking our LAMP servers with this php script

I've written a small script to benchmark our LAMP hosted servers that assess the performance based on three factors: Disk I/O Database I/O (mysql) Database I/O (sqlite) The logic is as follows: get ...
5
votes
2answers
8k views

Check existence of a row then update a column

not too experienced with SQL, wondering if I can make this better... I am trying to check if a row exists and then add one to the frequency column if it does, if it does not exist it should return ...
5
votes
2answers
469 views

OOP bank account program in Python 3

Python beginner here. Building an OOP bank account program with SQLite and starting to struggle a bit with its design. From a design standpoint I have a file (bank) which calls ATM. ATM simulates an ...
5
votes
1answer
4k views

Android SQLite Database management

I'd like some opinions about my approach at using SQLite databases in android. Everything seems to work very well, but there may be something wrong that I hadn't noticed. I don't like working with ...
5
votes
1answer
716 views

Extracting a conversation from a Skype sqlite database

I've made this code to extract a conversation from a Skype database file with a certain user ID, all this being specified as a command line argument. Since Skype uses SQLite to store the messages I ...
5
votes
1answer
6k views

Unit of Work with Generic Repository Pattern MVVM

I have been writing the application. I meant to implement a repository pattern with Unit of Work. Is it correctly done? Can you make a code review? I use SQLite ...
5
votes
1answer
9k views

A class to create and modify SQLite3 databases with a terminal

I would like feedback on the class I've written. The purpose is to dynamically create and interact with SQLite3 databases, accepting lists of complete or incomplete statements. ...
5
votes
1answer
177 views

Merging trips to the same location with overlapping dates

I have a SQLite database that only contains the holidays for 1 user. I have a new Trip object (newTrip) that has a ...
5
votes
1answer
87 views

SQLite search disregarding spaces and Pinyin tones

I have a column where, pretty much, each entry has numbers (specifically #1-4) and spaces (' '). I wanted to make a query that could avoid having to know these numbers and spaces. ...
5
votes
1answer
2k views

Nested SQLite transactions in jQuery

I'm using Cordova with jQuery and jQuery Mobile to develop a hybrid app. In this app I need to save data that I get from a server. The data is a ...
5
votes
1answer
2k views

Persistent key value store for Python using SQLite3

This is a module to implement a key value store in Python using SQLite3. Originally written to allow sharing of configuration among multiple threads that are already sharing a SQLite3 database, I have ...
5
votes
1answer
2k views

SQLite Database inserting + Unit tests in Java

Genereal Introduction This is my first project which involves a Database which involves testing (especially unit testing) where the quality is really important for me. The long term aim is to ...