Questions tagged [database]

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

Filter by
Sorted by
Tagged with
-3
votes
0answers
15 views

Django Companies db design dilemma

Should the category, user model be attached to every single relation? Does my DB design is ok for having multiple stores and multiple products on top of a single company? Any performance-related ...
0
votes
0answers
16 views

Is this the correct usage of a view in PostgreSQL?

I have two tables. One stores locations and another stores different ratings for those locations (where ratings can come from different users, so one location can have many ratings). I'd like a way to ...
0
votes
2answers
62 views

Check if ID exist or not

Here I have a class where I'm checking if model_id exists in the table models_web_tbl. Everything works like a charm but I just ...
2
votes
1answer
28 views

Speed up Django migration that adds two fields into one

Currently trying to migrate two fields of information into one field. We have many, many objects to go through and it takes roughly 12 minutes to loop through all the objects. That would mean the ...
3
votes
2answers
140 views

Access a database and an API, uses python generators, and matches the results based on names, interview assignment

Thanks in advance if you are reading this code. I recently submitted this code as part of an interview (took about 4-5 hours). Unfortunately, they did not like the code and I received a form ...
3
votes
1answer
35 views

Get data from pipedrive API and insert it into Snowflake

I am a new python programmer. I have created the code to put API data from pipedrive to Snowflake database. Here are the steps in my code. Delete the csv file if it exists. Make an API call put all ...
3
votes
1answer
64 views

Records and elements class, small “database” c++, no sql

I'm trying to construct a simple database for use by 2 persons only (myself and other guy), right now, we're using excel table with 4 fields "requisition, origin date, request date and authorized date"...
0
votes
0answers
7 views

Foreign key massacre: How many tables, Winston? [migrated]

I'm designing a feature related to defining insurance policies. There's a list of Provisions that have names and IDs. Anything called an "ID" here is an integer which is a surrogate key in a table. ...
1
vote
0answers
21 views

Python database powered by SSTable

I've written up a key-value store that runs on SSTables in python. ...
4
votes
2answers
80 views

First program in Python for data analysis

I'm just starting my adventure with python and I wanted to share my first project with you and ask for feedback and advice. This is a script for my friend to automate all calculations and database ...
1
vote
1answer
29 views

Scenario creator database design

I am working on moving a save system from loose files to a (spatial sqlite) database. The user places objects from a library in a 3d simulation. Scenarios are "what-ifs", what if we place 5 wind ...
0
votes
0answers
26 views

Metro Train Route and TimeTable Database Schema

I am still learning MySQL and Database design. I need experts' advice to design the database in a well-optimized way. I want to store the following data Trains, Cateogies (e.g fast, slow, special ...
1
vote
0answers
21 views

Postgres Schema Design for School Classes with Cancellations and Substitute Instructors

I have modelled a series of school classes as follows. The part I am not sure about is having a separate table for cancellations and substitute instructors. With this setup every time you looked up ...
2
votes
1answer
65 views

Database Model for Feedback Module

I wish to generate an online feedback system. Requirements are Admin can enter feedback questions Admin will select these questions and create a feedback session One Question can be used in many ...
1
vote
0answers
22 views

MySQL select statement for retrieving user role permissions

I have a java project that I'm working on and I'm trying to implement in my application role-based authentication. So for example when a user is logging and he is an admin he will have access to some ...
3
votes
1answer
40 views

Simple User and Database Relationship

Hello and thanks for clicking! I'm currently studying the relationship between a database and user objects. This is a very simple program and the "database" itself is a dictionary. This will be used ...
2
votes
1answer
110 views

DataReader to To IEnumerable<object[]> To 2 Dimensional Array

Let me preface this with a few things before I get into my question: I am making the leap from VBA/VB6 to .NET, (boy is it a big one), so I am noob to .NET best ...
3
votes
1answer
54 views

SQL query on relational schema

I'm trying to find the best solutions for operations on the following database: ...
7
votes
1answer
77 views

Database design for a very basic image-sharing social website

Below is the database design that I created for a basic image sharing social website. When a user signup his username, email, password save in users When the user ...
1
vote
1answer
64 views

Create, populate, and query a basic five table car dealership database

The objective is to implement basic mySQL and relational principles, like how to handle and query one-to-many and many-to-many relationships. The database consists of 5 tables: car (car_id, ...
1
vote
0answers
45 views

c++ sqlite3 wrapper

this is a simple wrapper for sqlite3 to make working with databases easier it isn't a professional implementation but it is much better than the raw c interface I saved much time and code using this ...
-1
votes
1answer
57 views

Login to a school system and get account type

I'm new to MySQL database design. My question is this database is correctly built or not. We used the users table to login and get account type and here the code to login ...
3
votes
4answers
116 views

Java program to manage animal data and store them in text files

I made this program as a baby step to creating an animal shelter management system that will be used in a real life animal shelter. The goal is to move from text files to an online database, and from ...
1
vote
0answers
48 views

Lightweight, modular Discord bot - tips and feedback on the code?

The full project is up on GitHub. The codebase is super small as it stands. I'm brand new to reactive programming and Spring, and would mostly like insight on those two things. Asynchronous ...
1
vote
1answer
47 views

Database connection and DataMapper

Following my previous question Database interface and PDO adapter, I wrote a new simple class to connect to Database and run a query returning a PDO statement. ...
2
votes
1answer
96 views

Database interface and PDO adapter

I'm writing my own framework in PHP and I want respect the SOLID principles. I made this interface: ...
2
votes
1answer
135 views

Employee database

To keep in practice with good techniques of java programming, I've decided to write a database. All it does it stores employees, allows users that are logged in to get/set employees, and has a login ...
3
votes
1answer
30 views

List products based on slug and sidebar filters

This method shows the list of manufacturers' offered products based on the slug and sidebar filters. Most of the time I have to write the same query with only some changes: you can say I am repeating ...
0
votes
0answers
50 views

Parties and Messages in SQL e-Commerce db design

I'm posting a follow-up question based on my first question. My goal is to, as an exercise for myself, create a complex (in my opinion) e-commerce application. The explanation of the application can ...
4
votes
1answer
278 views

SQL e-commerce database design

I want as an exercise to create an e-commerce application from bottom up. My main goal here is to gain a lot of knowledge. I have experience in web development, but never have been there from the ...
3
votes
0answers
32 views

Connect to a database with Diesel

New to Rust and would like some clarification on idiomatic and readable use of Result and Error types. Here I'm simply connecting to a database using Diesel. In my opinion, the use of match and Boxing ...
0
votes
0answers
25 views

Ensuring referential integrity in child, group relationship

I'm not going to lie - Sql Server is not in the top 10 of my skill set, but it's something that I have to do from time to time. What's more, I'm using Entity Framework, so there is a workaround ...
2
votes
1answer
77 views

Using IndexedDB as an in-browser cache

In my site: Users have many Activities Each Activity has encoded_polyline data I display these encoded_polylines on a map I want to use IndexedDB (via Dexie) as an in-browser cache so that they don'...
4
votes
1answer
79 views

Django model for real estate

I have built a real estate management system with Django. I want to know if my design database was wrong. Please let me know how to improve it. Should I make the models use more than two tables (...
0
votes
1answer
35 views

Handling a PUT API call to write to a database using promises

The following function is accepting PUT connection to a server API, checks authorization to write and then performs write to a database. The eslint linting tool ...
2
votes
1answer
918 views

Conditional joining Pandas dataframes

I'm looking for an optimum way to join two Dataframes where the same record exists in both. Examples would be: ...
2
votes
2answers
75 views

PHP Filesystem JSON Files DB

Regarding the use of the file system as a database to simply hold JSON files. Any input on this matter from people who know will be appreciated... ...
8
votes
2answers
147 views

Non-Entity framework database interaction model

A C# WPF user interface has been developed for the Book Inventory MySQL database previously shown in this question. Since the database had already been developed this was a database first ...
1
vote
1answer
104 views

Asynchronous wrapper for database connection

I'm using a database that has a library for access to it. Connection is done synchronously, it's blocking and I do not have a way to abort it. To connect, I have to write: ...
0
votes
0answers
67 views

Flask database design for a social media site like Twitter

This is a mysql database that is created through sqlalchemy. I really don't want to rewrite all of it in sql code, but the code should be understandable if you know a tiny bit of MySQL. I am ...
3
votes
1answer
355 views

Inserting 50k rows with Spring Data and JPA [closed]

I am using Spring Data JPA with Spring boot application. My requirement is to insert 50K rows in JPA entity table in one hour or less. I have 3 entities A, B and C. Entity A has a one to many ...
-1
votes
1answer
91 views

Handling Entity Framework in connected mode within Windows Forms [closed]

I know the difference between the Entity Framework connected mode vs disconnected mode. In connected mode we do all the stuff inside one single DbContext instance. ...
8
votes
1answer
59 views

Maintain non-persistent database for books

The following program displays a menu, and prompts the user to choose an option. Options include to add a book, delete a book, view all books, and to exit the program. (Note that the actual code to ...
0
votes
2answers
84 views

NoSQL data model design for players in a game

I am modelling a game which can be single (player1 vs player2) or double (pair 1 vs pair 2, where each pair contains 2 players) and each game has a score. The game is group and date based e.g. Group A ...
3
votes
3answers
665 views

Dynamic PHP PDO insert method

This is my attempt at making a class for dynamic PDO queries in PHP. The code works, but I would like the hear what I can improve to make it more secure and readable. ...
1
vote
1answer
55 views

PHP flatfile storage

So, I made a tiny (~2 KB, <100 lines) library for simple flat-file data storage. How it works is, you define a file to be used, and then you can add/read/modify/delete objects as "keys" to/from ...
6
votes
1answer
149 views

Polymorphic Data Socket Factory with Query Contingency Protocols in Python

I work on a small data team where we developed this tool when we began experiencing several job failures on our legacy big data systems. We have several data lakes, each with their own API, and until ...
2
votes
0answers
4k views

MySQL database schema for e-commerce website

I'm making an e-commerce site, using MySQL for storing data. ...
3
votes
2answers
121 views

Finding the duration of how long a search has been popular

Program: I have designed a program in python that does the following (in order): Webscrapes google trends for the most popular searches Stores the searches and traffic of the searches in an in-memory ...
3
votes
1answer
59 views

Queries to print out on the screen a list of menus

For common users I have 10 queries and for registered users I have 30 queries like this one below, only to print out on the screen the link for the querystrings, a guy said to me that I should escape ...

1 2 3 4 5 9