edited by
1,898 views
3 votes
3 votes

Tables are : COUNTRY (CODE, NAME) and MEMBER (ORGANIZATION, COUNTRY_code). primary keys are in blod letters and foreign key is in italics.

SELECT COUNTRY.name
FROM
COUNTRY
JOIN member
ON
COUNTRY.code= member.COUNTRY_code
WHERE member.ORGANIZATION =ALL(SELECT organization
FROM member
WHERE
member.
COUNTRY_code=COUNTRY.code )


What wil be the output of given SQL query?

1. List the names of countries which are members of at least one organisation.

2. List the names of countries which are members of only one organisation.

3. List the names of countries which are members of one or more organisations.

4. List the names of countries which are members of all  organisations.

edited by

2 Answers

2 votes
2 votes
bro I think answer is B) only one org will be equal to inner sub query.

Related questions

0 votes
0 votes
2 answers
1
3 votes
3 votes
2 answers
2
shikharV asked Dec 8, 2015
1,158 views
Use the following tables for the below queries wherever table $1$ and table $2$ are used:Select *From Table 1Where not exists (Select $T_{2}B$ From Table 2 where $T_{2}B ...
0 votes
0 votes
1 answer
3
shikharV asked Dec 8, 2015
398 views
Given answer: BI don't know how to deal with NULL in such query operations. Please explain.
0 votes
0 votes
1 answer
4
shikharV asked Dec 8, 2015
1,050 views
Given answer: BI don't know how to deal with NULL in such query operations. Please explain.