Skip to main content

Questions tagged [relational-theory]

On this site this tag applies to questions about Relational Model theory. The Relational Model for database management is an approach to managing data using a structure and language consistent with first-order predicate logic. In the Relational Model of a database, all data is represented in terms of tuples, grouped into relations. A database organized in terms of the Relational Model is a relational database.

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

primary key referened by only single foreign key of another table among multiple tables that can reference it

Let's say I have table Account that contains username and password of users to login:- account ( account_id BIGINT PRIMARY KEY, username VARCHAR(30), password VARCHAR(30) ) -- I have two ...
Sidharth Bajpai's user avatar
0 votes
0 answers
16 views

How to decompose this relation (A,B,C) with 1MVD (A-->>B), 1FD (AB ->C) to comply with 4NF?

As the title, how to decompose this relation (A,B,C) having one MVD (A-->>B), one functional dependency AB ->C to comply with 4NF? I think it's like impossible ? Is that correct? because ...
chickensoup's user avatar
0 votes
1 answer
68 views

Calculating memory size required for an index

Assume I have the following table: CREATE TABLE t1 ( id int NOT NULL PRIMARY KEY, rank int NOT NULL, phrase varchar(100) NOT NULL ); with 10 billion records in a relational database like ...
Alexey Starinsky's user avatar
0 votes
2 answers
76 views

How do I identify the SQL server brand via SQL queries

A 3rd party API exposes a endpoint which accepts "SQL" queries. Their examples are simple SELECT statements, however I want to write more complicated queries. They do not specify which SQL ...
yeerk's user avatar
  • 101
0 votes
0 answers
45 views

How to create a schema for a combination of values that needs to be unique

How would I create a schema for the following data: Dimension A Attribute X, Attribute Y positive , positive => Description 1 positive , negative => Description 2 negative , ...
Filipe Giusti's user avatar
1 vote
1 answer
63 views

building this not-so-necessary relationship is a good approach?

I created a database for an app, where I have several networks, which have several nodes and elements and also several scenarios, all related to the networks. [see picture below] My question is: since ...
oakca's user avatar
  • 113
0 votes
3 answers
33 views

Which would be best for a scalable environment?

Which is more advantageous, speaking of performance, and best practices? A table of customers and a table of suppliers and a table of seller Or A table that covers the three entities having a field ...
Gabriel Simeoni's user avatar
-2 votes
2 answers
95 views

Why is it a bad idea to have multiple values in a column in a relational database?

One problem I've found is slow database queries. If I had a table that had a column titled customer and another column titled grocery_items that contained multiple grocery items, then a simple query ...
Ixion Chowdhury's user avatar
0 votes
1 answer
47 views

What does relational capabilities mean in Codd's Foundation rule?

From Codd's 12 rules (emphasis mine): For any system that is advertised as, or claimed to be, a relational data base management system, that system must be able to manage data bases entirely through ...
Mehdi Charife's user avatar
0 votes
2 answers
84 views

What is the reason for the graph dbms being better at friend-of-a-friend queries than relational dbms?

I often read that graph dbms are well suited for social networks. So for example, followers on instagram or linkedin. I read that the SQL dbms performance can degrade if the query involves multiple ...
Damiano's user avatar
  • 23
2 votes
1 answer
387 views

SQL query not returning all results when too much data

I am a software engineer with a little knowledge about what's going on under the hood of a dbms. The query presented below finds mutually followed people by two people: SELECT followed.id FROM person ...
Damiano's user avatar
  • 23
0 votes
0 answers
55 views

Functional Dependencies and Armstrong notation fundementals [duplicate]

if AB -> C and B -> A does that mean B -> C? B -> B is trivial and if we do composition with B->A, it becomes (B-> BA), then by transitivity does that mean B->C? but if B -> C ...
Jonathan Kho's user avatar
0 votes
1 answer
517 views

Correct entity relationship diagram representation of a normalized table with a NOT NULL foreign key

Intro Hi everyone, this is mainly a classification/theoretical question on the topic of inheritance and normalization techniques in database design and their appropriate representation in entity ...
papshmeare's user avatar
0 votes
1 answer
63 views

Is it good practice to join many tables together [User Data Design]?

I'm trying to design a database for storing information about users--say name, email, GPA, classes, and more information in the future. I believe the proper design involves storing each field as a row ...
Dan's user avatar
  • 1
0 votes
0 answers
143 views

Better way to store stock levels for products?

I currently have 3 tables: locations, products, and stock, which are pretty self-explanatory: The fields of stock are location_id, product_id, and quantity, which is great... until I add a new ...
Basil's user avatar
  • 131
1 vote
1 answer
43 views

Two types of one-to-many relations

first time poster here, and happy 2023! When talking about different types of entities relationships, I tend to think the following three: one-to-one one-to-many / many-to-one many-to-many However, ...
xpt's user avatar
  • 123
0 votes
2 answers
222 views

Determine Primary and Foreign Key for two tables

I have 2 tables, that is Patient Treatment Datetime Doctor Patient Complaint Description Medicine Address 1/1/22 17:05 Name A Patient K X X X X 1/1/22 17:11 Name C Patient L X X X X 1/1/22 17:27 ...
Herza Ryo's user avatar
1 vote
1 answer
315 views

Set Default Value of Column Equal to PK of inserted record, and use it as Foreign Key Reference

I'm using MariaDB 10.3, and what I'm trying to do is an establishment of a 1-to-n relationship as for example specified here in the section "One-To-Many-Relationship". I'm trying to do so ...
DevelJoe's user avatar
  • 163
2 votes
0 answers
47 views

For selling items in a game, should the shop and item tables be merged?

I'm developing a game that uses a Postgres database. In the game players can have many different items, and each player can have multiples of an item (example: 200 apples). My item table currently ...
Ryan Peschel's user avatar
0 votes
1 answer
53 views

How can I transform an exclusive constraint relationship from ER to RM model?

Let say we have two entities TEACHER and COURSE. There are two relationships between them. A TEACHER can teaches a COURSE, and also can learn a COURSE, however, the TEACHER cannot teach and learn a ...
xerez's user avatar
  • 1
0 votes
0 answers
48 views

Is there a formalism for the kinds of constraints we can implement with indexed-views? Or at least a rule-of-thumb?

SQL Server’s Indexed Views provide a performant way to implement certain classes of database-scoped constraints - such as ensuring a value is unique over multiple tables - or other non-key, cross-...
Dai's user avatar
  • 592
0 votes
0 answers
143 views

How to design a versionable and publishable entity?

I have encountered this problem a couple times. I have an entity that has versions and only one of those versions is the published version. As an example, let's say we have the entities Book and Book ...
Cholax's user avatar
  • 1
3 votes
1 answer
718 views

If an entity's primary key must contain a foreign key, does that make the entity weak?

I'm currently learning about strong and weak entity types in the context of RDBMS. While reading, I came across this statement: "A weak entity is dependent on a strong entity to ensure its ...
Izzo's user avatar
  • 141
0 votes
1 answer
49 views

Postgres: How to express Many-tables to Many-tables relationship?

What I have I have a schema of listeners defined like so: create table listeners.ethereum ( id serial primary key not null ); create table listeners.solana ( id serial primary key not null ); I ...
hexcowboy's user avatar
1 vote
1 answer
543 views

How to implement disjoint (nonoverlapping) subtype with total completeness in MongoDB?

I designed an entity relationship diagram (ERD) with the goal of creating two child entities (INSTITUTION and SPACECRAFT) of a parent entity (LOCATION), which is distinguished depending on the value ...
ttoshiro's user avatar
  • 113
-2 votes
3 answers
1k views

Does it make sense to use a non-relational database for reporting/BI/visualisation tools?

Relational databases are well used in reporting/visualisation tools such as Power BI, Tableau... Non-relational databases are getting popular and many reporting tools allow its connection. However I ...
greenglas's user avatar
0 votes
1 answer
77 views

How to design a database that merges two similar others?

Disclaimer : I'm new to relational databases, I'm using mysql. I have two SQL databases which have about 70% tables in common, in which about 70% of fields are common. It could make sense to have only ...
Victor's user avatar
  • 101
2 votes
0 answers
62 views

In a multi-level one-to-many relationship, is it appropriate for the lowest entity to record all IDs in the upper layer?

Top level - company create table company( id unsigned tinyint not null auto_increment, parent_id unsigned tinyint, ) Next level - department create table department( id unsigned smallint not ...
Ice_Wift's user avatar
0 votes
1 answer
34 views

Why would an "articles" table (with no relationship to any other table) have a primary key?

Let's say that I have an articles table that have two columns: title and content, and let's say that this articles table don't have any relationship with any other table. Why would this articles table ...
user247763's user avatar
6 votes
1 answer
774 views

Unused columns in WHERE clause

I found this query in our codebase: DELETE FROM "Foo" WHERE ("Foo"."Id", "Foo"."CreatedAt") IN (SELECT "f"."Id", "f".&...
lonix's user avatar
  • 195
0 votes
0 answers
332 views

Weak Entity with Primary Key?

I have the following E-R diagram to refer to: I have a question posed to me that entity 4 IS a weak entity due to one of its relations. However, from what I see, entity 4 has a composite primary key ...
Chris Calvani's user avatar
1 vote
1 answer
314 views

Simple and Composite Candidate Key and Nulls

One of the differences between a candidate key and a primary key is that "candidate keys can contain nulls." I have been unable to find a more precise definition of what this means. One ...
Ryan R. Rosario's user avatar
0 votes
1 answer
285 views

Relational Database - How to handle many-to-many-to-many relation

I am creating an ERD where i have the following strucutre: A tenant can have multiple users. A user can be in multiple tenants. A user has multiple permissions. What is the best way to also have the ...
Guido's user avatar
  • 11
-1 votes
1 answer
639 views

Why can't Many to Many relationships exist in relational database management systems?

While reading Oracle 11g Sql by Joan Casteel, the author mentions that many to many relationships couldn't exist in relational databases. I was wondering what the reasoning behind this fact was.
Kevin Bai's user avatar
1 vote
1 answer
2k views

How to insert various records from multiple tables with a condition

I am creating a relational database and I have 2 tables currently ( Staff and Student) Staff Looks Like this StaffID Class TotalPhonesConfiscated 1 S201 1 2 S202 0 3 S203 1 Student Looks like ...
Ryan Gill's user avatar
1 vote
1 answer
17 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 ...
Dansekongen's user avatar
-1 votes
1 answer
391 views

How can I prove / disprove If A ↠ B then AC ↠ B

If A ↠ B then AC ↠ B is it true or false and if so can have example why?
omer's user avatar
  • 1
-1 votes
2 answers
178 views

Database schema - Set Limit values in correlation to groups and/or it's members

Provided there are pre-existing tables (diagram attached below). They each have numerous use-case as far as potentially related attributes. Still, I am at a roadblock following best practices with ...
Marcin Koziel's user avatar
0 votes
2 answers
348 views

Database: Splitting tables based on logically grouped optional columns

I keep having this argument with my management about splitting the tables. I prefer splitting a database table to multiple tables based on attributes that can be grouped together. The columns which ...
user2354302's user avatar
0 votes
0 answers
57 views

Is this a solid database design that passes 3rd normal form?

I am a tennis coach and created a small database to track student testing. I have several programs( beginner, intermediate, advanced). And Throughout the year/season, they are divided into four 8 ...
Jason's user avatar
  • 1
0 votes
1 answer
147 views

Data model for entities with a relationship to both guest users and authenticated Users

I am working on an application in which users can report security incidents.The idea is that everyone in an organisation has an account and can report an incident by logging in. Some of the users have ...
Just van der Veeken's user avatar
0 votes
1 answer
96 views

Must tuples of a relation and their referents be in a one-to-one relationship?

Figures 3.a and 3.b, section 1.4, page 381 of Edgar Codd’s 1970 landmark paper ‘A Relational Model of Data for Large Shared Data Banks’ presents a set of relation schemas (unnormalized in figure 3.a ...
Géry Ogam's user avatar
0 votes
0 answers
133 views

Review of my Grade Calculator Database Design

I'm currently making a Grade Calculator which will be used by students of a university to calculate their own grades. I'd greatly appreciate feedback on the design I've made. Do you see any obvious ...
George Austin Bradley's user avatar
0 votes
2 answers
129 views

Unique relationship attribute for every pair of entities

I have entities "Student" and "Course" and they are connected with relationship many-to-many called "Exam". The relationship "Exam" has an atribute "Grade&...
m_delx's user avatar
  • 3
0 votes
1 answer
269 views

How can I categorize entites by their age in an entity relational diagram?

I am designing an entity relational diagram and I need to categorize entities in groups by their age. What I have is an entity of Person and some personal attributes about it. But I want to have ...
user avatar
3 votes
2 answers
246 views

Why does metadata have to stored in table cells according to Codd's 12 rules

Among Codd's 12 rules for Relational Database Management Systems is Rule 1, which states the following: Rule 1: Information rule All information(including metadata) is to be represented as stored ...
Anis LOUNIS aka AnixPasBesoin's user avatar
0 votes
0 answers
33 views

How does DBMS ensure durability without flushing

I was watching this video, and at a certain point (don't recall the exact minute) the speaker says that the DBMS doesn't immediately flush the file when updates happen. He explains that IO operations ...
DT1's user avatar
  • 115
1 vote
3 answers
387 views

Does relational design discourage splitting tables unnecessarily?

It's been a long time since I studied relational design, but I had a vague memory that it encourages not splitting a table unnecessarily. For instance, given the functional dependencies K -> A K -&...
bluenote10's user avatar
0 votes
2 answers
4k views

How to normalize a table with multiple cells that have multiple values?

So I'm doing a task where I take a massive list (30,000+) of movies on Wikipedia that have multiple columns (such as the films name, the genre, the cast, the plot etc.) and upload it into ...
L M 's user avatar
  • 13
1 vote
3 answers
552 views

Is it allowed to for two tables to have two types of relationships between them? [duplicate]

I have been going back and forth working with relational and no-sql databases for some time now and my questions may be the result of mixing the way of thinking about how to approach a problem. So ...
roostaamir's user avatar

1
2 3 4 5
10