# For which instance are those relational queries equivalent?

I have the following problem and i hope you could help me.

Given is the following database schema,

Student($$\underline{\text{MatNo}}$$, SName)

Course($$\underline{\text{CNo}}$$, CName)

Took($$\underline{\text{CNo -> Course, MatNo -> Student}}$$, Score)

And the two the relational queries.

a) γ count(∗)→cnt ( π CNo (Course))

b) γ count(∗)→cnt ( π CNo,CName (Course))

My question is are the two queries equivalent assuming sets or are they equivalent assuming multisets?

I thought they are equivalent if we assuming sets and not equivalent if we assuming multisets. Could I be right? My problem is that I do not understand the difference between two keys in the query and just one key.

• Has no body an idea? – Joshua.M Jun 19 at 13:24