Complete the code to convert the string '123' to an integer using CAST.
SELECT CAST('123' AS [1]);
In MySQL, to convert a string to an integer, you use CAST with AS SIGNED.
Complete the code to convert the integer 2023 to a string using CAST.
SELECT CAST(2023 AS [1]);
CAST AS CHAR converts a number to a string in MySQL.
Fix the error in the code to convert the string '2023-06-01' to a DATE type.
SELECT CAST('2023-06-01' AS [1]);
To convert a string to a date, use CAST AS DATE in MySQL.
Fill both blanks to convert the string '123.45' to a decimal number with 5 digits and 2 decimals.
SELECT CAST('123.45' AS [1]([2], 2));
DECIMAL(5, 2) defines a decimal number with 5 total digits and 2 decimal places.
Fill all three blanks to convert the string '2023-06-01 12:30:00' to a DATETIME type and alias it as 'converted'.
SELECT CAST([1] AS [2]) AS [3];
CAST the full datetime string as DATETIME and alias the result as 'converted'.