Term
|
Definition
May or may not have a fractional part and may have a leading sign. |
|
|
Term
|
Definition
May be non-binary or binary to store characters or raw bytes. Written within quotes. |
|
|
Term
|
Definition
Include dates, times, and values with both a date and time part. |
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
-2,147,483,648 to 2,147,483,647 |
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 |
|
|
Term
|
Definition
0 to 18,446,744,073,709,551,615 |
|
|
Term
Does INT(4) indicate the number of bytes or the display width? |
|
Definition
|
|
Term
Floating-point data types |
|
Definition
Approximate value numbers with an integer part, a fractional part, or both. |
|
|
Term
How are floating point values stored? |
|
Definition
The native binary floating-point format used by the server host's CPU. |
|
|
Term
Are floating point values subject to rounding errors? |
|
Definition
|
|
Term
|
Definition
Single precision floating type that requires 4 bytes for storage. |
|
|
Term
|
Definition
Double-precision floating type that requires 8 bytes for storage. |
|
|
Term
What does FLOAT(10,3) specify? |
|
Definition
A single-precision column with a precision of 10 digits and a scale of 3 digits. |
|
|
Term
|
Definition
Represent exact-value numbers that have an integer part, a fractional part, or both. |
|
|
Term
|
Definition
Fixed-decimal storage format. |
|
|
Term
What are the default precision and scale for the DECIMAL data type? |
|
Definition
|
|
Term
What does DECIMAL(10,2) represent? |
|
Definition
A fixed-point data type with precision of 10 and scale of 2. |
|
|
Term
How many bytes are required for DECIMAL storage? |
|
Definition
Approximately 4 bytes per nine digits on each side of the decimal point. |
|
|
Term
NUMERIC is a synonym for what other data type? |
|
Definition
|
|
Term
Does BIT(4) specify the the number of bits or the display width? |
|
Definition
|
|
Term
How many bits can a BIT field hold? |
|
Definition
|
|
Term
How can literal bit values be written in a BIT field? |
|
Definition
b'val' ... for instance, b'111' equals 15 |
|
|
Term
|
Definition
Fixed-length non-binary string |
|
|
Term
|
Definition
Variable-length non-binary string |
|
|
Term
|
Definition
Variable-length non-binary string |
|
|
Term
|
Definition
Fixed-length binary string |
|
|
Term
|
Definition
Variable-length binary string |
|
|
Term
|
Definition
Variable-length binary string |
|
|
Term
|
Definition
Fixed set of legal values, pick one |
|
|
Term
|
Definition
Fixed set of legal values, pick one or more |
|
|
Term
If character set and collation are important, use ______ strings. |
|
Definition
|
|
Term
Does CHAR(4) contain 4 bytes of data? |
|
Definition
Only if you are using a one-byte-per-character character set. |
|
|
Term
What does a _cs suffix on a collation indicate? |
|
Definition
|
|
Term
What does a _ci suffix on a collation indicate? |
|
Definition
|
|
Term
What does a _bin suffix on a collation indicate? |
|
Definition
|
|
Term
What result do you get from the following statement: mysql> SELECT UPPER(BINARY 'AaBb'); |
|
Definition
|
|
Term
How is a CHAR(30) column with less than 30 characters stored? |
|
Definition
It is padded with spaces to a length of 30 characters. |
|
|
Term
What range of lengths can a CHAR column have? |
|
Definition
|
|
Term
|
Definition
|
|
Term
How much space does it take to store a VARCHAR? |
|
Definition
The number of actual characters, plus 1 or 2 bytes to record the length. |
|
|
Term
What is the storage required for TINYTEXT? |
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
MEDIUMTEXT maximum length |
|
Definition
|
|
Term
MEDIUMTEXT storage required |
|
Definition
|
|
Term
|
Definition
|
|
Term
LONGTEXT storage required |
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
VARBINARY storage required |
|
Definition
L bytes plus 1 or 2 bytes |
|
|
Term
|
Definition
|
|
Term
TINYBLOB storage required |
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
MEDIUMBLOB storage required |
|
Definition
|
|
Term
MEDIUMBLOB maximum length |
|
Definition
|
|
Term
LONGBLOB storage required |
|
Definition
|
|
Term
|
Definition
|
|
Term
How are ENUM values stored? |
|
Definition
|
|
Term
What is the value 0 used for in ENUM types? |
|
Definition
|
|
Term
How does SET differ from ENUM? |
|
Definition
You can pick multiple values from a SET. |
|
|
Term
How are SET values stored? |
|
Definition
As a bitmap using one bit per member. |
|
|
Term
What happens if you try to store an invalid member in a SET column? |
|
Definition
It is ignored. (Error in strict mode.) |
|
|
Term
Here is an example table: CREATE TABLE t (siblings ENUM('0', '1', '2', '3', '>3'); INSERT INTO t (siblings) VALUES ('3'); INSERT INTO t (siblings) VALUES (3);
What result does this query give: SELECT * FROM t WHERE siblings = 3; |
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
'1000-01-01' to '9999-12-31' |
|
|
Term
|
Definition
|
|
Term
|
Definition
'-838:59:59' to '838:59:59' |
|
|
Term
DATETIME storage required |
|
Definition
|
|
Term
|
Definition
'1000-01-01 00:00:00' to '9999-12-31 23:59:59' |
|
|
Term
TIMESTAMP storage required |
|
Definition
|
|
Term
|
Definition
'1970-01-01 00:00:00' to mid-year 2037 |
|
|
Term
|
Definition
|
|
Term
|
Definition
1901 to 2155 (for YEAR(4)), 1970 to 2069 (for YEAR(2)) |
|
|
Term
How are 2-digit years stored? |
|
Definition
Converted to 4-digit years between 1970 and 2069. |
|
|
Term
What is the range for the TIME portion of the DATETIME datatype? |
|
Definition
|
|
Term
What is the default initialization and update behavior for TIMESTAMP? |
|
Definition
The first TIMESTAMP will use current date for both creation and updating. |
|
|
Term
How can you use DEFAULT CURRENT_TIMESTAMP on one column and UPDATE CURRENT_TIMESTAMP on another? |
|
Definition
Explicitly set the first column to null on creation (which defaults to CURRENT_TIMESTAMP) and specify ON UPDATE CURRENT_TIMESTAMP on the other column. |
|
|
Term
How is signed hour/minute offset of a time zone expressed? |
|
Definition
|
|
Term
How is a named time zone defined? |
|
Definition
By a string such as 'US/Eastern', but depends on having a set of time zone tables in the mysql database. |
|
|
Term
What is the SYSTEM time zone? |
|
Definition
The time zone value that the MySQL server retrieves from the server host. |
|
|
Term
Which time zone format is the default? |
|
Definition
|
|
Term
What is the output from the following series of commands: > SET time_zone = '+00:00'; > CREATE TABLE ts_test (ts TIMESTAMP); > INSERT INTO ts_test (ts) VALUES (NULL); > SET time_zone '+02:00'; > SELECT * FROM ts_test; |
|
Definition
The current time plus 2 hours. |
|
|
Term
What is the output of the following query: > SELECT CONVERT_TZ('2010-06-01 13:30:00', '+01:00', '+03:00'); |
|
Definition
|
|
Term
|
Definition
Causes negative values to be disallowed. |
|
|
Term
|
Definition
Causes retrieved values to be left-padded with zeros up to the column's display width. |
|
|
Term
|
Definition
Generates sequence of successive unique integer values. |
|
|
Term
Can there be more than one AUTO_INCREMENT column per table? |
|
Definition
|
|
Term
What other attributes must an AUTO_INCREMENT column have? |
|
Definition
|
|
Term
|
Definition
Specifies the character set to use for the column. |
|
|
Term
What is a synonym for the CHARACTER SET attribute? |
|
Definition
|
|
Term
|
Definition
specifies the character set collation |
|
|
Term
|
Definition
specifies a binary collation of the column's character set |
|
|
Term
How is the binary character set special? |
|
Definition
It modifies the column's datatype; CHAR, VARCHAR, and TEXT become BINARY, VARBINARY, and BLOB, respectively |
|
|
Term
NULL and NOT NULL attributes |
|
Definition
indicate whether a column can contain null values (default is NULL) |
|
|
Term
|
Definition
Provides a default value for creating new columns. |
|
|
Term
Which columns cannot have a DEFAULT attribute? |
|
Definition
TEXT and BLOB columns, or columns with the AUTO_INCREMENT attribute |
|
|
Term
Can default values be an expression? |
|
Definition
No, with the exception of CURRENT_TIMESTAMP for a single TIMESTAMP column. |
|
|
Term
What happens if a default value of NULL is specified for a NOT NULL column? |
|
Definition
|
|
Term
What happens if an out of range default value is specified when creating a table? |
|
Definition
|
|
Term
What happens if no default value is specified when creating a table? |
|
Definition
For columns that allow NULL, MySQL adds DEFAULT NULL. For columns that do not allow NULL, no default clause is added and implicit default values are used. |
|
|
Term
What is the implicit default value for numeric columns? |
|
Definition
|
|
Term
What is the implicit default value for string columns? |
|
Definition
empty string, or first value for ENUM types |
|
|
Term
What is the implicit default value for temporal columns? |
|
Definition
The "zero" value for the data type. |
|
|
Term
Which data types cannot be specified as PRIMARY KEY or UNIQUE? |
|
Definition
|
|
Term
What function returns the most recently generated AUTO_INCREMENT value? |
|
Definition
|
|
Term
Is LAST_INSERT_ID() client-specific? |
|
Definition
|
|
Term
What data types can have an AUTO_INCREMENT attribute? |
|
Definition
|
|
Term
Can AUTO_INCREMENT sequences contain negative values? |
|
Definition
|
|
Term
What happens if an AUTO_INCREMENT column value of null or 0 is inserted explicitly? |
|
Definition
The next value in the sequence is generated. |
|
|
Term
What happens if an integer value is inserted explicitly into an AUTO_INCREMENT column? |
|
Definition
No error if the value isn't already present in the column. If the value is larger than the current sequence counter, subsequent values begin with the value plus one. |
|
|
Term
What happens when you REPLACE an AUTO_INCREMENT column? |
|
Definition
The existing record is deleted and then the new record is inserted using the next sequence value. |
|
|
Term
What happens when you reach the upper limit of an AUTO_INCREMENT column? |
|
Definition
|
|
Term
Are deleted rows at the high end of a sequence reused for new AUTO_INCREMENT values? |
|
Definition
no (for MyISAM or InnoDB tables) |
|
|
Term
How do MyISAM composite indexes use an AUTO_INCREMENT column? |
|
Definition
They create independent sequences within a single table and reuse values deleted from the high end of any sequence. |
|
|
Term
What is the default MySQL mode for handling missing or invalid data values (forgiving or strict)? |
|
Definition
|
|
Term
How do you explicitly set sql_mode to forgiving? |
|
Definition
|
|
Term
How do you set sql_mode to strict? |
|
Definition
SET sql_mode = 'STRICT_TRANS_TABLES'; or SET sql_mode = 'STRICT_ALL_TABLES'; |
|
|
Term
How do you set sql_mode to be strict plus other restrictions on date checking and division by zero? |
|
Definition
SET sql_mode = 'TRADITIONAL'; |
|
|
Term
What happens with the following statement in forgiving mode if column i is an integer column: INSERT INTO t (i) VALUES('43x'); |
|
Definition
The value is converted to 43 and inserted, and it generates a warning. |
|
|
Term
What happens in strict mode when data is missing and no default value is specified? |
|
Definition
An error occurs for transactional tables and the data is rolled back. An error also occurs for non-transactional tables but a partial update might result. |
|
|
Term
How can warnings generated in non-strict mode be displayed? |
|
Definition
|
|
Term
How are out-of-range numbers converted in non-strict mode? |
|
Definition
Numbers below the minimum are stored as the minimum number in the range, numbers above the maximum are stored as the maximum number in the range. |
|
|
Term
How are strings too long to fit the column stored in non-strict mode? |
|
Definition
Truncated to fit the column. |
|
|
Term
Will a string where trailing spaces must be truncated to fit the column generate a warning? |
|
Definition
|
|
Term
What happens in non-strict mode when attempting to store a value that cannot be converted to the column data type? |
|
Definition
MySQL uses the implicit default value for that type. |
|
|
Term
What happens in non-strict mode when a NULL value is inserted into a NOT NULL column? |
|
Definition
An error occurs in single-row inserts, but for multiple-row inserts MySQL assigns the column to the implicit default value for its data type. |
|
|
Term
What happens when ALTER TABLE is used to change a column's data type? |
|
Definition
Existing values are mapped to new values according to the constraints imposed by the new data type. |
|
|
Term
What is the difference between STRICT_TRANS_TABLES and STRICT_ALL_TABLES? |
|
Definition
STRICT_TRANS_TABLES only applies to errors that can be rolled back or canceled without changing the table into which data is being entered while STRICT_ALL_TABLES causes statements to abort for non-transactional tables even for errors in the second or later row in a multiple-row insert. |
|
|
Term
What option enables treating division by zero as an error? |
|
Definition
ERROR_FOR_DIVISION_BY_ZERO mode value and strict mode. |
|
|
Term
What option prohibits dates with zero values? |
|
Definition
Strict mode with NO_ZERO_DATE and NO_ZERO_IN_DATE |
|
|
Term
How can input data restrictions be overridden for a single statement? |
|
Definition
INSERT IGNORE or UPDATE IGNORE |
|
|
Term
Is '2009-02-31' a valid date in MySQL 5? |
|
Definition
|
|
Term
What sql_mode relaxes date checking to only check that months are in range from 1-12 and days are in range 1-31? |
|
Definition
|
|