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.

65 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
656 views

Convert query in words to relational algebra

I have a follow-up question to a question I have previously asked on SO. Instead of the query from my initial question, I want to convert the following into relational algebra: List the names and ...
97 views

Can the Chase test algorithm only modify attributes on the right side of a functional dependency?

I'm attempting to apply the Chase Algorithm to determine if a decomposition is a lossless join decomposition. Functional Dependencies = {A → C, B → D, C → D, DE → C, CE → A} Here is my initial ...
85 views

Third Normal Form (3NF) Decomposition Scenario

I am trying to understand what are the steps to check if a decomposition of table is in 3NF. There is a specific exercise I'm trying to solve with no success. Given that R={A1,A2,A3,A4} and F={A1→...
422 views

Counting in Tuple Relational Calculus

Given the following schema: Staff (sid, sname) Project (pid, pdesc, pfrom, pto) Asset (aid, acat, adesc) Workfor (sid, pid, wfrom, wto) Assignment (aid, sid, pid, afrom, ato) Note: The bold ...
170 views

Difference Between Implication and Conjunction in Domain Relational Calculus

I was reading my notes, and I came across this: Another example would be to find the names of the lecturers teaching all modules. We might reach for the following incorrect expression: {<N&...
2k views

How do you perform the chase test?

Trying to follow the chase algorithm as I understand it, If two rows agree in the left side of a functional dependency (FD for brevity), make their right sides agree too. Always replace a ...
64 views

What process would you use to determine references on a database that has no integrity?

Imagine you inherit a database which has a bunch of tables, no documentation and zero referential integrity. Now you're trying to find out what are the various relationships between different tables. ...
127 views

Table Structure: 2 Related Entities Share the Same Entity

I was hoping I could get some advice on my table structure. Im writing a simple workout tracker for me and my buddies. These are the requirements: Multiple users A user can have multiple workouts A ...
39 views

Design issue in transitive dependencies between tables

This is a made-up scenario, but I imagine that it can be of general interest, so I'll post it here. Imagine the following business rule: A course has a grade scale that determines what grades a ...
16 views

Relational Algebra: how to express the combination of aggregation and projection?

Here I have a table, I would like to query the average salary of departments, the SQL statement should be select dept_name, avg(salary) from employee I try to express this SQL in relational algebra....
47 views

How To Query Databases in Subject-Predicate Format?

I have csv data in this format: id fieldname fieldvalue -- --------- ---------- 1 fieldA A1 1 fieldB B1 2 fieldA A2 2 fieldA B2 If I upload this to MySQL, how can I ...
301 views

How to write group by and having in a relational algebra interpreter?

I am practising writing relational algebra (RA) expressions in RA interpreter from Duke, but I can't figure out how to represent group by or having (from SQL). I have this expression, but I need to ...
72 views

Questions Concerning the Chase Test

For the question above, my work for each of the questions is below the concerns. Here are my main concerns: Does the order in which you use the relations matter? Can you end up with less tuples with ...
62 views

Assessing the normal form for a relation with a multi-valued attribute

Assume that you have designed the following schema of relations: COURSES (CID, CNAME) STUDENTS(SID, SNAME, FAV_CIDS) However, you can not have a relation with set valued attributes (Did not really ...
127 views

Understanding multivalued dependencies

This is my first time studying multivalued dependencies and there is a question that was posted by my lecturer as a class exercise. I have an answer, but I'm not 100% sure it was right. Please let me ...
26 views

Do Selection attributes have to appear in Projection list in Relational Algebra

In extended relational algebra (aggregation being allowed) do you have to project all attributes that you use in a statement? So for example in the query below the attributes A.FO_ID and A.Arrival are ...
166 views

Lossless Join Decomposition Criteria

On Wikipedia, it says: The decomposition is a lossless-join decomposition of R if at least one of the following functional dependencies are in F+ (where F+ stands for the closure for every ...
53 views

Decomposition and loss of dependencies

I'm lost in the sea with the following example of decomposition without loss of dependencies... Let be the dependencies F= {A → BC, C → AD} R is decomposed in R¹(A,B,C) & R²(A,D) I want to know ...
2k views

Review the ER diagram regarding a National Football Team

We need to store information pertaining to football players who are or were members of the national team. For each player we store the following: first name, last name, date of birth, debut ...
75 views

Keys of a relation

I got relation: R = { (ABCDEF) , (A B F -> C, B C -> F, F -> A, F -> B, D E -> E, E -> D)} keys of this relation are: {BCE}, {EF} But I don't get it... why? Why not only {EF}.. it got less ...
1k views

The nature of the relationship between two tables in MySQL

Good day. I'm designing a database for a research project where we're predicting whether or not young female athletes will rupture their ACL(s) based on the nature of a test jump recorded with a ...
5k views

Schema for an RBAC (Role-based Access Control System)

I want to implement an RBAC, Flat based. I've decided to base my system on the NIST standardization model. Although all fine and well, I have an inclusion to that design. Instead of a hierarchy ...
19 views

Using relational algebra to check a condition for all

I encountered this question while revising for my finals exam on database theory. The following database contains information about car repair workshops. The following tables are used: ...
57 views

Finding all possible minimal covers

I have a relation schema R = {A, B, C} and the following functional dependencies: A → B A → C B → A B → C C → A C → B How many different minimal covers can I derive from this relation schema? I have ...
113 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,...
74 views

Equi Join On Union- and Intersection-Compatible Relations

Suppose that I have two union- and intersection-compatible relations; i.e., R1(A,B) and R2(C,D) as: Now , I want to find the join of both relations with equality conditions A=C and B=D. I have ...
17 views

Finding Exclusive Pairings in Relational Algebra

classId | studentId 0 0 0 1 0 2 1 0 1 1 1 2 2 2 How do you find the pairs of students (s1, s2) that ONLY have classes with ...
227 views

Quantifiers in Tuple Relational Calculus (Existencial and Universal)

Suppose this state for the relation schema Company I'm stuck trying to understand how, why and when I should use Quantifiers (Existencial and Universal) Examples: Here I understand how the ...
225 views

How does one map nested multi valued attributes?

Let's say one has an Entity E. E has a multivalue Attribute M1 and a simple attribute A1. However M1 consists again of a multivalue Attribute M2 and a simple Attribute A2. How would one map this ...
449 views

Cartesian product and Division in Relational Algebra

Let be the following database sketch: Cineroom(Name, Hour, Name) Film(Name, Director, Actor) Saw(Spectator, Name) Produce(Producer, Name) Likes(Amateur, Name) How to express, ...
132 views

How to express inclusive and exclusive relations in relational algebra and relational calculus?

Let be the following simplified database sketch: R1(P,S),R2(S,T) and R3(T,S) with P= people S = Sport and T= Sports Center How to find in relational algebra and relational calculus which couples ...
146 views

ERD Diagram based on Crow's Foot model for Milky Way Jewelry

this was on my final exam this past winter exam season, in search for the answer since i got it wrong: Draw an ERD diagram based on the Crow's Foot model for a database to support the basic ...
105 views

Relational Model

I would really appreciate if you could check my answer for a relational model question. I just started learning. So please bear with me and please guide me through the right process. Consider the ...
77 views

Transaction Table in Personal Finance App

I'm a noob designing a Personal Finance App to teach myself Rails. This is just for learning purposes, but I actually intend to use it to replace my current system in Google Spreadsheets. I want to ...
99 views

Do relational databases typically understand '1' and '0' as booleans?

I'm working on a code library that helps users build database searches from form inputs (a layer on top of an ORM). I want it to be compatible with most relational databases. I currently have a ...
80 views

Type of relational/object-oriented database with improved joins for object graphs?

I would like to know if there is a specific name or term for the kind of database described below: I notice one of the biggest problems when working with relational databases and object trees/graphs ...
543 views

Normalization and multivalued attributes

I am designing a relational database in mySQL - a library management system. I want to show examples of the data in 1NF, 2NF, 3NF, BCNF, etc. My example of 1NF looks something like this 'A relation ...
45 views

design database with 2 simillar tables

I have a database which has product_sell and product_buy tables, these two tables are different in a few fields and each one has own comment table product_sell >---< product_sell_cmt ...
127 views

Database schema design for individual configurations

I'm trying to design a database schema that allows me to store customer custom built products. As a simplified example: A user can buy a cupboard, draws, boxes, and dividers. A cupboard has 2 tiers. ...
259 views

In terms of relational databases is a Relvar the equivalent to a Schema?

I've been reading up on relational databases and the term Relvar and schema keeps coming up. From my understanding: A relvar is a variable holding a relation. A schema is a logical definition of a ...
1k views

What are the different types of binary relationship types?

I'm new to databases and while studying questions on it, I've come across one that I can't find the answer to. Define the three different binary relationship types that are common in relational ...
101 views

Relational or non-relational database for a system to pass objects on?

hopefully this is the right place to ask this kind of question. I am working on a system that focuses on helping people give away things that they don't use anymore. So, an object typically has the ...
22 views

Storing generated documents that can not be updated by changes in relationships

I have a system running with PostgreSQL and Yii Framework, which generates a few medical documents that, once ready, can't be changed. For example: If my full name comes out on this document today, ...
584 views

How to join the tables in mysql to get wall messages and comments with name of person ? Only user and his friends messages

I have four tables in my mysql database as shown in the image url provided. I want to select data from the tables without duplication. I want to show messages and comments on wall according to the ...
100 views

Why NOSql should be more performant than RDBMS under structured data loads?

The main reason NoSQL dbms have become so common is the need of storing unstructured data where a Relational database instead would require carefully designing a database schema and fitting data into ...
178 views

Can XML columns in Oracle/MS SQL Server replace document oriented databases to some extent?

Just a strategic question: I am currently working with frequently changing data schemas and it takes a lot to keep track of versions and specific content. I do, however, have a classic OLTP ...
1k views

Closure of attributes definition clarification

A databases book I am using states [1]: The closure of {A1, A2, ..., An} under the FD's in S is the set of attributes B such that every relation that satisfies all the FD's in set S also satisfies ...
22 views

Proof Full Outer Join associative and Commutative

I'm trying to prove to myself that the order of full outer joins doesn't matter, but, in an abstract sense, I'm coming up with nothing. How would one go about proving that the order of a set of FULL ...
7 views

Understanding properties of multi valued dependencies

I understand following informal definition of multi valued dependency: If multi valued dependency is α↠β, then whenever the tuples (a,b,c) and (a,d,e) exist in relation r, the tuples (a,b,e) and (...
7 views

How functional dependency imply multi valued dependency?

I understand following informal definition of multi valued dependency: If multi valued dependency is α↠β, then whenever the tuples (a,b,c) and (a,d,e) exist in relation r, the tuples (a,b,e) and (...