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
13 views

Organizing and accessing data in xml database - VB.Net

So I made an XML database for my music player where I store songs data (title,artist,album,genre,year) the code for generating the database is working but slow as heck, the code works as following ...
1
vote
0answers
15 views

Microservice unit testing database script insert Error - H2

For unit testing my ProductList service, I tried run a script to insert some data and then try to get this data and compare the list size. But my database insert script is not running and returns null....
2
votes
0answers
15 views

Erlang: Seeking advice on BEST practices with ETS table manager

I wrote a some what "simple" module to retain ETS tables should the owner crash. I think it's small enough for review; big enough to make enough mistakes. Honestly I'm a hobbyist programmer ...
2
votes
0answers
27 views

Providing different __table_args__ to SQLAlchemy mapped class depending on backend DBMS

I need to set different __table_args__ for the mapped class depending on the backend DBMS, e.g. mssql and ...
2
votes
0answers
27 views

Using R to Dynamically Query Database Using SQL Template

Purpose of Code The purpose of the main function (get_player_penalties()) is to: Generate simple SQL statements from user input and a template Query a database ...
7
votes
1answer
410 views

LinDB: A dictionary type database

As an exercise, I've decided to write a lightweight, dictionary type database. Below are some of the features I've implemented: Overwrite Inserting: I allow the user to determine if they want to ...
1
vote
0answers
21 views

RPG Library Design

The RPG Library (the ERD-model here) is used to create Prototypes of Monsters and Items. These prototypes will later be used to create Instance in my RPGGame. I do not have much (de facto: none) ...
3
votes
0answers
48 views

SQL database implementation - statement execution

This is another class from my implementation of SQL in C#. It handles the execution of SQL statements, with the core method looking like this: ...
3
votes
0answers
80 views

Product inventory database with attributes and variants

I have design a model for product apps. This is the first time I am trying to create a product's database schema and then model it in Django. My code handles the following: A product type can have ...
3
votes
1answer
113 views

Get future events from Pinnacle API

My program makes API requests to Pinnacle Sports to retrieve future events and saves them to the database. Questions: Do I manage the database resources correctly? It takes about 3 seconds to check ...
1
vote
0answers
25 views

Randomly generating invoice IDs

As more fully detailed in my question here, I'm in the process of starting a small, local business and wanted to avoid showing sequential invoice IDs to clients, and instead generate completely random ...
1
vote
0answers
44 views

Database connector in Python

I've been trying to build an ORM. I started with the connector layer, which is responsible for the database server connections and executes raw SQL as the code below shows. I have built the ...
3
votes
1answer
198 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
44 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
63 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
61 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
29 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
33 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
68 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
43 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
52 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
25 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
49 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
42 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
41 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
58 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
38 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
35 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
55 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
26 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
0answers
19 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
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
50 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
178 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
57 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
71 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
47 views

Python database powered by SSTable

I've written up a key-value store that runs on SSTables in python. ...
4
votes
2answers
97 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
39 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
118 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 etc)...
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
314 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
47 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
134 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
115 views

SQL query on relational schema

I'm trying to find the best solutions for operations on the following database: ...
7
votes
1answer
116 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
98 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
57 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
2 3 4 5
10