All Questions
Tagged with database relational-database
2,460
questions
-2
votes
0
answers
25
views
Database design for audio content streaming application [closed]
I have this task to design a database schema for a simple audio content streaming application, and I have questions about what would be the best way to store relations between tracks and playlists.
I ...
0
votes
1
answer
36
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
...
1
vote
2
answers
60
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....
0
votes
1
answer
32
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 ...
0
votes
0
answers
23
views
Create a snapshot table of other tables that have nested FK
Assume I have the following tables:
Article (id[PK], home, category, userId[FK], locationId[FK])
User (id[PK], name)
Location (id[PK], address, name)
Now I want to create a new ArticleArchive, that ...
1
vote
0
answers
34
views
DataGrip problem with connection on Linux
I'm working on my college project from Relational Databases subject. I'm using Linux. At college we are using Oracle databases.
I'm facing problem: "the network adapter could not establish the ...
0
votes
0
answers
20
views
Optimizing Location-Based Data Analysis System Schema in PostgreSQL
Preface:
I am developing an analytics application designed for businesses operating across different geographical locations. This application allows users to analyze data based on their associated ...
0
votes
0
answers
23
views
Proper database design when 1 entity can belong to 2 possible others
I am making a database design for a questionnaire type application that allows admins to build a form up and create questions of different types. As basic form can consist of many sections, sections ...
0
votes
1
answer
35
views
Dependency Cycle in Database with Update Approvals
I'm struggling with a dependency cycle in my SQL database schema for a system with update approvals. Here's the situation:
I have tables for documents , transactions, payment_methods, and ...
0
votes
1
answer
38
views
Is the statement correct with respect to the circuit depicted in the ER diagram?
An employee can work in multiple offices.
Please evaluate this expression as applied to this ER diagram. It seems wrong to me.
The relationship between Office and Company is one-to-many. This implies ...
0
votes
1
answer
32
views
Django - Create a model that holds aggregated Foreign Key values
I have a Django Model defined as a ServiceEvent, and another defined as Part.
class ServiceEvent(Model):
date = DateTimeField(null=False, blank=False, db_column='date',
...
0
votes
1
answer
50
views
How to write query for a condition on join table
I am trying to write a query using Rails ORM. Suppose there are two models.
class College
has_many :students
class Student
belongs_to :college
The Student table has a column named result which can ...
0
votes
2
answers
74
views
Constrain Data Based on Implicit Relationships in Entity Framework Core
I have generalized the problem as outlined by the Data Model and Data. My generalization only keeps the relationships in tact.
The Problem
We have a base model Owner, which captures the Pet for the ...
0
votes
1
answer
88
views
How to formulate "at most" in domain relational calculus
How do I formulate "at most" in domain relational calculus?
Example queries:
Dish: dish_id, name
Have: dish_id, ing_id
Ingredient: ing_id, name
What are the names of ingredients included in ...
0
votes
0
answers
33
views
flask-sqlalchemy multiple relationship between two tables
I have 3 user type in my flask application
Admin
Agent
Customer
The idea is to store all necessary information of a user in User table and build relationship in another table with extra fields like ...