Skip to content

Tag: sqlite

Sqlite3 in Python not fetching data

I have a sqlite3 DB with a few rows in it. When I try to fetch data from it in Python, fetchall returns an empty list. The data is being inserted in a different part of the project fine. I verified this by opening the DB in “DB Browser for SQLite” and running the following command. This returned t…

Making sense of date-time and datatypes in SQLite

I’m learning SQL and SQLite at the moment, and from what I understand, SQLite doesn’t support a datetime datatype. However, when I run the command PRAGMA table_info(Orders); it’s showing one column as being of type datetime. I’ve read that In SQLite, the datatype of a value is associat…

How to Query JSON Within A Database

I would like to query information from databases that were created in this format: index label key data 1 sneaker UPC {“size”: “value”, “color”: “value”, “location”: “shelf2”} 2 location shelf2 {“height”: “value”, “row”: “value”, “column”: “value”} Where a large portion of the data is in one cell stored in a …

SQLite – Select posts based on tags

I have two tables in my database: posts, which contains post id and other informations, and tags. In tags, there is a column post_id and a column tag. My idea is to store each tag in a separate row. For instance, a post with id 1 and tags foo, bar and eggs would be stored in tags as Which is