2022 Developer Survey is open! Take survey.

Questions tagged [database]

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

Filter by
Sorted by
Tagged with
-3 votes
1 answer
52 views

Database design for a recommendation system [closed]

I am new to databases and I am trying to design a database for a project that I am currently working on, so I wanted to know if this design is good or not. knowing that the database should serve a ...
user avatar
  • 35
-2 votes
1 answer
49 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 ...
user avatar
3 votes
1 answer
45 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 ...
user avatar
3 votes
1 answer
51 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-...
user avatar
  • 321
0 votes
0 answers
34 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 ...
user avatar
  • 149
0 votes
2 answers
153 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&...
user avatar
0 votes
1 answer
97 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 ...
user avatar
1 vote
0 answers
14 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 ...
user avatar
0 votes
0 answers
29 views

Lua: print table at specific table depth

This is my custom function: ...
user avatar
2 votes
0 answers
46 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 ...
user avatar
1 vote
1 answer
95 views

Optimization of laravel pivot table relationship

I have a pivot table called invite_riskarea which is designed as follows: This table handle the permissions that have a specific user (through an invite id) to ...
user avatar
  • 127
0 votes
1 answer
42 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 ...
user avatar
0 votes
1 answer
49 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 ...
user avatar
4 votes
2 answers
126 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 ...
user avatar
  • 223
0 votes
0 answers
42 views

Golang scan joined many to many tables

I have the following structs: ...
user avatar
  • 193
10 votes
6 answers
2k 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 ...
user avatar
  • 119
2 votes
0 answers
83 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/...
user avatar
  • 375
0 votes
0 answers
39 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 ...
user avatar
0 votes
0 answers
49 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 ...
user avatar
  • 165
2 votes
1 answer
98 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 ...
user avatar
  • 123
0 votes
1 answer
52 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 ...
user avatar
0 votes
1 answer
38 views

Ruby on Rails - Optimizing a query for a huge database

My application is an insight/statistic application that contains a lot of data. I don't need to do any joins as everything is in one table, and still, when the ...
user avatar
  • 113
1 vote
1 answer
79 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 ...
user avatar
  • 35
1 vote
1 answer
162 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 ...
user avatar
7 votes
2 answers
122 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 ...
user avatar
7 votes
2 answers
329 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 ...
user avatar
  • 875
2 votes
0 answers
61 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 ...
user avatar
  • 375
1 vote
1 answer
60 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 ...
user avatar
  • 375
1 vote
0 answers
74 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 ...
user avatar
  • 375
3 votes
1 answer
134 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 ...
user avatar
  • 375
1 vote
2 answers
53 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 ...
user avatar
  • 107
3 votes
1 answer
262 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 ...
user avatar
1 vote
1 answer
76 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....
user avatar
  • 321
3 votes
1 answer
296 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 ...
user avatar
1 vote
2 answers
99 views

Database dynamic query

I am working with C#, Npgsql, EF Core and Postgres. I ...
user avatar
  • 193
0 votes
4 answers
115 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 ...
user avatar
  • 177
1 vote
1 answer
69 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,...
user avatar
  • 177
-1 votes
1 answer
59 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 ...
user avatar
  • 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) ...
user avatar
1 vote
0 answers
24 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 ...
user avatar
2 votes
2 answers
67 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 ...
user avatar
  • 121
1 vote
0 answers
13 views

Parse Back4App database as a master database change log rather than actual database- thoughts on this design principle?

first post here. I'm looking for some general input as to the correctness of what I'm trying to do here. Is this a good idea, bad idea, what could be plus points or negative aspects to this design? If ...
user avatar
  • 111
3 votes
1 answer
528 views

Testing DAO Delete User

I have several Dao classes, including a UserDao, below. The DAOs have many methods, but I'm focussing on deleteUser: ...
user avatar
1 vote
1 answer
57 views

Wanted to eliminate the repetition in the classes created to reduce duplication

Can some one help me on how to eliminate repetition to reduce duplication score on the below classes created in the code ...
user avatar
0 votes
0 answers
43 views

Is my implementation of connection scope for Dao right?I have Dao and Service where I implement connection and transaction scope

I have DaoFactory that returns DaoImpl and can make connection/transation scope ...
user avatar
2 votes
1 answer
73 views

Object relational mapper - optimize in memory data representation and code improvements

An Object-relational mapper built using php. This was done for educational purposes, and curious to know what kind of improvement has to be done to use in production. Please refer to the complete ...
user avatar
0 votes
0 answers
61 views

Extract fields from email and store into a Django database

This code was written to capture extracted text from emails and store those details in a database. I would like to reduce the amount of code, improve simplicity and reduce the duplication of my code. ...
user avatar
3 votes
0 answers
116 views

How can I filter and sort LinkedList faster and more effective?I have list of orders that should be processed

I have method that fetches all orders from Database and filtering, sorting that data(I know better to do It by specific query to Database but I dont know how). I have Order entity that has following <...
user avatar
1 vote
0 answers
18 views

processing webhook request coming from a 3rd party application

I need some help to evaluate whether I am doing it right. The scenario is, a 3rd party application is sending a webhook request after a successful payment but the problem is that sometimes this ...
user avatar
2 votes
1 answer
177 views

Simplify a complex KQL Query

The situation is, I have two fields in a database (or that can be derived) - when the message was received (Received, of type ...
user avatar

1
2 3 4 5
11