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
20 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 ...
user avatar
  • 1
2 votes
0 answers
30 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 ...
user avatar
0 votes
1 answer
29 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 ...
user avatar
6 votes
1 answer
732 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".&...
user avatar
  • 175
0 votes
0 answers
31 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 ...
user avatar
1 vote
1 answer
79 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 ...
user avatar
0 votes
1 answer
53 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 ...
user avatar
  • 11
-1 votes
1 answer
66 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.
user avatar
1 vote
1 answer
21 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 ...
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
-1 votes
1 answer
68 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?
user avatar
  • 1
-2 votes
2 answers
41 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 ...
user avatar
0 votes
2 answers
27 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 ...
user avatar
0 votes
0 answers
49 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 ...
user avatar
  • 1
0 votes
1 answer
28 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 ...
user avatar
0 votes
1 answer
52 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 ...
user avatar
0 votes
0 answers
50 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 ...
user avatar
0 votes
2 answers
47 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&...
user avatar
  • 3
0 votes
1 answer
36 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
175 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 ...
user avatar
0 votes
0 answers
26 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 ...
user avatar
  • 115
1 vote
3 answers
254 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 -&...
user avatar
0 votes
2 answers
902 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 ...
user avatar
  • 13
1 vote
3 answers
119 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 ...
user avatar
0 votes
1 answer
82 views

Is Star/Snowflake database design good for applications? What is the alternative?

I need to solve an exercise for a pharmaceutical company, they ask me to create a database structure from scratch given a few informations. Because I want it to be scalable and "future proof"...
user avatar
-1 votes
1 answer
28 views

Job Opportunity and difficulty (or not) for me to learn to use msaccess and surveygizmo/alchemer [closed]

First, if my question fits better elsewhere, please advise. My question is: Based on your experience with relational databases like MSaccess and perhaps survey tools like Alchemer (formerly Survey ...
user avatar
0 votes
1 answer
616 views

Immutable field/cell in Postgres

Is there a way to create an immutable field/cell in a Postgres record? AKA, only allow the field to be written once, perhaps just on insert? Use case: I have a "uuid" field for a record, and ...
user avatar
-1 votes
1 answer
19 views

Help designing a Table(s) with a single message to multiple placeholder values, with new placeholders added occasionally [closed]

The basic situation is I have a single 'message' table, and currently our design for this is a single row, with all placeholde values stored against the row at generation, so they are available for ...
user avatar
4 votes
3 answers
1k views

Why Cassandra is not considered a relational database?

Read this answer Relational databases are based on the relational model, an intuitive, straightforward way of representing data in tables. In a relational database, each row in the table is a record ...
user avatar
0 votes
2 answers
341 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
70 views

"Tuples in a weak entity set are partitioned according to their relationship with tuples in a strong entity" - meaning?

http://web.cs.ucla.edu/classes/fall04/cs143/solutions/chap2.pdf In the above link, there is the following statement - "Tuples in a weak entity set are partitioned according to their relationship ...
user avatar
2 votes
1 answer
481 views

Incorrect relationships formed in EER diagram by reverse engineering the database script

I have a database with 6 tables. I tried to view the relationships between the tables by using EER diagram. I observed that all the one-to-one relationships were converted into one-to-many ...
user avatar
  • 129
0 votes
1 answer
721 views

Data Schema For Stock Control / Multi Source Inventory

I'm working on a project that involves stock control with multiple stock sources and sales channels. The overall hierarchy I've got so far looks like this; Sales Channels <---- Allocated Stock ...
user avatar
  • 101
3 votes
2 answers
613 views

One and only one relationship - ER diagram to relational schema

I'm taking this term a DB course as part of my CS studies. This week we began studying the subject of ER diagrams, which I find a bit confusing. I have some uncertainty about the picture above (Note: ...
user avatar
  • 33
0 votes
2 answers
46 views

Multiple Primary-Foreign Key connections between Tables Redundant?

I have two tables, Reviews and Critic I'm pretty new to RDBMS and I was wondering if the connection between Review.rID and Critic.Review is redundant? My reasoning is that a single critic can have ...
user avatar
2 votes
1 answer
75 views

In what cases is using ClickHouseDb and the like a neccessity?

An open source for website analytics - https://github.com/plausible/analytics They use Postgresql and ClickHouseDb. When it comes to web analytics, there're tons of events going that need to be ...
user avatar
-1 votes
4 answers
156 views

How to store a (record which holds a) reference to any other column (attribute) in another table (relation)

TL;DR: If the database schema should hold all the business logic, how is it be possible to specify that an attribute type is a reference to a specific attribute, instead of a specific record (as is ...
user avatar
0 votes
1 answer
22 views

How to add an additional table over two one to many relations tables?

I have two tables TableA and TableB which have a relation of one to many Later I am told that there must be an additional table that links the initial tables with additional information. To carry ...
user avatar
0 votes
0 answers
29 views

Can a table be un-normalizable or am I misunderstanding the theory

I was considering normalizing a flat table (SQLite if its relevant) I'd been working with in a small personal project and it just didn't seem to make sense. Consider an example table like below. Each ...
user avatar
  • 1
1 vote
2 answers
555 views

RDBMS: Proper way to store data - comma separated variables or in different fields or tables?

Fundamental question that I cannot seem to find an answer on. I have a database that stores line items from receipts along with the username and receipt number. Right now the lineItem column is just ...
user avatar
  • 113
1 vote
1 answer
35 views

How can I calculate the cost of the query, if there is a `between` condition?

How can I calculate the cost of the query, if there is a between condition? Select * From A Where A.id between 10 and 50 If Index not exists and there is only one condition: Search in B+ tree to ...
user avatar
  • 197
3 votes
2 answers
480 views

Incorrect result when using 'case when count()=0' & 'where'

I would very appreciate if someone could help me out with this query. I can't seem to get the correct result when using case when count()=0 & where I work with SQL Server, with a DB of a system ...
user avatar
  • 197
1 vote
1 answer
27 views

Storage strategy for combination of all table items

Let's say I've one table with items with the following fields: id_item name description & one table with the user information, following like: id_user email name Now I'd like to let vote my ...
user avatar
2 votes
3 answers
2k views

How do you determine the direction of a relationship?

Suppose I have the following relationship diagram: How would you describe the relationship determined by the red line? Reading from left to right you would say each order has only one customer so it ...
user avatar
1 vote
1 answer
44 views

Is it possible to enforce corresponding hierarchies?

I constructed the following toy example to illustrate my question. The left side of the schema describes a an abstract product consisting of its parts. The right side of the schema describes actual ...
user avatar
1 vote
0 answers
329 views

Can there exist Tables with no Non-Prime Attributes? If so, are they always normalised to 3NF?

Can there exist a table with no non-prime attributes? Here is an example of a table which I believe has no non-prime attributes: I came to this conclusion because the list of attributes in the ...
user avatar
  • 111
1 vote
1 answer
43 views

Database design where % of rows have unused attributes/columns

Is there a theory/practice that promotes a design by analysing the usage of attributes of a table, such that given a threshold of unused columns over a percentage of rows would suggest that the ...
user avatar
1 vote
0 answers
152 views

Properties of grouping in relational algebra

The properties of relational algebra (commutativity, associativity, distribution) allow us to take a relational algebra expression and transform/rewrite it into another one which is logically ...
user avatar
  • 407
0 votes
0 answers
71 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
0 votes
2 answers
524 views

Delete duplicate keys with relation algebra

Hi I am new to databases and relational algebra. I was wondering if there is a way to remove the tuples from a table using relational algebra that have the same keys but different value. e.g. I want ...
user avatar
  • 3

1
2 3 4 5
9