Q11
True / FalseIn MySQL, the INT data type is used to store integer values.
The INT data type in MySQL is used to store whole numbers, both positive and negative.
Q12
True / FalseThe VARCHAR data type in MySQL can only store up to 255 characters.
The VARCHAR data type in MySQL can store variable-length strings up to 65,535 characters.
Q13
True / FalseThe DATE data type in MySQL is used to store date values in the format 'YYYY-MM-DD'.
The DATE data type in MySQL stores date values in the 'YYYY-MM-DD' format.
Q14
True / FalseIn MySQL, the BLOB data type is used to store binary large objects, such as images or files.
: The BLOB (Binary Large Object) data type in MySQL is used to store binary data, such as images or other multimedia files.
Q15
True / FalseThe ENUM data type in MySQL allows storing multiple values from a predefined list.
The ENUM data type in MySQL allows storing a single value from a predefined list, not multiple values.
Q16
True / FalseIn MySQL, the FLOAT data type can store decimal numbers with higher precision than the DOUBLE data type.
The DOUBLE data type in MySQL has a higher precision for storing decimal numbers compared to the FLOAT data type.
Q17
True / FalseThe JSON data type in MySQL is used to store JSON-formatted strings.
The JSON data type in MySQL is designed to store JSON-formatted data efficiently and supports JSON-specific functions.
Q18
True / FalseIn MySQL, the SET data type can store multiple values from a predefined list.
The SET data type in MySQL allows storing multiple values from a predefined set of strings.
Q19
True / FalseMySQL's BIT data type is used to store boolean values.
The BIT data type in MySQL is used to store bit-field values, which can represent a collection of bits, not specifically boolean values. For boolean values, TINYINT is often used.
Q20
True / FalseMySQL uses the CHAR data type for storing fixed-length strings.
The CHAR data type in MySQL is used to store fixed-length strings, where the storage space is always allocated based on the declared length, even if the actual string is shorter.
Q24
Multiple ChoiceWhich data type should be used for a column storing precise monetary values?
SQL Code
CREATE TABLE transactions (
transaction_id INT PRIMARY KEY,
amount DECIMAL(10, 2)
);
The DECIMAL data type is ideal for storing monetary values with exact precision, avoiding rounding errors associated with floating-point types.
Q26
Multiple ChoiceIdentify the correct data type for storing binary data, such as images.
SQL Code
CREATE TABLE images (
image_id INT PRIMARY KEY,
image_data LONGBLOB
);
The LONGBLOB data type is suitable for storing large binary objects, such as images, videos, or files, up to 4GB in size.
Q30
Multiple ChoiceIdentify the correct data type for storing precise geographic coordinates.
SQL Code
CREATE TABLE locations (
location_id INT PRIMARY KEY,
latitude DECIMAL(9, 6),
longitude DECIMAL(9, 6)
);
The DECIMAL data type is suitable for storing precise geographic coordinates, allowing for exact decimal values that represent latitude and longitude.