Skip to content

Tag: python

fetchall() not working even with values in database

I am working in python with sqlite3 and I am trying to create a database. I created a table: c.execute(“CREATE TABLE persoane (nume text, varsta integer, salariu integer)”) Then I added the values into the table: c.execute(“INSERT INTO persoane VALUES(‘David’, 16, 1000)”) W…

Exploding the group by cel in individual cases

I am trying to convert the following table (fictitious): Person year price Tom 2019 100 Klaas 2020 100 John 2019 120 John 2020 120 Klaas 2020 150 Klaas 2020 150 John 2020 150 into: Person year price price price Tom 2019 100 NaN NaN Klaas 2020 100 150 150 John 2019 120 NaN NaN John 2020 120 150 NaN In

SQLite update data from one table to another

I’m trying to insert some data from one SQLite database to another. I have 2 tables called “members” and “attendance.” What’s supposed to happen is, everytime a new member is added into the member table (or removed), the name and ID of the specific member should also be add…

How to set up sqlite to be local server (on lan)

Current situation : I have one GUI program(written by python) which using sqlite data stored on my computer. Wishlist: I would like to have one server computer to locate sqlite data (DATA A1) (CRUD operation needed) and ten more client computer using GUI program(written by python) which connect with the sqlit…

SQLite Insert Distinct from 2 variables

I have a SQLite DB with a table with the following kind of data: What I need to do is take columns B and C, create a single unduplicated list and autoincrement the primary key for the unique values. It needs to check to make sure an entry is not already existing – so the second table would be: I

while Convert sql query to json getting wrong output

I am getting wrong output Output should be: Answer The problem is with your nested loops. You actually want to parallely iterate both lists. The lists themselves are quite complex due to the nesting of lists and tuples. That’s why you may loose track here. You could try simplifying the lists/objects if …