This set of SQL Server Multiple Choice Questions & Answers (MCQs) focuses on “Data Types”.
1. Which of the followig is large object data type ?
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 ?
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 __________.
d) All of the mentioned
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 datatype falls under which category ?
a) Exact numerics
b) Character strings
c) Unicode character strings
d) None of the mentioned
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.
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
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.
d) All of the mentioned
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 the following data type is not present in SQL Server ?
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.
d) None of the Mentioned
Explanation: Monetary data types are data types that represent monetary or currency values such as smallmoney and money.
10. Which of the datatype has storage size of 8 bytes ?
Explanation: uniqueidentifier, real and smallmoney data types have storage size of 16,4 and 4 bytes respectively.
Sanfoundry Global Education & Learning Series – SQL Server.