how to solve these type of questions ?

0 votes

Given a Relation POSITION (Posting-No, Skill), then query to retrieve all distinct pairs of posting-nos requiring skill is

1.Select p1.posting-No, p2.posting-No from position p1, position p2 where p1.skill = p2.skill and p1.posting-No = p2.posting.No;

2. Select p1.posting-No, p2.posting-No from position p1, position p2 where p1.skill = p2.skill and p1.posting-No < p2.posting-No;

3.Select p.posting-No, p.posting-No from position p where p.skill = p.skill and p.posting-No < p.posting-No;

4. Select p1.posting-No, p2.posting-No from position p1, position p2 where p1.skill = p2.skill;

1.Select p1.posting-No, p2.posting-No from position p1, position p2 where p1.skill = p2.skill and p1.posting-No = p2.posting.No;

2. Select p1.posting-No, p2.posting-No from position p1, position p2 where p1.skill = p2.skill and p1.posting-No < p2.posting-No;

3.Select p.posting-No, p.posting-No from position p where p.skill = p.skill and p.posting-No < p.posting-No;

4. Select p1.posting-No, p2.posting-No from position p1, position p2 where p1.skill = p2.skill;

closed with the note:
wrong question.

0

i am sure, question is either wrong or missing some more data !

POSITION (Posting-No, Skill) ===> containing only 2 attributes ===> every row is unique

therefore printing original relation as it is ( i.e., select * from POSITION ) ====> printing distinct pair of (Posting-No, Skill)

what's wrong with option A ?

Select p1.posting-No, p2.posting-No from position p1, position p2 where p1.skill = p2.skill and p1.posting-No = p2.posting.No;

it doesn't print the pair (Posting-No, Skill), it is printing the pair ( Posting-No, Posting-No )