Questions tagged [database]

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

Filter by
Sorted by
Tagged with
3
votes
1answer
200 views

Meme (title with picture) exchanger

Project structure without code: Packages: Classes in packages: In ConfigConstants I store path to folder, where I save pictures. Also in ...
2
votes
1answer
52 views

Fully buffered stream with atomic commit

This is a class from an implementation of SQL in C# I am writing. It fully buffers all reads and writes, and also logs changes to a log file so that updates are atomic ( all or nothing ). It ...
3
votes
2answers
75 views

Getting data from database through Ajax post request

Is the method used below to get data from a database efficient and optimal? The data is in a MySQL database, and in my server I have a PHP file with the following code to return some information: <...
1
vote
0answers
62 views

Entity Framework optimization when using transactions

I want to save NUnit local tests in a mysql database hosted in Amazon RDS, and I'm wrapping up everything in a transaction like so : ...
2
votes
0answers
31 views

Handling failures in DB transactions

This code is meant to retry the db operation when a DB connection breaks: OperationalError. A transaction can fail for example when a db is being restarted and a commit fails. Or when a network error ...
2
votes
1answer
35 views

Performance stored procedure update multi-coulmn sql

I have a stored procedure the every 5 min run in sqlserver high cost iO/cpu do you have any idea to tune this query ...
1
vote
1answer
444 views

SQLite and Python: commit once every 10 seconds maximum, and not after every client request

In a Python Bottle server using SQLite, I noticed that doing a DB commit after each INSERT is not efficient: it can use 100ms after each client request. Thus I wanted to improve this in How to commit ...
2
votes
0answers
45 views

Sharing model for different ORM's

I am building a MySQL to Realmdb converter app. I use Entity Framework to deal with MySQL, so below is the code of one of my model classes. I don't want to have multiple classes representing the same ...
3
votes
1answer
81 views

Static Arrays and Variables (JavaScript)

I would like to know if this code of the database for my Pokemon clone game follows general practices in syntax and general readability. I feel like I could cut down on my comment usage, and place ...
0
votes
1answer
39 views

Getting data from API every x seconds and store it in a database

I'm currently getting data from an API every 15 seconds. This data contains a json with 100-2000 new items every time. Now i don't need all the items that are in there but still quite some of them and ...
4
votes
1answer
125 views

Interface class for SQLite databases

I am learning the basics about managing an SQLite database by using Python and, mainly for practice purposes, I have then defined an interface class in order to let operations on database as clear as ...
3
votes
1answer
794 views

Python script for refreshing and preprocessing data in Excel report files

I wrote some code to create marketshare reports. However, I'm sure it can be improved. The tasks performed are: Open the global data file, refresh the data, import its content as a DF. Create a ...
1
vote
1answer
43 views

MSSQL database structure and stored procedure performance

I build database called MessageBoard and created StoredProcedure GetHomeView that return data for HomeView. I am completely new ...
1
vote
0answers
88 views

Checking if a user exists on the database and return user in JSON format

below code takes data (email,password,user type) from $_POST[] and use them to search whether a user exists on the database. If yes sends a JSON object to the ...
0
votes
1answer
55 views

PHP - Importing columns from uploaded CSV file to SQL database (Laravel 5.7) [closed]

The goal is to upload the columns from the csv into the SQL Pro database. I am able to select the column names that have been uploaded from the csv file, the columns from the csv file are then ...
1
vote
0answers
143 views

Database design for Instagram-like post/comments

I'd like a review of my design for an Instagram-like application where users can post and comment on pictures. I just finished a freecodecamp crash course on database design and this is the first ...
3
votes
2answers
60 views

Database Design for representing category relationships

So I am new to Databases.Recently I was asked this question in an interview where they expected me to come with a schema for storing and retrieving categories for an E-commerce website in an RDBMS. ...
2
votes
0answers
29 views

Gathering data using sqlalchemy from database and making it available using simplified namedtuple object in an iterable class

I wrote the below code today: ...
0
votes
1answer
60 views

How to refactoring function when I've to do many things in one function

I always want to improve my code by refactoring but when I've to work with complicated function that have many thing to do . How can I refactoring them. Here is my data for example I get data from ...
0
votes
2answers
78 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
92 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
218 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
88 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
78 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"...
1
vote
0answers
91 views

Python database powered by SSTable

I've written up a key-value store that runs on SSTables in python. ...
4
votes
2answers
104 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
49 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 ...
1
vote
0answers
22 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
882 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
24 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
52 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
360 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
271 views

SQL query on relational schema

I'm trying to find the best solutions for operations on the following database: ...
7
votes
1answer
236 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
450 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
78 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
59 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
729 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
70 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
68 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
266 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
618 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
31 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
64 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
507 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
35 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 ...
2
votes
1answer
108 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
125 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
39 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
2k 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: ...

1
2
3 4 5
11