Questions tagged [database]
A database is any organized collection of data organized to provide efficient retrieval.
547
questions
0
votes
1
answer
43
views
DB Layer of a project management CLI
I am (re)writing a project management CLI and want to put it on a solid foundation concerning the database connections and testing. My focus was to build a DB class which is easy to test and could be ...
11
votes
4
answers
2k
views
Simple Key Value Database using C
I was recently doing an assignment for a job interview, which asked to create a simple key value database with 4 command line operations:
create key value: Adds a key value pair/updates an existing ...
0
votes
1
answer
67
views
PHP login codes suggestions
Now i have a fully functional PHP codes for login and registeration i was wondering if anyone could offer improvements to the code
The code:
Config.php:
...
1
vote
1
answer
138
views
Follow up to Validation Script in PHP
So I've implemented the suggestions in Original question
And now my code looks like this:
...
1
vote
1
answer
100
views
PHP Validation script
The code below is modified slightly from the code in this previous post.
I believe the code below could be improved and more secured but i don't know how so someone please show me how an improved ...
0
votes
1
answer
186
views
SQL & PHP login method
My code is working however it seems to be using old outdated php version so less secure and I'm still new to programming so I'd be more than thankful if someone shows me how an improved updated and ...
4
votes
0
answers
49
views
API for operators and alerts
Note: The important chunks of code are pasted in the question but the larger representation of the app is available on GitHub.
Some time ago I was tasked to create a simple FastAPI app. I did manage ...
0
votes
0
answers
28
views
4
votes
2
answers
96
views
an algorithm that chooses the best games on steam
The code below will go through an excel spread sheet taken from kaggle, is named "SteamGames (71k games)" and the creator is "MEXWELL".
inside the ...
4
votes
1
answer
102
views
Storing icons in Room Database
I want to store some 512x512 icons for my Android app in a Room database. This is so each item in a list can have all the text data along with the image data stored in a single record.
The answers to ...
1
vote
0
answers
62
views
Appending data from files listed in a file
I am working on a project that requires me to write VBA code which, upon a button press, loads the data from certain files in a given directory.
In my testing, I was able to load the data from 1100 ...
0
votes
1
answer
87
views
Is there any sugestions how to make this script faster if its possible?
I wrote a script that uses an uploaded excel file to import data to the database. It checks for the image first if it can be downloaded without any error then insert the rest of the data. With ten or ...
0
votes
0
answers
126
views
Looking for best practices/design patterns when working with SqlAlchemy ORM
I am new to python and sqlalchemy and looking for help to cleanup below code or follow a popular design pattern when working with database.
Below sample code is for the use case "User clicks on ...
1
vote
1
answer
87
views
Laravel Eager Loading tickets from DB
So I have the following relationship in my Model:
Events Model:
...
1
vote
0
answers
25
views
Database recording users' consent to be subject to commands of other users
I am adding a database to my application that fulfils these requirements:
There is a set of users and a set of commands.
Each user can consent to any number of other users to have commands done on ...
2
votes
1
answer
60
views
Helper functions to get, set and remove from Firefox browser storage. Also, to get, push and remove from lists stored in the database
I am making a plugin for Firefox, this is (more or less) my first time working with JavaScript. Is this a reasonable design for working with both values and lists in a database?
...
0
votes
0
answers
40
views
Synchronized insertion to InlfuxDb using Python
I am connecting to various topics of the exchange websocket to fetch the data into the callback function, where it will insert to the InfluxDb, however, I am afriad the way I do below has low ...
2
votes
1
answer
399
views
How to structure in handling websocket and inserting data to databse in Python
I connected to the websocket, and the data response in the callback function handle_message. I wish to insert all the data to influxdb using ...
4
votes
0
answers
39
views
Use XYZ data to create cross sectional profiles across beach terrain, using OS Grid
This might be a slightly long question, but I've recently been doing a bit of R&D on the data processing workflows within the company that I work at and it would be great to see if there are any ...
0
votes
1
answer
153
views
Efficient way to read files python - 10 folders with 100k txt files in each one
i am looking for an efficient way to read and append texts of .txt files to a dataframe. I currently have 10 folders with 100k documents each.
What i specifically need to do is:
getting the names of ...
2
votes
1
answer
80
views
Database buffer class
I designed the following DataBaseBuffer class, to be used by different threads that generate queries and need to send them to the database. It was inspired by ...
0
votes
0
answers
46
views
Can this database design be optimized? Two joins on large dataset
Given a table of video IDs ordered by review score, I'd like to return videos the user hasn't seen yet and aren't from a blocked author.
Considerations
Writes can be slow but reads should be fast to ...
4
votes
1
answer
206
views
Postgres DB design
I need to develop a database to handle muting people in an online community. The DB needs to keep track of the currently muted people. When somebody gets unmuted, that entry gets moved to an archive ...
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 ...
1
vote
1
answer
115
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 ...
0
votes
1
answer
64
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
174
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
119
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 ...
3
votes
1
answer
372
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:
<...
0
votes
0
answers
32
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 ...
5
votes
3
answers
192
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 ...
2
votes
1
answer
486
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. ...
1
vote
0
answers
45
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
182
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
79
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
93
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-...
0
votes
2
answers
183
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&...
0
votes
1
answer
234
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 ...
1
vote
0
answers
29
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
125
views
Lua: print table at specific table depth
This is my custom function:
...
4
votes
1
answer
127
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
224
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 ...
0
votes
1
answer
58
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 ...
1
vote
1
answer
121
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
162
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 ...
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
...
2
votes
0
answers
325
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/...
0
votes
0
answers
53
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 ...
2
votes
1
answer
317
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 ...
0
votes
1
answer
67
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 ...