de_notes

📚 SUBSTRING

The SUBSTRING function is used in SQL to extract a part of a string starting at a specified position for a specified length.
It is useful for isolating specific sections of text from a larger string.


🛠️ Basic Syntax

SELECT SUBSTRING(column_name, start_position, length)
FROM table_name;

Example

SELECT SUBSTRING(first_name, 1, 3) AS short_name
FROM employees;

Key Points

Additional Example

SELECT SUBSTRING(product_name, 5, 10) AS partial_product
FROM products;

🎥 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: LENGTH Next ➡️ CHARINDEX or SUBSTRING_INDEX