1,328 views

2 Answers

Best answer
5 5 votes

We know in the execution flow of SQL query , having clause is imposed on the output of group by clause and having clause is hence used to select the groups  on the basis of some aggregate function like some() , sum() , avg() on some other attributes .

So if we are using other attributes it is necessary to use it with some aggregate functions as mentioned above..So according to the query the grouping of records is done on the basis of values of A and then using having clause , we select those groups which have corresponding no. of values of B for a given A is more than 1..

Hence it is clear that if we have non empty output , then we will have only those A values for which more than 1 B values exist..

Also we know by basic definition of Functional Dependency ,

A --> B holds only if there is a unique value of  B for a given A which is not the case here.Hence the FD  A --> B does not hold here provided the result is non empty..

Hence A) should be the correct option.


PS: If the result set is empty, then we cannot say FD is satisfied. Because there can be another instance of $R$ where it might be violated.

• selected by
1 1 vote

Option A.

The result will be non-empty only when there are multiple entries of attribute B to a corresponding entry of A.

e.g.

A | B

1  |  2

1  | 3

2  | 4

 

the above query will return 

A

------

1

Notice, that the dependency A-->B cannot hold. 

• edited by
Position:
Show:

Related questions

2 2 votes
1 1 answer
1.4k
1.4k views
reena_kandari asked Nov 8, 2016
1,435 views
0 0 votes
1 1 answer
3.5k
3.5k views
Shivangi Verma asked Nov 18, 2016
3,538 views
Can anybody explain main difference between Aggregation and Ternary relationship
1 1 vote
1 1 answer
1.2k
1.2k views
sh!va asked Jul 15, 2016
1,220 views
Spot the wrong statement.Subschema is related with external view only.Data dictionary is a tool used exclusively by the database administrator.To define a schema DDL, DML...
0 0 votes
0 0 answers
547
547 views
chaser asked Nov 26, 2016
547 views