|
INTERVIEW QUESTIONS
DATABASE
MS SQL SERVER
DETAILS
Question: What Is a Constant or Literal in MS SQL Server?
Answer: A constant, or literal, is a symbol that represents a specific value of a specific data type. Constants or literals are used commonly as the default values for table columns, variables, and parameters. The format of constant or literal depends on the data type of the value it represents. There are x formats used to specify literals in SQL Server:
* Integer Number Literals - Strings of numbers prefixed with (+/-) as the sign if needed. They are used for integer data types. For example: -2255. * Decimal Number Literals - Strings of numbers with a single decimal point and an optional prefix sign (+/-). They are used for DECIMAL data type. For example: 1894.1204. * Floating Point Number Literals - Numeric values represented in the scientific notation. They are used for FLOAT data type. For example: 9.22337e+010. * Character String Literals - Strings of characters enclosed in single quotes. They are used for character string data types. . For example: 'Welcome to GlobalGuideLine.com!'. * Unicode Character String Literals - Strings of Unicode characters enclosed in single quotes with a prefix of (N). They are used for Unicode character string data types. For example: N'Welcome to GlobalGuideLine.com'.
|
|
|
Category |
MS SQL Server Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 9382 users |
Added on |
9/23/2014 |
Views |
65594 |
Rate it! |
|
|
Question:
What Is a Constant or Literal in MS SQL Server?
Answer:
A constant, or literal, is a symbol that represents a specific value of a specific data type. Constants or literals are used commonly as the default values for table columns, variables, and parameters. The format of constant or literal depends on the data type of the value it represents. There are x formats used to specify literals in SQL Server:
* Integer Number Literals - Strings of numbers prefixed with (+/-) as the sign if needed. They are used for integer data types. For example: -2255. * Decimal Number Literals - Strings of numbers with a single decimal point and an optional prefix sign (+/-). They are used for DECIMAL data type. For example: 1894.1204. * Floating Point Number Literals - Numeric values represented in the scientific notation. They are used for FLOAT data type. For example: 9.22337e+010. * Character String Literals - Strings of characters enclosed in single quotes. They are used for character string data types. . For example: 'Welcome to GlobalGuideLine.com!'. * Unicode Character String Literals - Strings of Unicode characters enclosed in single quotes with a prefix of (N). They are used for Unicode character string data types. For example: N'Welcome to GlobalGuideLine.com'. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
What Are the Differences between DECIMAL and FLOAT in MS SQL Server?
|
View Answer
|
|
What Are the Differences between CHAR and VARCHAR in MS SQL Server?
|
View Answer
|
|
What Are the Differences between CHAR and NCHAR in MS SQL Server?
|
View Answer
|
|
What Are Binary String Data Types in MS SQL Server?
|
View Answer
|
|
What Are Unicode Character String Data Types in MS SQL Server?
|
View Answer
|
|
What Are Character String Data Types in MS SQL Server?
|
View Answer
|
|
What Are Date and Time Data Types in MS SQL Server?
|
View Answer
|
|
What Are Approximate Numeric Data Types in MS SQL Server?
|
View Answer
|
|
What Are Exact Numeric Data Types in MS SQL Server?
|
View Answer
|
|
How Many Categories of Data Types Used by SQL Server?
|
View Answer
|
|
How To Create User Messages with PRINT Statements in MS SQL Server?
|
View Answer
|
|
How To Use GO Command in "sqlcmd"?
|
View Answer
|
|
What Happens to a Statement Batch If There Is a Compilation Error?
|
View Answer
|
|
What Is a Transact-SQL Statement Batch in MS SQL Server?
|
View Answer
|
|
How To Enter Comments in Transact-SQL Statements?
|
View Answer
|
|
How To Start and End Transact-SQL Statements?
|
View Answer
|
|
What Is a Transact-SQL Statement?
|
View Answer
|
|
What Is Transact-SQL Language?
|
View Answer
|
|
What Is SQL Language?
|
View Answer
|
|
Can Group Functions Be Used in the ORDER BY Clause in MS SQL Server?
|
View Answer
|