de_notes

📚 CAST

The CAST function is used in SQL to convert a value from one data type to another.
It is useful when you need to change how data is interpreted or formatted.


🛠️ Basic Syntax

SELECT CAST(expression AS target_data_type)
FROM table_name;

Example

SELECT CAST(salary AS CHAR(10)) AS salary_text
FROM employees;

Key Points

Additional Example

SELECT CAST(order_date AS DATE) AS simple_date
FROM orders;

🎥 Video Notes


📝 Problem Description

Describe the problem, challenge, or topic discussed in a video related to SELECT FROM.
What concept was explained or what exercise was solved?


DataBase Given


💻 My SQL Code

-- Write your SQL code attempt or solution related to SQL COMMAND
SQL COMMAND

🧠 Solution Code / Explanation

SQL COMMAND

Explanation - Explain what you learned, any key takeaways, or how you solved the problem related to COMMAND._


⬅️ Previous: CONCAT Next ➡️ LENGTH