IST 272 Chapter 8 quiz
Which uses the least amount of storage? 'gr' stored in a column of type varchar(20) 'apple' stored in a column of type varchar(20) 'grape' stored in a column of type varchar(20) They all use the same amount of storage
'gr' stored in a column of type varchar(20)
The integer and decimal data types are considered ________________ because their precision is exact.
exact numeric data types
Which data types are used to store whole numbers?
integer
The _______________ of a decimal value indicates the total number of digits that can be stored in a decimal data type.
precision
___________________ is the total # of digits that can be stored.
precision
All of the following values can be stored in a column that's defined as decimal(6,2), except
32492.05
Which of the following pieces of code cast a decimal field named InvoiceAmount to a varchar datatype using the CAST function:
CAST(InvoiceAmount AS varchar)
The difference between the CAST function and the CONVERT function is that the _____________ function accepts an optional style argument that lets you specify a format for the result.
CONVERT
Which of the following statements is true about the CONVERT and TRY_CONVERT functions?
CONVERT returns an error if the expression can't be converted, but TRY_CONVERT returns a NULL value.
Which of the following statements is true?
Implicit data type conversion is performed when you mix values of different data types in an expression.
Which uses the least amount of storage? 'apple' stored in a column of type nchar(20) 'grape' stored in a column of type nchar(20) 'gr' stored in a column of type nchar(20)
They all use the same amount of storage.
The char and nchar data types are used to store fixed-length strings. Which of the statements below are true? Data stored using these data types occupies the same number of bytes regardless of the actual length of the string. They are typically used to define columns that have a fixed number of characters. The char(2) data type will always contain two characters.
all of the above
To store a date value without storing a time value, you can use the
date data type
You can use what data type to store a date that includes a time zone offset?
datetimeoffset
The float data type can be used to store a _________________, which provides for numbers with up to 15 significant digits.
double-precision number
If you assign a value with one data type to a column with another data type, SQL Server converts the value to the data type of the column using what?
implicit conversion
________________ is the # of digits a value has to the right of the decimal point.
scale
The real data type can be used to store a _________________, which provides for numbers with up to 7 significant digits.
single-precision number
To code a/an _____________ value as a literal, precede the value with the character N.
unicode
______________ characters can be used to encode most of the characters in most of the languages of the world.
unicode