sql doubt
[closed]

in Databases closed by
447 views
0 votes
0 votes
closed with the note: wrong question.
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;
in Databases closed by
by
447 views

3 Comments

@Shaik Masthan

how to solve these type of questions ?

0
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 )

0
0
0
0

Related questions