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
0
votes
1answer
86 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 ...
-1
votes
0answers
44 views

Are Session IDs an appropriate primary key?

I'm reading that UUIDs are good for session IDs, but I'm also reading that UUIDs are not efficient to use as primary keys in a database. I'm working on a Flask API with SQLalchemy on Azure for context....
3
votes
2answers
177 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
87 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
40 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
51 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
86 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
44 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
121 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
101 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
89 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
155 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
231 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
101 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
74 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
48 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
46 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
41 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
56 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
140 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
88 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
117 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
174 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
174 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
251 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
87 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
193 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
323 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
51 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
103 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
94 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 ...
-3
votes
1answer
707 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
110 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
154 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
52 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
54 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 ([...
0
votes
0answers
20 views

Live Streaming Service Schema Design

I'm requesting some feedback on a database we use in a live streaming service. We've Frankensteined this one as we've grown, and I'm looking to make a new one because there are now some obvious pain ...
1
vote
1answer
622 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
41 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
66 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
194 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
104 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
314 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
votes
1answer
44 views

Best practices for creating structured data from “flat” SQL query results

Recently I've been working on a project to teach myself PHP and SQL, and as the project has gotten more complex I've been wondering what the idiomatic approaches are for creating the backend models ...
3
votes
1answer
184 views

What *really* is the difference between relational and non-relational data?

Here is where I am at right now: I know that relational data, like that found in relational databases like MySQL or Postgres, is relational because there are relations between the tables. That is the ...
1
vote
0answers
29 views

Partial database synchronisation across multiple databases

Currently we are looking for a solution to sync databases across multiple locations. We a location hierarchy such as Country -> State -> District -> Center. To increase speed and reliability of the ...
2
votes
1answer
81 views

Database Model Classes in TypeScript

I'm using Knex.js with TypeScript for database access. Table uid (UUID, auto-generated by Postgres) name (varchar) Model interface User { uid: string | null; name: string; }...
3
votes
3answers
217 views

How can I scale a database that requires that writes are consistent?

Suppose I have a table that saves plane ticket purchases. I need to keep track that I don't oversell so when a user purchases a ticket it needs to be stored in that table and other customers need to ...

1
2 3 4 5
14