An analysis of a database example. Why is the σage>22 (Πs_id,score (SC)) option wrong?

Source: Internet
Author: User

I am a sophomore. In the recent period of time in the database review problems encountered a problem, as follows.

There is a relationship between SC (S_id,c_id,age,score), to find the number of students older than 22 years of age and scores, the correct relational algebraic expression is ().

Ⅰ.πs_id,score (σage>22 (SC))

Ⅱ.σage>22 (Πs_id,score (SC))

Ⅲ.πs_id,score (σage>22 (Πs_id,score,age (SC)))

The answer is I and III, and I did it myself at the time, three of them are correct. After reading the answer, always think I and II are not the same? Later Baidu, haha, this problem has appeared a lot, in different

The information, looked a lot, did not parse. For a time, Baidu has not helped me. Can only read the definition of the book by himself.

π, what is defined in the textbook is to take out the attribute columns to form a new relationship, or to form a new table. Suddenly, it dawned. If this is the case, in option II, first execute (πs_id,score (SC)) This sentence,

Then this new table there is no age column, only s_id and score, so, σage>22, in front of this sentence in a non-aging property of the table to do the row selection, which is naturally wrong.

The above is a subjective conjecture of the definition of a textbook. For verification, see III (ΣAGE>22 (Πs_id,score,age (SC)), which has an age column more than II. The results at a glance, above me

The resolution is likely to be correct.

An analysis of a database example. Why is the σage>22 (Πs_id,score (SC)) option wrong?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.