This set of SQL Server Multiple Choice Questions & Answers (MCQs) focuses on “Data Types”.
1. Which of the following is a large object data type?
a) varchar(max)
b) varbinary(max)
c) nvarchar(max)
d) image
View Answer
Explanation: In SQL Server, based on their storage characteristics, some data types are designated as large value data types and large object data types.
2. Data types in SQL Server are organized into how many categories?
a) 6
b) 8
c) 9
d) 10
View Answer
Explanation: SQL Server offers six categories of data types for your use:-exact numeric, Unicode character strings, approximate numeric, Binary strings, Date and time and Character strings.
3. Exact Numeric data type is ___________
a) bigint
b) int
c) smallmoney
d) all of the mentioned
View Answer
Explanation: Exact numeric data types store numeric values where you wish to specify the precision of the variable. They may include integer or decimal numbers.
4. ntext data type falls under which category?
a) Exact numerics
b) Character strings
c) Unicode character strings
d) None of the mentioned
View Answer
Explanation: ntext is fixed and variable-length data type for storing large non-Unicode and Unicode character.
5. A column of type __________ may contain rows of different data types.
a) ntext
b) date
c) smallmoney
d) sql_variant
View Answer
Explanation: sql_variant is data type that stores values of various SQL Server-supported data types.
6. You want to track date and time of the last write access per row?
a) Add TIMESTAMP column to the table
b) Add a DATETIME column to the table and assign getdate() as the default value
c) Add a DATETIME column to the table and write a trigger that sets its value
d) Add a UNIQUEIDENTIFIER column to the table and use it with SQL Server’s built-in functions
View Answer
Explanation: The correct answer is Add a DATETIME column to the table and write a trigger that sets its value.
7._________ is a spatial data type.
a) geometry
b) sql_variant
c) cursor
d) all of the mentioned
View Answer
Explanation: SQL Server supports the geometry and geography data types for storing spatial data. These types support methods and properties that allow for the creation, comparison, analysis, and retrieval of spatial data.
8. Which of the following data type is not present in SQL Server?
a) bit
b) boolean
c) hierarchyid
d) geography
View Answer
Explanation: SQL Server doesn’t have a Boolean data type, at least not by that name. To store True/False, Yes/No, and On/Off values, use the bit data type. It accepts only three values: 0, 1, and NULL.
9. ______________ is monetary data type in SQL Server.
a) Smallmoney
b) sql_variant
c) Cursor
d) None of the Mentioned
View Answer
Explanation: Monetary data types are data types that represent monetary or currency values such as smallmoney and money.
10. Which of the data type has a storage size of 8 bytes?
a) timestamp
b) uniqueidentifier
c) real
d) smallmoney
View Answer
Explanation: uniqueidentifier, real and smallmoney data types have storage size of 16,4 and 4 bytes respectively.
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.
- Apply for Programming Internship
- Check SQL Server Books
- Check Information Technology Books
- Practice Programming MCQs