This set of SQL Server Multiple Choice Questions & Answers (MCQs) focuses on “Builtin Functions”.
1. ______________ function returns current date and time.
a) SET DATEFIRST
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 ?
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 ?
Explanation: SQL Server has CEILING function to get the smallest integer greater than the specified expression.
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
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
Explanation: Encryption and decryption of data is done by cryptographic functions.
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
Explanation: DecryptByKeyAutoCert function decrypts by using a symmetric key that is automatically decrypted with a certificate.
7. Text and Image Functions are ___________
c) table valued
d) All of the mentioned
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.
8. Which of the the following is not conversion function?
a) CAST and CONVERT
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.
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.
10. Built in Functions in SQL Server is categorized in to how many category ?
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.