Questions tagged [relations]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
41 views

How to create a reference in a many-to-many relationship with transact SQL?

I am creating my first database using only code (I don't like to use graphical interfaces, I feel that I am not learning to write T-SQL code, it is my personal opinion), I do not know how to create ...
user avatar
1 vote
1 answer
59 views

Terminology for Specific Kind of One-to-Many Relationship

This question regards how a one-to-many row might "belong" to a different row and what exactly to call it. I might be asking for a term that does not exist. Please see the below two tables. ...
user avatar
0 votes
0 answers
15 views

How to create a junction table for three many to many relationship?

I have three tabels named student, question and exam. A question can be asked in multiple exam. A student can appear in multiple exam. A exam can be attended by multiple students. And I need to ...
user avatar
-1 votes
0 answers
16 views

Time slot for reservation table database - type of day/time relationship

I need help building the tables on my database for a reservation table, think one for courts of a sports club. It's for a uni web dev project and I am literally running on caffeine to keep going so I ...
user avatar
0 votes
0 answers
28 views

Optional int column for mysql table with 3m rows?

I have 3m rows and 20k of them need to have int value of column "y". Should I make new column "y" with default NULL or 0 or making mess with new table and joining? I've already ...
user avatar
  • 177
0 votes
0 answers
12 views

Should I create a linking table between two tables with existing IDs or add a column to an existing table

So I have two tables. Not with these exact columns but it's just to illustrate the point users id | forename | surname forms id | name Using MS SQL and was wondering what's best practice to link a ...
user avatar
  • 194
0 votes
0 answers
18 views

Should I use JSON or related tables to represent a relation in Cassandra?

I know it is possible to store JSON in Cassandra, and I also know that Cassandra is a structured query language. Because of these two informations, I am unable to determine whether I should store some ...
user avatar
  • 101
0 votes
0 answers
18 views

Implementing notion/figma alike commenting feature

I'm building an application that creates offer templates. Each offer has different sections, (for eg; offerTeams, offerFeatures, ...) A user can add a comment to any section in the page. The logic ...
user avatar
0 votes
0 answers
14 views

How to use an ms access db to create job postings

I recently went to onetonline.org and downloaded each section of various job descriptions they had posted. Each section is an excel SS. I then edited each slightly to leave the first line as the ...
user avatar
  • 1
0 votes
0 answers
15 views

Standard solution to join 3 related data-group

i have 3 data-group stuffs - users - notifications each stuff for each user has deferent notification state and i dont know witch model is standard for connect them, I do not want to get into trouble ...
user avatar
1 vote
1 answer
30 views

referencing data from another table without using a join

Hi all so I have a homework assignment that I am having difficulty understanding. the problem I have been given is this: ix. Referring to the customers and shipping_details tables on the ER, ...
user avatar
2 votes
2 answers
89 views

foreign key table update impact

Lets say there is orders table with few foreign keys. One of them is addressId. Orders -- Id -- orderNum -- customerId -- addressId (foreign) CustomerAddress -- Id -- customerId -- street -- cityId --...
user avatar
0 votes
0 answers
19 views

Am I using the right arrow tip and formal logical statement to represent the relationship between two entities?

Given two entities named bigger_set andsmaller_set with an element of smaller_set "pointing" to none or at most one element in bigger_set, is the following formal statement correct? ...
user avatar
0 votes
1 answer
137 views

Update all rows with a one to many relationship count in the same table in MYSQL

I am trying to update all rows of a MYSQL table with the total amount of referred users for each user. 1 user can refer multiple users and I need to run a MYSQL query to update the invite count (total ...
user avatar
1 vote
1 answer
14 views

Creating relations that makes sense in a many 2 many 2 many format or is the solution badly designed?

I'm trying to get better at databases and started a hobby project for this. So this is the flow I'm trying to achieve. A user can have one or more portfolio A portfolio belongs to that user A ...
user avatar
0 votes
1 answer
13 views

Convert generalization in ERD to Relationnal Database having no additional column

I've a quite simple problem but the litterature I came accross didn't seem to dwell on. Let's say I have an entity OFFER which represents an Offer on a Product, for each product, one offer can be &...
user avatar
1 vote
1 answer
35 views

Database Design for evolving entities

I am looking for some best practices regarding table design when an entity is expected to evolve over time and get more properties. As an example let's consider a process that has a bunch of metadata ...
user avatar
1 vote
0 answers
23 views

How to restrict allowed sub-entities in table referencing super-entity based on a type code

I'm working on my first db architecture for a platform containing several user types and that can exchange assets between them. There are also several transaction types, but each transaction type ...
user avatar
0 votes
1 answer
55 views

What database & design would you use for legos [closed]

I'm trying to conceptualize an interesting problem I am designing for. Using lego's (the plastic construction toys) as an analogy seems to work well. If this is a fairly recognizable problem, then I'd ...
user avatar
0 votes
3 answers
39 views

Best Practice to define has many through relationship

Given the Images. Sometimes I needed to fetch lessons related to a course without joining the topic table. It is a good way to model the Schema in the diagram at the bottom? Kindly advice.
user avatar
0 votes
0 answers
32 views

GDPR and database data relation

In my website, users can report comments. Those reports are verified by operators and, based on a conclusion, they will mark the report as "No action" or "Deleted". The "...
user avatar
  • 1
0 votes
1 answer
59 views

How return list with inner list in SQL? [duplicate]

I prepared following SQL statement: SELECT tasks.name, profiles.email, types.specification, tasks.description, tasks.attachment_link, tasks.priority, assigned_tasks.progress_details, ...
user avatar
1 vote
1 answer
106 views

ER Schema - bank system

Hello i'm trying to model a simple banking scheme where I have 3 transactions: withdraw, transfer, deposit. of these 3 operations, the transfer is the only one that needs more attributes, I need to ...
user avatar
  • 113
0 votes
1 answer
28 views

Cardinality between tables in the present or over time?

I have a question regarding cardinality between two tables. I'm not sure how to approach it. Imagine the following: There are groups: group 1, group 2, group 3 etc One group can have multiple items ...
user avatar
1 vote
1 answer
37 views

Need a better approach in how to design this relation

I have a table fluxo, and fluxo have many fluxo_acao, but a entry in fluxo_acao can have three types, and each type have they particularities. to acomplish this, i created more three tables(...
user avatar
1 vote
1 answer
58 views

Relationship design for areas, managers and general manager

Given some specifications I need to design a database for an organization. One of the parts has to do with areas. In the organization there are different areas, each area has a boss, and there is also ...
user avatar
0 votes
2 answers
357 views

database management system vs database vs tables vs file [duplicate]

I have been trying to understand the way a database system works. Digging through the internet, I have come to following picture. Database system is required because we need a way to store data, ...
user avatar
  • 3
0 votes
1 answer
219 views

Whats the right table relationship for these entities?

I want to store all the data for the following entities: Users Projects Roles A user can work in multiple projects and can have many roles, but only one role for a user should be allowed in each ...
user avatar
  • 3
0 votes
1 answer
76 views

What are the main disadvantages of adding relationship between tables at later date?

During early development I tend to create tables using running numbers as Primary Key, although there is formally a real ID column for each table. I tend to forget mapping the relationship between ...
user avatar
1 vote
1 answer
155 views

Modeling an either/or relationship

I've seen this post (How should I model an “either/or” relationship?) but it's not exactly what I'm looking for. both answers are suggesting creating a subtype instead of a relationship. Say I have an ...
user avatar
0 votes
2 answers
38 views

Is there a good reason to create an additional table to realize a 1:N relation?

I have the following tables: Users _____ UserID Data ... Roles _____ RoleID Data ... UsersRoles _____ UserID RoleID Users and Roles are in a M:N relationship. As such I have the UsersRoles table to ...
user avatar
  • 3
0 votes
1 answer
347 views

ER Diagram | Group, Post, User relationship

I need to design an ER diagram, but I am confused in a section, more specifically how to relate the post with the groups, because I need that post contains the information of in which group I publish ...
user avatar
  • 101
1 vote
1 answer
31 views

Should I capture all the relationships in a Database design?

I am a newbie when it comes to database design. I was trying to create a blogging application and I ran into a problem. My database consists of the following tables: User HasInt (Records which user ...
user avatar
1 vote
0 answers
243 views

Should I use Postgres' JSON columns for additional related data of different types and not yet known?

I have a simple database table, lets call it tbl_main with a few columns and relations to other tables via foreign keys. The tbl_main is the most frequently written to table, as in it receives new ...
user avatar
  • 111
1 vote
1 answer
129 views

Understanding linking tables in a many-to-many relationship

I am still working on a photo storage app (designing the database for the data for the photos stored), using MySQL, and have been told that a photo may have one or more people in it, and a person may ...
user avatar
  • 29
1 vote
1 answer
1k views

How to filter multiple many to many relationship based on multiple tags?

I've a scheme of two main tables: problem and tag and a relation (which is a many to many connector) table: problem_tags which excerpt of them is like: Problem table: ----+---------------------------...
user avatar
1 vote
3 answers
82 views

Putting foreign keys of several tables into the same column

I've never come across this situation, not sure how to go about it. Let's say I have a table Portfolio. I also have two tables: Asset 1, and Asset 2. I need to create a bridge between Portfolio and ...
user avatar
1 vote
2 answers
153 views

Modeling a three-way association with optional relation

Business rules I have three tables (Parties, Categories and Products) which representing the following relationships: A product is classified by zero-one-to-many categories A category classifies ...
user avatar
  • 33
0 votes
0 answers
23 views

How do I restrict relations between entities to a parent entity?

I have a multi-vendor database for my e-commerce application. Below is a simple interpretation of my table and relation structure. Table: stores store_id (PK, AutoIncrement) Table: categories ...
user avatar
  • 3
0 votes
1 answer
406 views

Get data from different tables indexed by same ID

Database: postgresql 12. I have a table people: person_id | name ----------+----- 1 |John 2 |Paul 3 |Jim ... Each person can have zero or more car insurance contracts, so I ...
user avatar
0 votes
2 answers
88 views

Designing One-To-One Relationships

To begin with, I have to admit that I don't have great experience in designing database schemas. Being influenced by OOP , I find that by dividing the info we have about a object into different ...
user avatar
  • 103
1 vote
1 answer
254 views

Need Help With BCNF Decomposition Problem

I'll try and keep it as quick and concise as I can: I'm currently a novice developer who's super eager to learn Database Normalization and Optimization so I can up my skill in Full-Stack development, ...
user avatar
1 vote
1 answer
68 views

Should pivot tables have more columns (many to many relationship)

I'm currently thinking about how to organize my tables, and I have some information that I'm not sure were should be, one of them is the quantity of a food in a refrigerator Is it right if I add ...
user avatar
0 votes
0 answers
39 views

Relationships overview with some many-to-many

Good morning/afternoon, I am currently beginning a new project and I wanted to design the database before doing anything however I struggle a lot with this design because it has some many-to-many ...
user avatar
1 vote
2 answers
104 views

Unrelated tables and time intervals

I am going to comment on the scenario that I currently have when designing my database. I have the following tables: user (id, name, lastname) role (id, name) user_role (user_id, role_id, ...
user avatar
0 votes
0 answers
73 views

Delete duplicate keys with relation algebra without count

Hi I am new to relational algebra. I was wondering if there is a way to remove the tuples from a table using relational algebra that have the same Value occurring in multiple columns or same column ...
user avatar
  • 3
-1 votes
1 answer
103 views

Structure to represent matches between teams or individuals

Say there's a sport that can either be contested between two individuals, or two teams comprised of several individuals. So obviously we need the standard players, teams and teams_players tables. But ...
user avatar
  • 105
0 votes
1 answer
54 views

Database model / design best practice

I'm looking for a some guidance/advice on how to best model my data. Some background: I have location information that I'm trying to model. There are two categories of locations (company and non-...
user avatar
0 votes
1 answer
101 views

See direct (instead of indirect) info about rented book in my "actors_directors" talbe dropdown list - Access365

I'm building a database of "actors_directors" who are renting "books" from my library - a kind of exercise to learn database basics :-) This is how my "actors_directors" table looks like. They are ...
user avatar
1 vote
1 answer
80 views

Entity Relationship Diagram - Entity depending on attribute

I have an ER-Diagram containing the entity employees. When employees have high skills they may supervise lower skilled employees. How can I model that in an ER-Diagram? My initial approach of was to ...
user avatar