Questions tagged [database]

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

Filter by
Sorted by
Tagged with
2
votes
2answers
182 views

Class to provide access to various database sources

I'm struggling to understand how to implement principles of encapsulation, inheritance and polymorphism to break this code into logical parts. My background is in VBS/Classic ASP and database ...
3
votes
2answers
1k views

Entity Framework Lazy loading performance comparison

The following code takes about 20 seconds to run with about 200,000 records in the TaskLogs table: ...
3
votes
1answer
107 views

MySQL request in Python

In my code I have three requests to a MySQL database: ...
2
votes
0answers
598 views

Query your MySQL server for table size by row count and physical size by database

After writing a similar SQL procedure to check my table sizes several times, I wrote this stored procedure to check my MySQL database's table size. It will show you the table sizes and row count ...
1
vote
0answers
47 views

Analyze the image of the database relation and create the original database

I've sorted out an image relational database, and created its original database in phpmyadmin (I use XAMPP). Here is a picture of the database relation: This is a database image I created myself in ...
1
vote
1answer
217 views

Async database helper function in TypeScript

I have made an async function in TypeScript that responds to Events and returns an object with methods that return a promise. I ...
1
vote
1answer
23 views

Classifying counts of repeat visits per user for a website

I am trying to get number of times (or sessions) a user re-visited the website. What I'm trying to find out- Get the total number of users, number of sessions in the last 30days. I need to a pie ...
2
votes
1answer
495 views

Populate SQL tables with test data

I have some unit-tests that must be executed against a real database. This requires populating the database with test-data. In order to simplify this process I created the ...
2
votes
2answers
304 views

Backup document root and MySQL in Linux

I wrote this program to backup everything in document root and the MySQL database in Linux environments. It is aimed for Debian/Ubuntu environments to say the least. ...
2
votes
0answers
177 views

EF mapping complex type to JSON in DB

I am trying to map a complex type to Json and store the info as Json in the DB using EF6 Code First. Here's what I have for now: The complex type ...
1
vote
0answers
80 views

Switch MongoDB databases dynamically per user

I'm doing a POS (point of sale) as Saas with React in the frontend, NodeJs in backend (API Rest) and MongoDB as the database. I've finished a basic program and now I want any registered user to have ...
1
vote
2answers
427 views

PHP PDO statements

I wrote a piece of code. and to be honest it seems a bit messy so I would like some opinions on it, and if I can make it cleaner. Or if there are better ways to do it: ...
1
vote
1answer
3k views

Multi-client TCP server with a thread for each client and DB connection pool

I'm creating a Qt TCP (with SSL) server to which multiple clients should connect and use the DB, and this is the main task. So, I think I can use this architecture: each client has its own thread, and ...
1
vote
0answers
51 views

Custom indexeddb modules while trying to maintain the functional paradigm as much as possible

I'm a Web Development student, and I just started learning indexeddb a little while ago. At present my teacher hasn't taught us Promises, and I'm not really sure he plans to. So, I took the initiative ...
2
votes
0answers
27 views

Store history data using customization features of a profesionnal software

Context My company uses a system that has access to the state of different items in the plant. This software can be customized, by executing a single VBScript function, at a given interval. The ...
2
votes
1answer
65 views

Small database with a user defined size

This is a program that accepts user input for a database size - number of rows and data size. After creating the database the user should be able to read, add, remove and list entries and the file ...
1
vote
1answer
54 views

Adding words to the database

I created a dictionary web app for my language in PHP. At the beginning of the project I wanted to create not a dictionary but a simple web application that would correct the words that were entered ...
1
vote
0answers
3k views

MySQL structure and normalization for real estate agency database

What I'm trying to achieve is to create a site for a real estate agency, which has the responsibility to sell or rent someone else's property. I'm not sure how far from correct what I've created is. I ...
3
votes
0answers
5k views

Django 'Like' functionality for a post

I am implementing a like button for posts (Using a clustom Like model and the pre-defined User model from django.contrib.auth). Would appreciate hearing how I can improve this code. Also, I am ...
5
votes
1answer
148 views

Automatic database migration system

Github here: https://github.com/cmancone/mygrations I'm working on a different kind of database migration system for helping manage web applications. I asked a question about part of the system just ...
9
votes
1answer
2k views

Database-agnostic user model in Golang

I'm trying to design a database model for an API. So far, here's my attempt to do so: I have a package called models that contains all of the models. Here, User is the database model and UserStorer ...
1
vote
0answers
201 views

Printshop database design

I am trying to design multi purpose printshop database on which I will develop my basic store system. Beofre I tried to design it using EVL (Entity-Attribute-Value) aproach, however some users would ...
1
vote
0answers
104 views

Getting data from a server for raffle game and saving data back to the server

So I'm making a raffle game so when you press B you get a random name with all the information of the winner. I get the data from a local SQL server and I want to make a list of the winners by saving ...
1
vote
1answer
47 views

script that imports only data that is not in the database yet

I want to write a script that imports data into a database (in django). The database has a Company class with a name (CharField) instance. Additionally, it has a Person class with name (CharField), ...
3
votes
1answer
1k views

Joining WorkTypes to WorkGroups via Channels and Users to check authorization

I need to select some "work types" from a channel. These "channels" are in "work groups" and both channels and work groups need to have permissions to view them (tables are ChannelUsers and ...
1
vote
1answer
2k views

SpringData: filtering fields of Entity in Repository

My entity is Office. In office repository I would like to find all office Addresses: ...
1
vote
2answers
113 views

Materiel position query for a war game written in Unity

I am making a tank game. I have a database on a server where I store information about Tank itself, Hulls, Turrets, and Guns. When the server gets "Hull" request it returns all needed information ...
2
votes
1answer
308 views

Checking a DB table before doing an insert using AWS Lambda

Pretty new to AWS Lambda and Javascript, and particularly Promises. Simple check db table before insert. It all seems to be working - I'm just wondering if there was a neater way of doing any of ...
3
votes
1answer
65 views

Name of language of translation

I am unhappy with my entity-relation-namings. The underliyng tables are named TRANSLATION and LANGUAGE. To contains translations like ...
7
votes
1answer
165 views

Database modeling for products and store

I am planning to develop a virtual shopping mall where stores of any kind can be registered, such as in a physical shopping mall. First I want to develop an efficient and effective database modeling ...
1
vote
3answers
579 views

Creates an employee record in a time and attendance database and returns the employee object [closed]

I am writing a time and attendance system. This is my idea of a simple elegant solution for the employee class. To me it makes the client very simple an encapsulates everything it needs, however I an ...
4
votes
2answers
624 views

Pausing and resuming a concurrent database update queue

I have a class DatabaseQueue which asynchronously runs SQLite updates that it takes from a LinkedBlockingQueue. I implemented a ...
2
votes
1answer
2k views

Custom C# Dapper ORM wrapper

I am I C#.NET developer for a few years now... Last couple of months I have started to study design patterns and enterprise software architecture principles so that I will be able to use those ...
1
vote
0answers
52 views

Tiny DBMS in Java

Introduction For my purposes, I have written this simple database management system, that can do the following: Support of 7 data types: int, ...
2
votes
2answers
186 views

Noting discrepancies between scheduled and actual attendance of sessions

I ask as I'm mostly self taught, and don't have a team to be able to get experience/challenge or ask. The Requirement I have a register per week. (ie the kind you mark attendance on), with sub ...
1
vote
3answers
2k views

Instantiating a Database connection class in PHP

I am building my own MVC and I have a couple questions about making a database connection and what is the best practice. I have a model User which interacts with ...
1
vote
1answer
30 views

Combination aggregate/greatest-n-per-group SQL query on simplified data set

I've been reading the top 'greatest-n-per-group' answers on StackOverflow but haven't yet found any answers that fit my specific case. The following code works, but it seems overly-complicated for ...
0
votes
1answer
190 views

Django query to find all items without a FK relationship except for excluded list

I have a Book model and an Author model that has a FK relationship to Book (I realize that ...
5
votes
2answers
118 views

Determine number of times an id was used with a domain IP

This is a slow query and the table has 50 million rows. Table named 'log': ...
0
votes
1answer
72 views

Rendering logos for guitars and basses listed in a database

Right now I'm still a beginner in databases and still learning all about it. I have a problem with the design of my database and I don't really know where to go from here. Basically I'm building a ...
3
votes
2answers
891 views

User class, taking on login and registration capabilities

Based on the Single Responsibility Principle, I have been looking at my User class, trying to figure out how I can break out more functionality into separate classes. But it seems like all the ...
3
votes
0answers
398 views

MySQL Schema for Tag System Works, But Can It Be Better?

I'm working on system that tags images. I'm going to use the xxHash (lz4) for hashing images. With hashes of size 64 bits, it looks like I won't have a 50% chance of a collision until ~4 billion ...
1
vote
1answer
59 views

db access wrapper for Go project

I'm adding db access to my go program, it looks like this: ...
1
vote
2answers
2k views

Extensive use of exception for database wrapper

My favourite programming language is Java and I usually use JDBC for database operations. I'm using Swift for one of my projects and I should use a database. The problem is SQLite is only available ...
1
vote
1answer
276 views

Schema for SQL database of guitars

I just want to ask you guys if the database design that i made for my asp.net website is correct or not. So basically, I created a database for the brands of my guitar products, which is like this: ...
2
votes
0answers
536 views

C# MySQL Database Library

Below is a database manager and a class called database connection. The database Manager controls the database connection string and generates a new database connection when you need one. I'm looking ...
3
votes
1answer
4k views

Generic database select method for within my application

I want to implement a generic Get method for my ASP MVC application, which gets data from an MS Access database. This is what I have so far, where I am testing it ...
1
vote
3answers
136 views

PHP database calls

I need help to speed up this code. It works, but is really slow (updates 2 items/second). Any tips on how to speed it up? The script functions like this: Break up an email to username and domain If ...
3
votes
1answer
29 views

Creating a join table entry by looking up name

I wrote a stored procedure that allows a join entity to be created by name for my fictional characters database. I would like some feedback on it with regard to exception handling, and conditions I ...
5
votes
1answer
7k views

Importing database of 4 million rows into Pandas DataFrame

I am using the following code to import database table into a DataFrame: ...

1 2 3
4
5
11