SQL Server Questions and Answers – Windowing

This set of SQL Server Multiple Choice Questions & Answers (MCQs) focuses on “Windowing”.

1. Which of the following is a set function?
a) RANK
b) NTILE
c) Window
d) All of the mentioned
View Answer

Answer: d
Explanation: The word ‘window’ is used to refer to the set of rows that the function works on.

2. Point out the correct statement.
a) Windowing functions were added to the standard SQL:2003
b) Windowing functions were added to the standard SQL:2008
c) Windowing functions were added to the standard SQL:2012
d) Windowing functions were added to the standard SQL:2014
View Answer

Answer: a
Explanation: Windowing functions were added to the standard SQL:2003 that is managed by the ISO and it was specified in more detail in SQL:2008.

3. Windowing function was added in which of the following versions of SQL Server?
a) 2003
b) 2005
c) 2008
d) None of the mentioned
View Answer

Answer: c
Explanation: SQL Server has had only a partial implementation up to now, but it has come up in SQL 2012.
advertisement
advertisement

4. Which is the most important benefit of window function?
a) Aggregation
b) Association
c) Generalization
d) All of the mentioned
View Answer

Answer: a
Explanation: Most important benefit of window functions is that we can access the detail of the rows from an aggregation.

5. Point out the wrong statement related to window function.
a) They are used to provide details of a backup plans
b) They are used to provide details of an aggregation
c) They are used to provide details of an aggregation
d) None of the mentioned
View Answer

Answer: b
Explanation: Window functions belong to a type of function known as a ‘set function.

6. Which of the function is not a ranking window function?
a) RANK
b) NTILE
c) ROW_NUMBER
d) None of the mentioned
View Answer

Answer: a
Explanation: Since SQL Server 2005 we have had support for some window functions, they are: ROW_NUMBER, RANK, DENSE_RANK and NTILE.

7. Which of the following is not a type of window function?
a) Ranking window function
b) Associate window function
c) Analytic window functions
d) All of the mentioned
View Answer

Answer: b
Explanation: There is an aggregate window function available in SQL Server.
advertisement

8. How many types of window functions are present in SQL Server?
a) 3
b) 4
c) 5
d) 6
View Answer

Answer: a
Explanation: Window functions are distinguished by the presence of an OVER() clause and come in three varieties.

9. Which of the following function is an analytic window function?
a) LAG
b) LEAD
c) FIRST_VALUE
d) None of the mentioned
View Answer

Answer: b
Explanation: There are 8 analytic window functions in SQL Server 2012.
advertisement

10. LAST_VALUE comes in the category of _____________
a) Ranking window function
b) Associate window function
c) Analytic window functions
d) All of the mentioned
View Answer

Answer: c
Explanation: The analytic window functions are new for SQL Server 2012.

Sanfoundry Global Education & Learning Series – SQL Server.

To practice all areas of SQL Server, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.