Skip to content
Advertisement

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 the data

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 associated with the value itself, not with its container. taken from here https://www.sqlite.org/datatype3.html

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 json array. To make matters a bit tricky, the attributes

How to solve deadlock when inserting rows in sql many-to-many relationship with minimum cardinality one restriction?

This year I’ve been learning about relational databases and how to design them. In order to strenghten my knowledge, I’m trying to design and implement a database using Python and sqlite3. The database is about a textile company, and, among other thigs, they want to keep information about the following: Materials they use to make their products Shops where they

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

Advertisement