The Gateway to Computer Science Excellence

sql doubt [closed]

0 votes
44 views
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;
closed with the note: wrong question.
in Databases by Boss (23.7k points)
closed by | 44 views
0

@Shaik Masthan

how to solve these type of questions ?

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

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,741 questions
57,235 answers
197,995 comments
104,580 users