de_notes

📚 LEFT & RIGHT

The LEFT and RIGHT functions are used in SQL to extract a specific number of characters from the start or end of a string.
They are useful for isolating prefixes, suffixes, or parts of codes.


🛠️ Basic Syntax

SELECT LEFT(column_name, number_of_characters)
FROM table_name;

SELECT RIGHT(column_name, number_of_characters)
FROM table_name;

Example

SELECT LEFT(first_name, 3) AS name_start
FROM employees;
SELECT RIGHT(phone_number, 4) AS last_digits
FROM customers;

Key Points

Additional Example

SELECT LEFT(product_code, 5) AS category_code
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: TRIM Next ➡️ UPPER & LOWER