Questions tagged [relations]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1
votes
0answers
13 views

Determine 2NF and 3NF relations for this universal relation R

I have a universal relation R={A,B,C,D,E,F,G,H,I,J}. I need help decomposing it to 2NF and 3NF relations using this functional dependency G={{A,B}->{C},{B,D}->{E,F},{A,D}->{D,H},{A}->{J}}, ...
0
votes
0answers
18 views

MySQL structure for many to many relationship [closed]

I have a titles table, titles are movies or series. I want to suggest users similar titles so there is a one-to-many relation in the title_suggestions table (title_id, suggestion_id which refers to ...
1
vote
1answer
22 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 ...
0
votes
1answer
24 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 ...
1
vote
1answer
32 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(...
1
vote
1answer
40 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 ...
0
votes
2answers
164 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, ...
0
votes
1answer
21 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 ...
0
votes
1answer
25 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 ...
1
vote
1answer
52 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 ...
0
votes
2answers
37 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 ...
0
votes
1answer
60 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 ...
1
vote
1answer
26 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 ...
1
vote
0answers
117 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 ...
0
votes
0answers
13 views

What is the best relationship for a pair of tables that have optional dependencies but aren't really related?

I have two tables inspections and tasks. The inspection is allowed to have a single task but not many. Inspections don't need tasks and really there is no direct relationship. However, I have a link ...
1
vote
1answer
29 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 ...
0
votes
0answers
20 views

Constructing relational model from ER

I'm given the following ER model. It's unclear to me how I'd identify copies. For the image entity I think it's sufficient to take the 'ArtistName' and 'ImageName' as a combined primary key. Another ...
0
votes
0answers
13 views

Table realtion vs no relation for ecommerce apps that has huge request

I'm trying to develop ecommerce apps, with flutter for frontend, nodejs as RestAPI, and MySQL for database. I'm trying to develop the cart module. I've 2 options for the database modeling. Cart table ...
1
vote
1answer
174 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: ----+---------------------------...
1
vote
3answers
58 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 ...
0
votes
0answers
25 views

Question about Ternary Entity Relationship Model

I can't wrap my head around these claims concerning this Ternary ER Model. Unfortunately this is in German so here are the translations: Prüfer = Examiner prüft = examines Fach = Subject Datum = ...
1
vote
2answers
128 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 ...
0
votes
0answers
17 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 ...
0
votes
1answer
43 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 ...
0
votes
2answers
59 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 ...
1
vote
1answer
178 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, ...
1
vote
1answer
41 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 ...
0
votes
0answers
31 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 ...
1
vote
2answers
89 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, ...
0
votes
0answers
39 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 ...
-1
votes
1answer
30 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 ...
0
votes
1answer
49 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-...
0
votes
1answer
87 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 ...
4
votes
0answers
120 views

Are these tables in 3NF? [closed]

Update: I updated the question to be more specific and also updated the diagram. I am currently in my last semester, I did use SQL before then I left for MongoDB but the practice project requires to ...
1
vote
1answer
52 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 ...
0
votes
3answers
104 views

Given a table containing class and students, need to find the diff in students

I have class_students table where given 2 class ids I need to find the diff in students. This is sql fiddle that I used, http://sqlfiddle.com/#!9/dba48e/11 Any help here.
0
votes
1answer
20 views

three tables relation order is correct but values are false

i have those tables table1 | id | name | | 1 | axe | | 2 | bow | | 3 | car | | 4 | dart | table2 table3 | t1_id | ...
0
votes
1answer
158 views

Database design for Scavenger Hunt Game

I'm designing a section of my database which links User, Team and Hunt. I would like users to be members of a team but the team can play multiple hunts (so can be used multiple times). The first idea ...
1
vote
0answers
645 views

Is a relation with two attributes always in Boyce-Codd Normal Form (BCNF)?

I went through some tutorials on BCNF and got that a relation with two attributes is always in BCNF. My question What if a relation with two attributes has no prime or non-prime attributes? That is, ...
2
votes
0answers
69 views

A multiple choice question, with multiple or only one correct answer, and sometimes no correct answer [closed]

It's a question & answer based model, and here is the scenario: A question with multiple choices given, with 3 to 7 correct answers among those choices. A question with multiple choices given, ...
1
vote
2answers
284 views

Are Cataloge and relation cache in PostgreSQL per connection or global to the server?

I am trying to figure out if Postgres' relation and catalog cache are per connection or per server? I did find that plan caches are per connection. It would make sense for the cache to exist for as ...
1
vote
0answers
32 views

Database pattern with two types of owners for an object. Like how users and groups can make posts in FB [duplicate]

Please help. There is a problem I have tried to resolve for some time now. I want to come up with a pattern where i have a table with advertisements on a web platform. These advertisements shall be ...
0
votes
1answer
206 views

Table Relationships for Property Bags Configuration

I am creating a database table setup for user preferences in my application based partially on this design and while I created the tables and foreign keys, I can't seem to figure out the relationships ...
2
votes
1answer
1k views

Is it good practice to create a separate table for views count?

I have created a blog table where I'm having a field called views_count but I have heard that updating the views_count field on each page view is strain. So I have created now a seperate table for ...
-1
votes
1answer
25 views

Creating blog fresh tables from old tables [closed]

I am re-creating a database structure from old tables. New tables should be optimized and easy to understand. In old database the developer used video table name for storing video blogs. However I ...
2
votes
1answer
308 views

BCNF decomposition does not prevent insert anomaly?

I am in the process of designing a schema for a simple polling app and have tried to normalize it with the decomposition algorithm from this lecture. Requirements A poll has a unique id (poll_id), a ...
0
votes
1answer
45 views

Recursive Relationship [closed]

I have an application, which contains two Models Question and Option Each Question has many Options Each Option may have many Questions (and this Question may have many sub Options) so on and so ...
0
votes
1answer
59 views

mysql join many to one table and display each 'many' record as an additional column

I have a many to one table. For example: user_id, name 1, chris 2, john and user_id, item 1, apple, 1, banana, 2, orange How could I run a query that returns something like this: user_id, ...
1
vote
0answers
66 views

Normalizing a relation schema with 'abstract' attribute names

I'm a student currently attending a database design course and I'm having some issues normalizing 'abstract' attribute relation schemas from 1NF all the way to 3NF. When we used examples with '...
1
vote
1answer
112 views

LOB in frequently queried table or separate table

I have a table named FinTrans in an Microsoft SQL Server 2012 server with approx 10K-30K records at any given time and about 2K records are inserted and deleted each day. The table has 3 nvarchar(...