# Tag Info

10

Given the schema Students(id:integer,grade:integer), you can solve the problem in tuple relational calculus by using the negation operator (¬). {T1.id | ∃T1 ∈ Students ¬(∃T2 ∈ Students (T2.grade > T1.grade))} This would return the id of all students in T1 where there is no student in T2 with a higher grade. Because T1 and T2 are from the same relation, ...

6

I agree with @Erik, these instruments are essentially equivalent, but I am going to add a few more ideas about this topic. Context In order to provide more context, it is necessary to have an authoritative definition for both terms. So, here are some excerpts from the relevant paper entitled Relational Completeness of Data Base Sublanguages, which was ...

5

A tuple relational calculus expression should be written with the usual language of first order logic. In this case, for instance, you could write: { [e.Name, d.Name] | Ǝ e ∈ Employee, Ǝ d ∈ Department . e.Dept_no = d.No } (a part from minor variations on the notation used, like “:” instead of “.”). The idea is that you obtain the result of the query (a ...

5

https://en.wikipedia.org/wiki/Relational_calculus: The relational algebra and the relational calculus are essentially logically equivalent: for any algebraic expression, there is an equivalent expression in the calculus, and vice versa. Basically they are two tools/methods that produce effectively the same output. Learning one might give insight into the ...

3

I had to look up wikipedia because I did not know Tuple Relational Calculus. I did only skim over that article. There are differnces in notation as far as I can see. But after activating my knowledge about formal logic I think you are right because ∀r ∈ Rainfall (...) is true if Rainfall does not contain any tuples. In this case your query reduces to {...

3

<> is not defined in relational calculus (or anywhere in math). It however is often used in programming languages (like SQL) to express "not equal". The correct sign would be the equal sign with a vertical line through its center. (= and | on top of each other).

3

∃s (student(s) ∧ s.sex = ‘F’ ∧ s.deptNo = d.deptId) For some s, s is a student & s is female & s is in d's department. ~∃s (student(s) ∧ s.sex = ‘F’ ∧ s.deptNo = d.deptId) For no s, s is a student & s is female & s is in d's department. ~∃x P is ∀x ~P. So ~∃x (Q ∧ R) is ∀x (~Q V ~R) is ∀x (Q → ~R). We get: ∀s (student(s) → (s.sex ≠ ‘F’ ∨ ...

2

You have a number of "mistakes" in your SQL, that should be addressed before you translate it to relational algebra. You don't have a FROM in your SQL. You shouldn't start by JOINing. You seem to assume that train_code is a text, yet you define it as an integer. Your table definitions don't define a type for train_code in the journey table, nor for ...

1

The writing is poor. "Declarative" is informal & they use it it in two ways. The general meaning is, "describe a result (not a process)". But many descriptions of results have an obvious interpretation as a process. So those "describe a result & a process" whether or not they were intended to. The first says "the notations can be used to describe ...

1

Not knowing your full situation, I recommend something like this. The foreign keys should create the dependencies you need. If your SQL structure is already in a tabular format, you might consider putting this information into temporary tables--like the ones below. But it looks like your tables are there according to your assertion comment. From what you ...

1

In addition to Ziggy answer, if you want to make this diagram work, you need to edit it, for example you should create a third table called cleint_order and this table has primary key from Client table and idproduct from product table since one client may have one or more product and one product can be ordered from many customers. useful link: https://...

1

UML class diagrams do not include relations in a class' attributes list, so when creating database tables representing those classes, the database designer must identify and specify them, much like the software developer must create the pointers and lists to support the related objects. In your diagram, Commande relates to Client but does not explicitly ...

1

As Martin said, this means "not equals"

Only top voted, non community-wiki answers of a minimum length are eligible