sql,sql-server,relational-algebra

The following approach starts by putting the list to find in a table (well, a CTE) with each shape and a count of the number of times. Then, it does various checks. The first is that each shape in shapes appears the right number of times. This is where inner...

join,relational-algebra,cartesian-product,functional-dependencies,lossless

It helps if we demystify the concept of lossless decomposition a bit: it really just means that joining R1, R2 and R3 should yield the original R. Do you know the chase test a.k.a "the tableau method"? It's a cool algorithm to test for losslessness. It's easy to program, and...

database,rdbms,relational-algebra

The difference between the two : "Find the names of all people who frequent every pizzeria serving at least one pizza they eat." has "every pizzeria serving ..." as qualifying condition. Let's say the set of these pizzeria's is {P1 P2}. Let's say the set of pizzeria's I frequent is...

Strictly speaking, the expression "FIT_VAL <> {empty}" is not a relational expression (it does not produce a relation, but a truth value instead), therefore it is a bit problematic to consider such expressions as being "valid relational algebra expressions". But that is strictly speaking, and I don't know how much...

Maybe you need some looks like: SELECT staff.STF_FirstNames AS `Doctor First Name`, staff.STF_LastName AS `Doctor Last Name`, patient.PAT_FirstNames AS `Patient First Name`, patient.PAT_LastName AS `Patient Last Name`, patient_makes_appointment.APP_DateTime AS `Appointment Time` FROM staff, doctor, patient, patient_makes_appointment WHERE staff.STF_ID = doctor.STF_ID AND doctor.DOC_ID = patient.DOC_ID AND patient.PAT_ID = patient_makes_appointment.PAT_ID ...

relational-database,relation,relational-algebra,functional-dependencies,candidate-key

The keys here are ABD, ACD and BCD. You were on the right track. After dividing the attributes in three groups, the attributes under "only on the left" list are always a part of the key. Here that attribute is D. "I also tried computing the closures of (AD), (BD),...

sql,database,database-design,relational-database,relational-algebra

Another way to phrase the fourth line is: all students except ( all combinations of students and CS courses except all taken courses ) The set between brackets contains all student + CS course combinations that were not taken. Subtract this from all students, and you get the students that...

relational-algebra,functional-dependencies

The discussion of why your answer is wrong can be found in the comments. The correct answer is #4: only in this answer A, B and C are superkeys as in the original set of functional dependencies. In #1 A is not a superkey (e.g., A -> B does not...

many-to-many,terminology,relationships,relational-algebra

you can distribute, permute, or combine multiple groups to define many to many relationships. Mapping a group to other groups does not explicitly state if the members are crossed or not, like in a Cartesian product. Permute is a more specific case because the order matters, but both permutations and...

database,table,projection,relational-algebra

If I remember relational algebra correctly it should be something like this: π name (σ age = 34 (Person)) where π is projection and σ is selection. This would be equal to select name from Person where age = 34in SQL and can be read as from Person select relations...

mysql,relational-algebra,natural-join

You didnt make join for customer table, your query should be like this Select a.branch_name From depositor d Join account a on d.account_number=a.account_number Join customer as c on d.customer_name = c.customer_name Where c.customer_city='Harrison' I dont know how to join customer table to depositor maybe by name or if you have...

relational-database,relational-algebra

Please note how simple things get when you name things clearly. gID in grader could easily have been the id of the grader... which also starts with g. here is one way to achieve what I understand to be your solution. I have renamed things for clarity. declare @Assignment table...

postgresql,logic,relational-database,relational-algebra

You cannot extend (or create a new, extended type of) boolean, or any other scalar types that way. But you have 2 alternatives: 1. Create an enum & enhance it. Like you tried, you could create an enum (ordering is important: it'll determine how it should be ordered by order...

mysql,sql,join,left-join,relational-algebra

If you have a LEFT JOIN and the right table returns nothing (NULL) all the fields belonging to the right table in the projection are simply NULL, but you still get your result from the left table. RIGHT JOIN has the opposite behavior and INNER JOIN will not return anything....