1,560 views
1 votes
1 votes

Loading Question

3 Answers

2 votes
2 votes

Here the main confusion that is created is between option B and D.

As we know SELECT statement can return duplicates , so is the case here.

Suppose u have 6 values 1,2,3,4,5,5 then the query mentioned in option B will return all the 6 tuples i.e. 5,5,4,3,2,1 whereas if you use query mentioned in option D , it will return 5,4,3,2,1.

Plz consult this link :(This may help you further and remove any further doubt if you have)

http://stackoverflow.com/questions/20853725/what-is-the-use-of-with-ties-keyword-in-select-statement-in-sql-queries

Hence the correct option to the above question would be option D.

1 votes
1 votes
0 votes
0 votes
D is correct B has wrong syntax after from its missing orders collumn name rather it writes orderby directly.
optin c will not give the answer sorted hence top 5 can be any value

Related questions

0 votes
0 votes
0 answers
3
sid2601678 asked Oct 4, 2018
1,473 views
Consider the sql querySelect p.a1 From p,r1,r2 Where p.a1 = r1.a1 or p.a1 = r2.a1Under what conditions does the preceding query select values of p.a1 that are either in r...
0 votes
0 votes
0 answers
4
ejaz asked Jul 26, 2018
278 views
http://gateoverflow.in/743/gate2001-2-25 Can someone help me to understand this one.?It tells something about one table that geq which gives the condition and it also say...