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
57 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
59 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
45 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
38 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
37 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
47 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
112 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
37 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
86 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
111 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
135 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
125 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
197 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
68 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
190 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
291 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
48 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
54 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
92 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
131 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
108 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
150 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
50 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 ...
0
votes
0answers
23 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
19 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
140 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
39 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
63 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
92 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 ...
0
votes
2answers
75 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
118 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
42 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
160 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
26 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
59 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
211 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 ...
0
votes
0answers
169 views

How to store articles (with text and images) in SQLAlchemy database

I'm working on a blog-like application with Flask and SQLAlchemy and I'm unsure how to store the blog posts (articles) in the database. These are going to contain text and images (placed between ...
1
vote
2answers
91 views

Database design of a web-app which trains kids to read

The question is about my database design. Is it OK? I feel uncomfortable about having 2 separate WordTraining and SyllableTraining tables and about too simple design (not much normalized). Maybe ...
0
votes
1answer
55 views

Analyse/show user why data has been filtered out by SQL

Sorry for the bad title. Couldn't really think of a good name without an explanation. In our system (source is inside Oracle PL/SQL packages) we have quite a lot large SQL queries with a sh..load of ...
0
votes
3answers
93 views

Keeping up logical order in a messaging environment

My setting is the following (Please assume that this points are entirely rock solid unchangeable, some for good reasons some: "just because"): In a super scalable microservice environment i receive ...
1
vote
5answers
251 views

How do B-Trees used in databases sort data based on different fields?

I know majority of databases uses B-Trees, and I can see how using a balanced binary tree will give fast sort times, for ordering by ID or whatever else the primary key is; but how are databases able ...
2
votes
2answers
201 views

Should POST and PUT handlers do pre flight check for 404?

When implementing GET on a resource is makes sense to respond with 404 if the resource cannot be found. For POST and PUT verbs it is a little more complicated. To respond with 404 in that case I ...
5
votes
1answer
123 views

Are legacy C# DataTable/SqlDataAdapters exponentially faster than SqlConnection/SqlCommand and/or LINQ to SQL DataContext.ExecuteCommand calls? [closed]

I can't believe DataTable/SqlDataAdapter massively beat out System.Data.Linq.DataContext.ExecuteCommand and ExecuteNonQuery (tried with both Stored Procedures and command text) and just straight ...
0
votes
1answer
90 views

Splitting 1-1 relationships across lots of different tables?

I've come across a table that has about 200 columns. About 150 of these can be grouped into 5-10 tables that make real world "sense", and seeing as most of these entries are never used I figured it ...
0
votes
1answer
54 views

MVC database connection .NET

Introduction I intend to create a .NET WinForms application (this will be a toy application) which connects to a SQL Server database backend. I have designed and implemented an object-oriented model ...
-2
votes
3answers
224 views

Best Practices for Managing SQL Code

I have a issue that keeps coming up as a developer using any .NET (C# mostly) and SQL. I personally feel it is bad practice to build SQL statements in code. There are too many case scenarios that may ...
1
vote
1answer
50 views

Query by NoSQL keys versus SQL hash

I am trying to decide between a NoSQL (MongoDB) or a SQL (Oracle) database for my project. This database will be used to store output files from a set of parameters. I can model this as a MongoDB ...
1
vote
2answers
194 views

What's more expensive on my server-side processing?

So I want to be processing my security protocols server-side, mainly token checks and then role authorisations for certain actions. I'm using c# .net core connecting to an MS SQL database and ...
6
votes
4answers
648 views

Relational integrity without relations

I have about 15 years software engineering experience, writing business software with relational databases. Mainly SQL Server and Oracle. I've always been of the opinion that you should define ...

1
2 3 4 5
14