FAQ Database Discussion Community


How to convert JOIN SQL query to relational algebra?

mysql,relational-algebra
Hi I'm hoping to get help with a really annoying problem. I've been round in circles with this question but I am really struggling to convert this SQL query into its relational algebra equivalent. Query: SELECT staff.STF_FirstNames AS `Doctor First Name`, staff.STF_LastName AS `Doctor Last Name`, patient.PAT_FirstNames AS `Patient First...

expressing constraints in relational algebra

relational-algebra
I need to express this constrain in relational algebra: I have some table with one column with all possible values: ALL_VAL and table with some values from ALL_VAL that not mach some rule: NOT_FIT_VAL and I can calculate FIT_VAL = ALL_VAL - NOT_FIT_VAL what i need is a constraint: in...

Finding the Candidate Keys of a Relation Using the FD's

relational-database,relation,relational-algebra,functional-dependencies,candidate-key
I have definitely checked out many different related posts, as suggested when creating this question. I have also done different sample problems from online sources as well from a similar problem. However, I am stuck on the problem below specifically. Given the following relation R and the set of functional...

Relational Algebra and Confusing one Complex Examples

sql,database,database-design,relational-database,relational-algebra
We have 3-Relation: Students(sid, sname) Courses(cid, cname, dept) take(sid, cid, grade) We want to find student numbers of students whose these students take all courses that present in 'CS' department. why (line 4) is the answer of this query ? anyone could say differ from (line 1) to (line 3)....

Unable to join 3 tables properly

mysql,relational-algebra,natural-join
While understanding natural joins, I came across the query: Find the names of branches with customers who have an account in the bank and live in Harrison The relational algebra expression from the book as follows: Implementing the same with the query: select distinct a.branch_name from depositor d, account a,...

How do I create a 4VL “boolean” type in PosgreSQL?

postgresql,logic,relational-database,relational-algebra
I am looking for a type that would have both TRUE and FALSE as per the normal boolean type, NULL (also as per the existing implementation, Codd's "A-Value" or Applicable unknown) and NA (Codd's "I-Value" or Inapplicable). Example: imagine you have a set of medical tests for patients as attributes...

Relational Algebra( The pizza conundrum)

database,rdbms,relational-algebra
I came across a practice paper on relational algebra of Stanford University with relations as:- Person ( name, age, gender ) name is a key. Frequents ( name, pizzeria ) (name, pizzeria) is a key. Eats ( name, pizza ) (name, pizza) is a key. Serves ( pizzeria, pizza, price...

What is the shorter verb for “establishing a many-to-many relationship”?

many-to-many,terminology,relationships,relational-algebra
When we establish a one-to-one or many-to-one relationship, we can call it mapping. For example, we map a spouse to his/her spouse or each child to its parent. But what would be the verb singifying an establishment of a many-to-many relationship, underlining that it is not a 1+ to 1...

relational algebra

relational-database,relational-algebra
here is a example relation table I constructed from my relations. Assignment aID description 1 A1 2 A2 3 A3 #where aID is the unique key Group gID aID 1 1 2 1 3 2 4 2 5 3 #where gID is the unique key , represent groups works on...