Questions tagged [sql]

Structured Query Language (SQL) is a language for managing data in relational database management systems. This tag is for general SQL programming questions; it is not for Microsoft SQL Server (for this, use the sql-server tag), nor does it refer to specific dialects of SQL on its own.

Filter by
Sorted by
Tagged with
1
vote
1answer
72 views

How to manage primary keys in CQRS

I'm building a backend following the CQRS pattern and I don't know how to manage properly the primary keys (surrogate keys) between the command and query databases. For example: I have a model with ...
-3
votes
1answer
80 views

How do I evaluate if a data warehouse is necessary?

I need to put data from MongoDB together with tracking data from a quiz app (stuff like which users clicked what button etc). Then I’ll use this in machine learning. I looked at all the DW options ...
-3
votes
1answer
48 views

Achieving abstraction between persistence layer and business logic

I am writing Python scripts that regualary extract data from Databases (mainly SQL Server) using pyodbc. Until now I directly wrote my SQL Queries in the Source Code. However I want to clearly ...
0
votes
1answer
35 views

Reactjs with large DB

I am working with a very large SQL database through a frontend reactjs application with a node server intermediary using an ORM for query sanitation. However due to the size of the DB it takes some ...
0
votes
2answers
62 views

Best practices when designing SQL DB with “redundant” tables

I have a design dilemma for a DB I'm creating for an e-commerce platform I want to develop. I have 3 different actors interacting with the website: Customer Manager Supplier Those 3 actors have the ...
-3
votes
1answer
87 views

How to simulate test data to a database?

I've created a service application that import orders from an SQL database. Right now I'm manually entering the data into the database, but in release a 3rd party application will export orders to the ...
0
votes
2answers
47 views

Handling a column in a database which can change on external conditions

Let's suppose we have a table of products, similar to this one: ProductId ProductFriendlyName ProductPrice 84 Coke can 2 When a specific condition applies (the actual condition isn't really ...
0
votes
1answer
92 views

Variable WHERE clause while avoiding sql injection

I want the user to be able to provide a custom WHERE statement against a mysql-backed platform... do I need to worry about any possible SQL injection attacks notwithstanding invalid sql? See the ...
3
votes
2answers
199 views

Alternative To Generic Methods where Type is known at runtime

I've written a class that synchronizes a table between two databases using Dapper. The public and private Methods in the class are generic and the generic parameter is the POCO class that is being ...
0
votes
1answer
89 views

quality management on SQL stored procedures

I've always developed my own applications and use certain criteria to evaluate if the code is acceptable from a quality perspective. Now I've switched jobs and have to among other things maintain ...
1
vote
1answer
46 views

Synchronizing Multiple Local SQL databases with Server

I'm trying to understand what general mechanisms and/or concepts are available in SQL database last to synchronize local. Here are my inputs and requirements. Multiple clients have a full copy of the ...
0
votes
0answers
52 views

What is the best practice for hierarchical container - item relationship in a SQL database?

I am in the process of designing a database organizing real world items in different storage locations. One main principle is that items can contain other items. So the relevant table is: An "...
4
votes
2answers
96 views

How should my application treat database collisions that are handled safely?

My applications uses error reporting to track exceptions. My application uses SQL transactions to make sure that operations are completed completely or not at all. My application is multi-threaded. ...
0
votes
0answers
48 views

The best approaches to implement query with pagination based on SQL DB (Oracle)

I have faced with the following situation: there is a grid with pagination and a filter criteria builder to filter grid data set in web UI, in backend there is a Java method, which analyze filter ...
3
votes
0answers
125 views

Relational or non-relational database for storing and querying log data?

I'm planning to extend an application with logging of user events. (Client application via REST-API to Symfony). What is the preferred type of databases? Currently the log data is stored in a ...
0
votes
0answers
106 views

Storing tree data in a database for fast reading of the whole hierarchy

I have a class that looks something like this: class Entity { public string Id { get; set; } public List<Entity> Children { get; set; } public void DoStuff(Data data) { ...
0
votes
1answer
91 views

Subdomain and Database per customer?

I'm currently working on a farming IoT system and confused about the architecture so I wanted to get your views. I'm using a relational DB (PosgreSQL). I have multiple customers, each customer has one ...
-1
votes
1answer
157 views

What advantage is gained by continuing to not provide an UPSERT statement in T-SQL (or any given major SQL dialect)?

This question is asking about a generally applicable engineering principle. It is using T-SQL as a specific example, but the question is about the engineering principles behind major SQL dialects in ...
1
vote
2answers
285 views

When would I pick NoSQL over SQL when dealing with partly schema-less data?

so, I'm currently developing a feature for a website of mine, which aims to gather a set of financial data from the user so the user can start and take care of a budget, as well as the website ...
0
votes
1answer
104 views

Is deterministic SELECT possible without specifying an ORDER BY?

When we show a table with many thousands of records, we only show a small part of the total result set so as not to send too much data to the client at once. Clients can request more parts of the ...
-3
votes
1answer
75 views

What would be the best approach to enable data access to millions of records in an open source fashion?

We're currently building a Django app that's a doctor-patient-agent manager that allows patients to book a consultation, and doctors give them their prescription and information. What's important is ...
0
votes
1answer
54 views

Data Junction table - how many relations should it contain?

I have a junction table, say for People and Locations PersonLocations PersonId | LocationId --------------------- 1 3 2 5 Now, Locations can belong to each other i.e. one ...
2
votes
1answer
72 views

Best approach to connect master and child table while insert data in tables

I need advice what is best approach to connect data between master and child table. I have console application written in C# which scrape data from web, process data and insert them in table. Master ...
-3
votes
2answers
42 views

Does it make sense for a large scale SaaS project to use a single all powerful SQL/RDBMS database?

Scalability seems to be a thing now. I was in a heated argument with one of my developer who insist on using MySQL for a data intensive application we are building. MySql is easy, fits the purpose and ...
1
vote
0answers
57 views

Issues Regarding Data Model Abstraction in Golang

I am currently writing a quiz web-app with a React front-end and a Golang backend, with a PostgreSQL database to keep track of the quizzes, the questions on the quizzes, and the choices in the ...
2
votes
1answer
206 views

What are the pros and cons of adding SQL columns in run time, vs through a different design time architecture?

The company I'm currently working for has a feature in an enterprise app where a user can add columns to a table configuration on a web GUI through fields and a button, and a corresponding SQL table ...
0
votes
1answer
38 views

Inserting dissimilar excel files in SQLdatabase

I have a bunch of excel files(Multiple sheets) with some data of similar types, but i'm having troubles when this data has to be inserted in SQL DB. the data in these files are unordered (eg: the ...
-2
votes
2answers
92 views

Select from many-to-many in one query

A common issue I run into when building CRUD applications is how to retrieve many-to-many relationships from the database and put them into an object model. Say, for example, I have the following data ...
1
vote
1answer
120 views

Writing a SQL recordset as a HTML Table - a bad practice?

I'm maintaining an intranet using ASP Classic. Some of pages looks like one or more HTML tables used for administration tasks. Those tables are obtained by SQL requests. Server side, they are kind of &...
-4
votes
1answer
195 views

Express SQL Query As Abstract Object Model

Goal: write code to express SQL queries in C# that get converted to SQL at the data layer level and will be compatible with any common data layer / ORM such as Dapper or Entity Framework (EF). Edit: ...
0
votes
3answers
326 views

Introducing “status” column to an SQL table changes its definition

I saw this pattern in multiple projects I wrote: I create an SQL model for a certain type of entities and at some point, we realize that there's a need to store multiples types of the same entities. ...
0
votes
3answers
318 views

Anti-pattern? Storing JSON table in SQL table

For an application that I currently plan to scale up, there's a bunch of JSON dicts and directories making up the "database". The reason I didn't use SQL initially, is simply because I've ...
1
vote
0answers
93 views

Should I decouple MySQL database?

I have two sites, one is a subdomain of the other. They both do different things entirely with one unifying goal. My intent is to have the main site do a majority of the heavy lifting, and the ...
0
votes
1answer
197 views

Why is there just one HAVING in SQL?

In SQL there is WHERE and HAVING: ... WHERE ... GROUP BY ... HAVING .... Why isn't there multiple GROUP BY and multiple HAVINGs per SELECT statement like: ... WHERE ... GROUP BY ... HAVING ... GROUP ...
0
votes
3answers
355 views

Is a transaction time of <10ms for an SQL database viable? If so, under what conditions?

Appreciate this is a rather odd question, so I will try to clarify as much as possible. Please also be assured this is a question purely for my own education, I'm not about to rush off and do crazy ...
-4
votes
1answer
53 views

Keeping JSON in database

I'm trying to create web app(flask or django-rest) that would scrape some data and save it to JSON so that it can be viewed in the frontend (VueJS). I'm wondering if it is better to save the scraped ...
-3
votes
1answer
110 views

SQL Server: Which License? Any alternatives?

I'm working on a project which at the moment is not being used for any commercial purposes, and I'm managing the data by using a SQL Server Database. I read here that I should pay for it if I ever ...
0
votes
2answers
99 views

Is it possible to query data in a RDMS without writing SQL?

Disclaimer: I'm not very knowledgeable when it comes to SQL or RDBMS in general. I've encountered this interesting answer about SQL as a language: https://stackoverflow.com/a/1643440/414063 This ...
-2
votes
1answer
1k views

Best way to store data for machine learning (Database or Files)

I am currently in the process of developing a machine learning application, where my users can upload their own data to train models. Furthermore, the users must be able to extend their uploaded data ...
-1
votes
2answers
117 views

Is it true that ORM allows for changing the type of SQL that you use easily?

Hey so I have been looking into ORM since my last question and I am wondering. Instead of worrying alot right now about whether I will use mysql, postgre, or sqlite, would it be better to use ORM ...
-2
votes
4answers
156 views

Are there any guidelines about making SQL queries easier to comprehend?

As I'm spending more time working with SQL, I'm starting to feel like this language promotes logic obfuscation. Here are some examples: An INNER JOIN in a query can act as an implicit filter that ...
-2
votes
1answer
56 views

Design a database with multiple relations and tables

I'm struggling to find how to correctly design a database in order to store and retrieve data for my software. Basically, I'm designing an application for a gym (C++, MySQL with PhpMyAdmin): each ...
1
vote
0answers
71 views

Paginate large data and store in temporary table for navigation

I have implemented pagination using SQL and stored that result of search into temporary table. Temporary table is named after unique tab id. So that other tab can have seperate result sets. That ...
4
votes
4answers
1k views

Is this WHERE clause builder an over-engineered design?

I've got to build some somewhat complicated WHERE clauses in SQL for a project I'm working on, and the clauses feel very hierarchical with their combination of ANDs and ORs. Instead of: WHERE ([...
1
vote
1answer
1k views

SQL Database schema for Catering/Menu management

Background I'm building a Private Chef booking service where you can book a Chef to cook you a custom Menu. I'm having trouble creating a SQL db schema that accurately represents the domain while ...
-3
votes
1answer
45 views

Saving large files like Credit Reports in Data Store - SQL/NoSQL/ObjectStore

I am working on a project to save external credit bureau reports in database. These reports are typically big and could go from 0.5MB to 5.0 MB. Number of files will grow exponentially over the time ...
-4
votes
1answer
71 views

Is it better (from a maintenance perspective) to dynamically construct complex SQL queries using Jinja or String concatenation? [closed]

Two possibilities. Which is better, with respect to readability, maintenance and clean code: SQL injection can be disregarded. Constructing complex parameterized sql queries using python string ...
0
votes
1answer
289 views

Doing data manipulation on server side vs client side

Im building a project that stores time series data on a per user basis. On the dashboard of the user it'll show some simple statistical analysis like averages but more importantly, it'll create charts ...
1
vote
2answers
122 views

How to model combinatorial information in RDBMS

I need to model the persistence of combinatorial information. For example, suppose that the combination of 3 attributes (A, B, and C) are used to reference a given product. Besides that, supposed that ...
-3
votes
1answer
492 views

Database design user user roles applications and features

We have multiple applications with different features. We want to create a central security system, where each user is assigned a role. Role has access to certain applications and features with in ...

1
2 3 4 5
15