SQL Server Questions and Answers – Builtin Functions

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

1. ______________ function returns current date and time.
a) SET DATEFIRST
b) SYSDATETIME
c) Cert_ID
d) GETDATE
View Answer

Answer: d
Explanation: GETDATE function is used to obtain the current system date and time. Although GETDATE doesn’t have any input parameters, you still need to include the parentheses in your code because that’s how SQL Server typically identifies functions.

2. Which of the following function checks whether the expression is a valid date or not?
a) ISDATE
b) ISDAY
c) ISVALID
d) ISYEAR
View Answer

Answer: a
Explanation: ISDATE() determines whether a datetime or smalldatetime input expression is a valid date or time value.

3. Which of the following is not a mathematical function?
a) ATN2
b) POWER
c) PI
d) CEIL
View Answer

Answer: d
Explanation: SQL Server has CEILING function to get the smallest integer greater than the specified expression.
advertisement
advertisement

4. @@NESTLEVEL function falls under which of the following category?
a) Configuration functions
b) Cursor functions
c) Mathematical functions
d) Date and Time Data Functions
View Answer

Answer: a
Explanation: Configuration functions return information about the current configuration.

5. __________ are used for supporting encryption, decryption, digital signing and their validation.
a) Cryptographic functions
b) Cursor functions
c) Configuration functions
d) None of the mentioned
View Answer

Answer: a
Explanation: Encryption and decryption of data is done by cryptographic functions.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. DecryptByKeyAutoCert is ________________ type function.
a) Symmetric Encryption and decryption
b) Encryption Hashing
c) Asymmetric Encryption and decryption
d) Symmetric decryption with Automatic key handling
View Answer

Answer: d
Explanation: DecryptByKeyAutoCert function decrypts by using a symmetric key that is automatically decrypted with a certificate.

7. Text and Image Functions are ___________
a) nondeterministic
b) deterministic
c) table valued
d) all of the mentioned
View Answer

Answer: a
Explanation: Text and image functions are nondeterministic. This means they do not always return the same results every time they are called, even with the same set of input values.
advertisement

8. Which of the following is not a conversion function?
a) CAST and CONVERT
b) PARSE
c) TRY_CAST
d) TRY_CASE
View Answer

Answer: d
Explanation: Conversion functions support data type casting and converting.

9. ______________ returns the rank of rows within the partition of a result set, without any gaps in the ranking.
a) RANK
b) NTILE
c) DENSE_RANK
d) ROW_NUMBER
View Answer

Answer: c
Explanation: DENSE_RANK function makes the rank of a row is one plus the number of distinct ranks that come before the row in question.
advertisement

10. Built in Functions in SQL Server is categorized into how many categories?
a) 4
b) 5
c) 6
d) 7
View Answer

Answer: a
Explanation: SQL Server provides many built-in functions and also lets you create user-defined functions:- Rowset, Aggregate, Ranking and Scalar Function.

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.