Questions tagged [database]

A database is any organized collection of data organized to provide efficient retrieval.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
18 views

python turning aggregations into weighted aggregations [closed]

...
  • 9
8 votes
2 answers
1k views

High traffic website that shows users subscription status

I was in two minds as whether to post this question on stackoverflow or dba stackexchange but because I am asking for review, I thought of posting here. I am new to Python and looking for feedback on ...
  • 183
1 vote
1 answer
75 views

Movie library system

I want to implement a crud movie library system and also some filtering capabilities. Since it is so big, I have added the link to the code. https://github.com/neslihanbozer/Movie-Library. I am aware ...
  • 11
0 votes
1 answer
47 views

EF Core code-first "many-to-many-to-many" (Books with many credits with many people)

Let's say you have a book. A book can have an author, an editor, a proof reader, or several other credits. Which credits are available should be dynamic (someone might not want to have the "proof ...
3 votes
1 answer
170 views

Summing categories of financial records per month in a query

My program is working properly but I'm unconfortable with code repetition. ...
2 votes
1 answer
107 views

function to group data by parent branches

I wrote this function to take database output like from PDO's fetchAll(PDO::FETCH_ASSOC) and turn it into a tree. For small datasets it works well. However, when ...
  • 123
3 votes
1 answer
282 views

Why are my read speeds so bad using sqlite?

I know very little about databases and even less about how to optimize them, but I have a problem which calls for a database so here I am... I created a sqlite3 database using the following script: <...
  • 896
0 votes
0 answers
28 views

How to create a good database model in my task (I have a few tables for now)

I create a smaller app that has to be used for money transactions where it focuses on favor and expense from bank accounts (later I will expand other tables for admin, workers costs, credit ...
  • 11
5 votes
3 answers
121 views

DB Class extending PDO w/ other useful functions

I have this DB class that extends PDO, that also has useful functions for certain tasks; I was wondering how well it's coded, and if so, what I could maybe improve on. I tried commenting in ...
  • 153
2 votes
1 answer
73 views

A database trait in Rust. How can I make all these generic parameters easier to use?

I am trying to hide the implementation details of accessing a Postgres database. To do this, I want to create "database" and "transaction" traits for use in a repository struct. ...
  • 203
1 vote
0 answers
39 views

UPDATE on Newspaper Bill Calculator CLI with Python (3 of 3, Database)

Code is posted after explanation. Due to the size of the project, this is being posted in three separate posts. This also ensures each post is more focused. Post 1 of 3, Core: UPDATE 1 on Newspaper ...
-2 votes
1 answer
87 views

Insert row into database using static or non-static method [closed]

I would like to know if there are any benefits of one of the following 2 methods which insert an object into a database The first function calls the Model method statically, creating a new instance of ...
3 votes
1 answer
67 views

Newspaper Bill Calculator CLI with Python (3 of 3, Database)

Code is posted after explanation. Due to the size of the project, this is being posted in three separate posts. This also ensures each post is more focused. Post 1 of 3, Core: Newspaper Bill ...
3 votes
1 answer
56 views

Acupuncture database builder

The following code builds a rudimentary acupuncture database by collecting data from the web. I would like to hear suggestions about improvements to the database structure, code organization, web-...
  • 321
0 votes
0 answers
36 views

Download Results from API and compare with local database

I'm trying to improve this function I just wrote to be more efficient and readable. It's supposed to Download the results from the API. The results can be from 1-300ish and the API sends back all the ...
  • 149
0 votes
2 answers
176 views

Version 2: Display visitor's number on your web page (changed code after getting answer for first version)

Version 2: Display visitor's number on your web page (changed code after getting answer for first version). The first version is here: Display visitor's number on your web page The "visitors&...
's user avatar
0 votes
1 answer
119 views

Display visitor's number on your web page

Display visitor's number on your web page. The "visitors" table has only one column (visitor_count) and only one row. The column's initial value is 0. I know goto should not be used but then ...
's user avatar
1 vote
0 answers
25 views

Django data migration - worked, but far from performant

Background: I am learning web dev and decided on the Django framework as an excuse to learn Python at the same time. (Background is stats with lots of R and ...
0 votes
0 answers
42 views

Lua: print table at specific table depth

This is my custom function: ...
4 votes
1 answer
69 views

Implementing a data extraction pipeline with Bash

I wrote the following scripts to extract data from BigQuery and InfluxDB using the bigquery cli and the influx cli. The code works as expected. I included all files for completeness, but I'm primarily ...
2 votes
1 answer
116 views

Optimization of laravel pivot table relationship

I have a pivot table called invite_riskarea which is designed as follows: This table stores the permissions that have a specific user (through an invite id) to ...
  • 137
0 votes
1 answer
44 views

Search controller logic to search through models and manufacturers

I have the following Laravel controller that searches through two models - Manufacturer and SearchTerm (which contains models of manufacturers, synonyms of models as well as common misspellings) using ...
0 votes
1 answer
68 views

Creating database and two tables linked by foreign key

These commands do what I want, but I'm trying to find out the best approach for this. My main areas of concern are: error handling and disposal of resources. In regards to error handling, I'm catching ...
4 votes
2 answers
131 views

Historical database design for school system

Context We are a multi-academy trust designing a database system (more of a warehousing solution) to aggregate educational data from our 13 schools into a single source. The data will be mostly ...
  • 223
0 votes
0 answers
62 views

Golang scan joined many to many tables

I have the following structs: ...
  • 193
10 votes
6 answers
3k views

Console Library System in C++

I'm a beginner and came up with this simple project in C++. Any feedback would be very much appreciated. GitHub Repo Note: I'm using a file called "db.txt" as a database. main.cpp ...
  • 119
2 votes
0 answers
126 views

SQLite C/ADO VBA library with reflection

SQLite C/ADO VBA library with reflection The SQLiteCAdo library is a VBA middleware facilitating access to SQLite databases. Its two subpackages provide alternative connectivity options: via ADODB/...
  • 395
0 votes
0 answers
44 views

Create trigger that updates Table3 from an insert into Table1 that multiplied by a value in Table 2 in MySQL

I know this is probably more complicated than it needs to be, however, I would really appreciate some help. I'm trying to create a trigger in MySQL that will update the value in the Costs table when a ...
0 votes
0 answers
66 views

Why is this MongoDB query so slow in comparison to python + in general?

There are 1.3M documents in my collection (5.0 and hosted directly on mongodb.com) and there is an index on "topic" and a combined index on "topic" and another field. However the ...
  • 165
2 votes
1 answer
133 views

Get data from binance api and save to ClickHouse DB

I did the following Created DB and table in prepate_table function Extracted data from binance in GetHistoricalData function Saved the data to DB My code works fine but I want to optimize my code ...
  • 123
0 votes
1 answer
53 views

Properly implementing HasChanges pattern for model

There is the following method that should get record from the database, apply new data, and if at least one value has been changed, update database and send event We don't use EntityFramework, it uses ...
1 vote
1 answer
82 views

Cleaning Kotlin method which returns the document name after the id

I'm just getting to know the possibilities of Kotlin and mongoDB. I am writing a method that returns the name of the street after the ID. Everything works, but I find it quite sloppy. Empty String ...
  • 35
1 vote
1 answer
180 views

Database schema for discussion forum scraping

I'm scraping posts from various discussion forums and storing those posts, along with some metadata, into a relational database (SQL). My actual use case is a bit more complex, but I think I can give ...
7 votes
2 answers
133 views

Connect to MYSQL database in PHP with prepared statements

I have recently learned about using PDO. I created a db class which could handle common actions like create, update, delete and select. Is this method a correct way to connect to the database using ...
7 votes
2 answers
400 views

A Hit Counter For AWS Python Lambda powered with DynamoDB

I'm learning how to use DynamoDB and various AWS services, so I decided to write a simple hit counter application for my education of how to use DynamoDB. This application deduplicates hits from the ...
  • 875
2 votes
0 answers
68 views

Extending the SecureADODB library

SecureADODB is a very instructive VBA OOP demo. I have played with SecureADODB for a while and plan to integrate it into the prototype of my database manager application. In my previous post, I showed ...
  • 395
1 vote
1 answer
63 views

ContactEditor - Excel VBA db app: Storage Library and MVP

In the previous post, I presented my Storage Library. Here, I would like to focus on the integration of the library with the MVP component. Functional class mapping First of all, the figure shows a ...
  • 395
1 vote
0 answers
80 views

ContactEditor - Excel VBA db app: Storage Library

ContactEditor uses Excel VBA as a prototyping platform for a personal information manager combining the "Model, View, Presenter" (MVP) pattern and a persistent storage manager. Fig. 1. Data ...
  • 395
3 votes
1 answer
178 views

VBA introspection library for SQLite

SQLiteDB VBA Library is a set of VBA helper functions for the SQLite engine. The primary motivation behind this project is to provide convenient access to extended introspection features. Because of ...
  • 395
1 vote
2 answers
57 views

Querying and rendering an HTML table of ISP performance statistics

I have multiples measurements and I want to render it into tables like this Measurements Operator browsings FTP DL FTP UL Location Event Date Operator avg min max avg min max avg min max Verizon ...
  • 107
3 votes
1 answer
265 views

Reducing the amount of duplicated code (python) - cricket matches [closed]

I'm a beginner and self taught and just want to see if there are neater ways of doing what I am doing, or whether there are bits of code that are poorly written. I think Lines 100-204 are the most ...
1 vote
1 answer
78 views

Data storage and processing in Python

I have a piece of code that downloads acupuncture data from Wikipedia and consolidates it into an acupoint, meridian and extraordinary meridian dictionary stored as .pkl files in the working directory....
  • 321
3 votes
1 answer
487 views

Data API with Influx-DB and FastAPI

I'm fairly new to time series databases in general and Influx in particular. My objective is to build a simple and general-use API that will allow me to write and read data from an Influx Database. I ...
1 vote
2 answers
129 views

Database dynamic query

I am working with C#, Npgsql, EF Core and Postgres. I ...
  • 193
0 votes
4 answers
133 views

Appointment database - design II

I want to create a database which gives an admin user ability to create schedule for other users to book from. This is second edition of this database schema. I would like to know if there are any ...
  • 179
1 vote
1 answer
89 views

Appointment database design - Schema

How would you go about designing a database for service appointment? Here is what i came up with so far. Let me know if there is a better way. Basically the admin should be able to build services list,...
  • 179
-1 votes
1 answer
61 views

IF SELECT statement will break SQL ACID Compliance? [closed]

My QA told me that I should not use IF SELECT before doing an UPDATE statement because it will breaks the atomicity of a ...
  • 141
2 votes
0 answers
74 views

Compute damages and savings for motor insurance claims

I am working on some claims data, where I have features such as The descriptions of the columns are: (A) the year of claim, (B) who's the insuring company (C) whether the vehicle is driven, (D) ...
1 vote
0 answers
25 views

Scalable and Optimised group chat system

I have a simple chat system. I have built this to scale so I would appreciate optimisation tips or alternative table structures too. This does not include the pub/ sub queue system. Users ...
2 votes
2 answers
72 views

A simple write-once-read-many indexed based database

I started writing a cyrptocoin from scratch, and then got sidetracked writing the database portion which I eventually turned it into its own project. Data is written to the database and then retrieved ...
  • 121

1
2 3 4 5
11