We’re rewarding the question askers & reputations are being recalculated! Read more.

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
5
votes
4answers
532 views

How can I represent discrete ages in a relational database?

I am using PostgreSQL to store data on a Person. I need to store whether each Person is capable of teaching a Child of each age year, from 0-17. The ages are discrete values, and a Person can have any ...
5
votes
2answers
2k views

Creating relationships between tables that where not specified in the given UML diagram

Good evening! I'm working on designing my very first actual database from the following UML class diagram (in French unfortunately): I'm at the point of creating the relational sketch of it which I ...
0
votes
1answer
5k views

Grouping in relational algebra with more than one grouping attribute

So I am having a bit of trouble understanding the Grouping operator, Ɣ. If had a the relation Sales(employeeId, date, salePrice) and I wanted to list the largest salePrice for each employee per day, ...
0
votes
1answer
89 views

Explaining how to design a database to model the stocks of a firm to my Grand'ma

My teacher always asked us to create simple but precise databases. Being able to explain it simply but not without leaving the theory "to your wise but aged loved Grand'ma"... I have to create a ...
3
votes
0answers
78 views

What is the difference between a field and a column? [duplicate]

Although I have always regarded the terms as interchangeable, I have read somewhere that they’re not the same. I suppose this means that a record is not exactly the same as a row either. I teach that ...
3
votes
1answer
391 views

Why are multivalued dependencies named that way?

I'm doing a relational design course on Stanford open courseware. I understand why functional dependencies are named that way - A->B means B is specified when A is specified, or in other words, the ...
7
votes
1answer
643 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 ...
1
vote
1answer
306 views

Counterexample to demonstrate there are no functional dependencies

For instance in the following example Let be F={AB→C, B→D, CD→E, CE→GH, G→A} Do we have AB→G? We don't have any functional dependencies. I am able to show a functional dependency when it ...
0
votes
1answer
100 views

What are the conditions for a functional dependency to exist?

Let be a relation R of scheme: R(A,B,C,D,E) and r an instance of the relation. What functional dependencies verify r? Observing the functional dependencies that r verify are doesn't show that they ...
2
votes
1answer
178 views

Lost (and found?) on 4NF

I'm so extremely lost on 4NF it's not even funny. I've been reading on it for literally days and, except for about 15 minutes ago, I wasn't sure that I had even broken the surface. I think I might ...
1
vote
1answer
34 views

How to normalise a relation using functional dependencies

G = {{A,B}→{C},{B,D}→{E,F},{A,D}→{G,H},{A}→{I},{H}→{J} }. Which is a key attribute: {A,B} or {A,B,D}?
4
votes
1answer
162 views

Are three equalities on a join operation legal in relational algebra?

Let be the following database: Film(Title,Director,Actor) Produce(Producer,Title) Express in relational algebra the following questions: Which actors produce at least a Film they directed? ...
1
vote
0answers
446 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, ...
1
vote
0answers
131 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 ...
1
vote
1answer
73 views

how to represent what functional dependencies are?

I'm trying to understand how to represent what functional dependencies are: A1, A2,..., An → B If two tuples of R have the same attributes for A1, A2,..., An then they have the same value for ...
2
votes
1answer
76 views

Database design, 1-to-many or many-to-many?

Just a little background information pertaining to the question at hand: I'm developing an application for users to be able to log the work they have been doing hourly, to be compiled into a weekly ...
1
vote
1answer
59 views

Store a revenue based dataset in a relational database

I have several revenue based datasets with below structure: Subject 2012 2013 2014 2015 online marketing 54 50 60 80 website ads 900 850 ...
2
votes
2answers
365 views

How to model A Shop Database

I want to draw the ER model of a store which The scenario is like this: They have list of Goods and Some Seller which sells them to customers they want to know how much they get profit from their ...
4
votes
1answer
94 views

Make a relation of a table with three different category of id's table

I have an issue There a table that's called "Routing" this table is for routing a task for three category of object - Analyser (interne machine) - subcontractor (externe ) Manually (...
3
votes
1answer
63 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. ...
2
votes
1answer
240 views

Surrogate key resolution, or what am I missing in the Surrogate v Natural argument?

I've read a lot from both camps in the surrogate vs. natural key debate. What I am struggling to understand, and what seems to be glossed over, especially in explaining how surrogate keys are more ...
2
votes
1answer
87 views

Simple database structure advice

Newbie to dba. I'm creating a php/mysql inventory list and would like some advice before I start, on structuring my table(s) and database. The inventory database will eventually contain hundreds of ...
1
vote
0answers
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 ...
2
votes
1answer
101 views

If my understanding of BCNF is correct, how did we know that R1 was not in BCNF?

Given that R(ABCDE) AB->C BC->D CD-> E DE->A Since, B is the only attribute absent on the right-hand side, we would start with B. {B}+ = B . Not a CK. Next, we ...
0
votes
1answer
30 views

What should be the rule for excluding an FD from consideration while doing BCNF or any other Normalization?

Let us consider this example: http://www.mathcs.emory.edu/~cheung/Courses/377/Syllabus/9-NormalForms/examples.html At the first decomposition step, it is using A -> B C D E. On the next step, ...
2
votes
1answer
923 views

Should I look into alternatives to a relational database? [closed]

I am currently in the process of going through some PHP training with procedural code and will be doing a course in OOP with PHP right after that. The course will provide a solid starting point for me ...
0
votes
1answer
41 views

Name of ForeignKey Back Relation?

Table detail has a ForeignKey to table master. How to call the back relation? master has ??? to table detail I could not find a canonical word in wikipedia or other resources.
2
votes
1answer
452 views

Lossless join in 3NF

I was just studying about the 3NF and the BCNF and then encountered a statement that: 3NF ensures lossless decomposition while BCNF does not. How can we verify this using the basic definition of ...
2
votes
0answers
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 ...
1
vote
1answer
21 views

Meaning of the is unique clause here

Suppose I have two relations R and S and I execute the following query: Select R.* from R,S where R.a=S.a and is unique R What is the effect of the is unique clause here ?
2
votes
1answer
216 views

ERD to Relational schema

I'm new to DBM and I'm trying to learn it online. Honestly, I need some help with this. I don't know if I'm doing this right, and any help will be appreciated. This is my answer for i.
4
votes
3answers
6k views

Difference between an Entity and a Relation

I am currently reading about entities and relations and I can't understand the difference between them? According to Wikipedia we have an example of a relation like in the pic: This looks exactly ...
0
votes
1answer
55 views

Why repetition in join queries

Very dumb question, but bear with me, I am learning and am interested in the principles behind. So: I have a users table and a pages table. In this case, 1 user and 4 pages. If I join the two tables,...
2
votes
1answer
297 views

What would be the Candidate key (s) of this relation?

R(ABCDEPG) F={AB->CD, DE->P, C->E, P->C, B->G} To my consideration, the candidate keys are: AB, AG, CD, DE. Am I correct? Why or why not?
5
votes
2answers
1k views

Relation between first name and last name

I have some troubles understanding the relation between the a person's First name and Last name in a table. (In a Relational Model) I've read that the relation is of type: 1-1: They are linked ...
3
votes
1answer
196 views

IS-A relationship with only single sub entity

Hi I'm trying to design a database for a dictionary. The words has several fields like meaning, an example, and maybe a picture. but the words that are 'verbs' has three more special fields that the ...
1
vote
1answer
195 views

Collection of different types of data in a relational database

Let's say I have a table Cars (with columns such as model, make, year, etc.), a table Books (with columns such as name, author, ISBN, etc.) and a table Wines (with columns such as name, appellation, ...
0
votes
1answer
350 views

How to find functional dependancies from simply looking at a relational schema?

If only given a schema (table header, with primary key indicated), how do I find functional dependencies? My problem is that functional dependencies are determined in terms of the data stored in the ...
2
votes
1answer
444 views

How to maintain Database audits?

I am using MySQL database (with Django ORM). I want to maintain the database audits similar to StackOverflow, Quora, Wikipedia, etc. These websites maintain the revisions of the changes in the ...
2
votes
2answers
63 views

Understanding relations

Since english is not my first language i find hard to understand this paragraph that i'm reading from "Database Fundamentals" book. I'm trying to figure out, in practice, real world, what this really ...
2
votes
2answers
3k views

Relational Design - One table, two foreign keys or Two tables, one foreign key each

Looking for some advice related to optimal design in the following scenario. There is a Cases table (represents cases of inventory) There is a LocationInventory table (represents locations with ...
-1
votes
1answer
54 views

Basic relational algebra question

I'm new to this and have been given a database. I've been asked to write a Basic relational algebra formula which collects failed test results with a certain teacher and display the surname and code ...
4
votes
2answers
2k views

Best practice regarding concurrency for INSERT into a table with composite primary key?

Say I've got the tables users, teams and a teams_users junction table (team_ID, user_ID / composite PK). If I wanted to add a user to a team, what's the best option when it comes to performance / ...
0
votes
1answer
563 views

Storing shipping details in orders table

Have orders table and among columns the following: shipping type, shipping service provider, delivery type and shipping address. Let me explain what these are. User can choose between two shipping ...
1
vote
0answers
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 ...
0
votes
1answer
3k views

Help with removing duplicate reversed pairs in relational algebra

I have a listing of data that contains duplicate reversed pairs and I need to remove them.. Call them, name1 and name2. Where I have Tom and Mike, and Mike and Tom, such that this single pair is being ...
1
vote
2answers
123 views

Is my db too big for my server? Should I go nosql or stick with relational db management? [closed]

I have a mysql database that is about 22GB in size and has multiple tables with hundreds of thousands of records, my biggest table has 1.8 million records. The Database was not professionally designed ...
1
vote
1answer
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 ...
0
votes
1answer
1k views

How to create a one to one relationship

DROP DATABASE if exists test; CREATE DATABASE test; USE test; CREATE TABLE A( a1 int not null, a2 int, PRIMARY KEY (a1) ); CREATE TABLE B( b1 int not null, b2 int, PRIMARY KEY (b1) ); How can I ...
2
votes
1answer
199 views

Table to create Ids for one table to many table relationships

I have several tables that will represent an object that can be commented on. I would like to store all the comments in one table. To relate the other tables to the comments, I was thinking of adding ...