Skip to main content

Questions tagged [relational-database]

A relational database is a database consisting of relation variables (which are also called *relvars*, *R-tables* or just *tables*). The definition, manipulation and integrity rules of relational databases are based on relational operations equivalent to or similar to the Relational Algebra and Calculus. Relational database principles are the basis of a substantial part of data management theory and practice.

relational-database
-3 votes
0 answers
43 views

How to restructure a schema in order to support conditional (one of two tables) relations

I've been stuck on this for a while now so I decided to ask for some help. My SetTemplate needs to EITHER be connected directly to exerciseTemplate OR connected to exerciseTemplate through a ...
Jocko's user avatar
  • 43
0 votes
1 answer
35 views

Why is PostgreSQL sorting a seemingly already sorted result set?

I'm trying to optimize the following query for a school assignment: SELECT DATE(b.book_date), SUM(b.total_amount) revenue, COUNT(DISTINCT(t.passenger_id)) count_passengers FROM bookings b ...
Finamore00's user avatar
0 votes
1 answer
65 views

Better way of handling many-to-many relations with EF db-first approach in .NET6

I'm having a Request table (EF generated): public class Request { public int Id { get; set; } public string Name {get; set; } public virtual ICollection<AttendeeRequest> ...
dezox's user avatar
  • 179
-1 votes
1 answer
46 views

Representing a plant with definite genus but unknown species

I want to represent plants in a database along with their genus/species. This was the schema that came to mind: CREATE TABLE genuses ( id INTEGER PRIMARY KEY, name TEXT UNIQUE NOT NULL); ...
axblount's user avatar
  • 2,644
2 votes
3 answers
138 views

how to use index when searched column is not indexed but has the same ordering as the indexed primary key

I have a huge table (kind of audit log) with these columns: ID, TS, DATA ID is the primary key, and it is a number from a sequence. TS is a timestamp and it is the current timestamp of the insert. ...
riskop's user avatar
  • 1,757
0 votes
0 answers
18 views

Historicized entity attributes with common end date

Suppose I want to create an EAV-style set of tables with the attributes having a validity date. The normalized way to do that is to have a single date column (let's call it valid_by), since having two ...
w_n's user avatar
  • 365
0 votes
0 answers
29 views

How do I efficiently manage relationships in a multi-tenant application

I am developing a multi-tenant application that manages information about suppliers and clients, using Entity Framework for user logins and roles. Suppliers provide products to clients, and clients ...
Shmiel's user avatar
  • 1,251
-2 votes
0 answers
38 views

1 table with 3 FKs or 2 pivot tables?

I'm building a Laravel app which connects students with tutors. I have three models Tutor, Subject, Level. A Tutor can teach a subject at various levels. Students should be able to search tutors by ...
ryanvb92's user avatar
  • 307
-1 votes
0 answers
24 views

Serializable isolation level when reading from multiple tables

According to the definitions, Serializable isolation guarantees that even though transactions may execute in parallel, the result is the same as if they had executed one at a time, without any ...
undermind's user avatar
  • 1,839
-1 votes
0 answers
20 views

Perfect Azure VM selector for disk-based database vs IMDB hammber DB benchmarking

I was hoping someone could point me in the right direction. I am currently performing a TPC-C benchmark between a relational database and in-memory database. However it was suggested that my machine ...
Aya's user avatar
  • 51
0 votes
0 answers
12 views

Using Conditional Values when inputting data into Supabase table (not during query)

I have this table that is tracking data, contractions for laboring females. this is my current table: Two of the columns are based on data either from their same row or from their row and different ...
Ceecee Hart's user avatar
1 vote
2 answers
59 views

Getting java.lang.StackOverflowError when two users follow each other

I am working on a Java application using Spring Boot, and I have a UserEntity class where users can follow each other. However, when two users follow each other, I encounter a java.lang....
ssvt's user avatar
  • 21
0 votes
1 answer
29 views

Remove a entry from hibernate collection without fetching entire collection

Using Hibernate, I have bi-directional association between person/address. Person entity can have too many addresses and I want to add and remove to address collection without loading entire ...
Apoorva Manjunath's user avatar
-4 votes
2 answers
86 views

Why should the operands for UNION be SELECT statements and not tables?

In SQL, given tables T and S that have the same schema, say, CREATE TABLE "T" ("ID" INTEGER, "Salary" REAL); CREATE TABLE "S" ("ID" INTEGER, "...
Ardy's user avatar
  • 15
0 votes
1 answer
60 views

Enterprise data model design for small business

I work at a small company that buys inventory and resells either the raw inventory or packages it up into bundles for resale. We have an in-house software and are redoing our data model for an ...
Kelsey Butler's user avatar

15 30 50 per page
1
2 3 4 5
457