how to solve these type of questions ?

The Gateway to Computer Science Excellence

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 )

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.4k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.4k
- Admissions 595
- Exam Queries 573
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

50,741 questions

57,235 answers

197,995 comments

104,580 users