Chapter 8 Study Questions Flashcards
A column’s ____ ____ specifies the kind of information the column is intended to store; and it determines the operations that can be performed on the column.
data type
_________ ____ _____ are intended for storing a string of one or more characters, which can include letters, numbers, symbols, or special characters.
Character data types
The _______ ____ _____ are intended for storing numbers that can be used for mathematical calculations.
numeric data types
________ are numbers that do not have a decimal point.
Integers
____ _______ are numbers that have a decimal point.
Real numbers
____ ___ ____ ____ _____ are intended for storing dates, times or both dates and times.
Date and time data types
_____ ______ ____ _____ (___) are useful for storing images, sound, video, and large amounts of character data.
Large Object data types (LOB)
MySQL provides _______ ____ _____ that are useful for storing geometric and geographical values such as GPS data.
spatial data types
Use the CHAR type to store _____-______ ______. Data of this type always occupy the same number of bytes.
fixed-length strings
Use the _______ type to store variable-length strings. Data of this type occupies only the number of bytes needed to store the string in an extra byte to store the length of the string.
VARCHAR
If the ________ attribute for an integer is set, it prevents negative values from being stored in a column. And the range of acceptable positive values is doubled.
UNSIGNED
If the ________ attribute for an integer is set, the UNSIGNED attribute is automatically set, and the integer is displayed with zeros padded from the left up to the maximum display size.
ZEROFILL
It is common programming practice to use ___ as an abbreviation for INTEGER.
INT
The ____ ___ _______ types are synonyms for TINYINT(1). You can use these types to store 0 or FALSE for false values, and 1 or TRUE for true values.
BOOL and BOOLEAN
____ _______ can include digits to the right of the decimal point.
Real numbers
The __________ of a real number indicates the total number of digits that can be stored, and the _____ indicates the number of digits that can be stored to the right of the decimal point.
precision, scale
The DECIMAL type is considered an _____ ________ ____ because its precision is exact.
exact numeric type
The DOUBLE and FLOAT types store ________-_____ _______ which have a limited number of significant digits. These types are considered ___________ _______ ____ _____ because they do not represent a value exactly.
floating-point numbers, approximate numeric data types
If the ________ attribute for a real number is set, the number is displayed with zeros padded from the left, and the UNSIGNED attribute is automatically set.
ZEROFILL
The ____ type can be used to store a date without a time.
DATE
Use the ________ type, rather than TIMESTAMP, to store both a date and a time (and also avoid the year 2038 problem)
DATETIME
To store a year without any other temporal data, use the ____ type.
YEAR
The ____ type, considered a character type, can store exactly one value; where as the ___ type can take on zero, one, or up to 64 different values. Values for these types are defined when the table is created.
ENUM, SET
The _________ types store strings of binary data (255 to 4GB in length)
BLOB
____ types store strings of characters up to 65KB in length and are sometimes referred to as “character large object types”.
TEXT
When SQL automatically converts one data type to another, it is known as _________ __________. For example, when adding or subtracting an integer to a DATE value.
implicit conversion
To control how a conversion is performed, code an _________ ___________ using the CAST and CONVERT functions
explicit conversion