Загрузка...

Master MySQL Joins, Date Functions & Text Functions with Real Examples | Complete Tutorial 🔥

Learn MySQL Joins, Date Functions & Text Functions with Examples | Complete SQL Guide 🚀

MySQL is one of the most popular database systems used to store and manage data. To work efficiently with databases, it is important to understand Joins, Date Functions, and Text Functions. These features help combine tables, manage dates, and manipulate text data easily.

1. MySQL Joins with Example

Joins are used to combine rows from two or more tables based on a related column.

Example Tables:

Customers

id name
1 Amit
2 Ravi

Orders

order_id customer_id product
101 1 Laptop
102 2 Mobile
INNER JOIN Example
SELECT Customers.name, Orders.product
FROM Customers
INNER JOIN Orders
ON Customers.id = Orders.customer_id;

Output:

name product
Amit Laptop
Ravi Mobile
LEFT JOIN Example
SELECT Customers.name, Orders.product
FROM Customers
LEFT JOIN Orders
ON Customers.id = Orders.customer_id;

Returns all customers, even if no order exists.

2. MySQL Date Functions with Example

Date functions help handle date and time values.

Current Date
SELECT CURDATE();

Output: 2026-04-17

Current Time
SELECT NOW();

Output: Current date and time.

Add Days
SELECT DATE_ADD('2026-04-17', INTERVAL 5 DAY);

Output: 2026-04-22

Difference Between Dates
SELECT DATEDIFF('2026-04-20', '2026-04-17');

Output: 3

3. MySQL Text Functions with Example

Text functions are used to modify string values.

Convert to Uppercase
SELECT UPPER('mysql tutorial');

Output: MYSQL TUTORIAL

Convert to Lowercase
SELECT LOWER('MYSQL');

Output: mysql

Length of String
SELECT LENGTH('Database');

Output: 8

Combine Text
SELECT CONCAT('Hello', ' ', 'World');

Output: Hello World

Extract Characters
SELECT SUBSTRING('MySQLDatabase', 1, 5);

Output: MySQL

Conclusion

MySQL Joins help combine multiple tables, Date Functions manage dates and time, and Text Functions manipulate string data. These are essential skills for database developers, students, and SQL learners. Practice these examples to improve your MySQL knowledge quickly.

Видео Master MySQL Joins, Date Functions & Text Functions with Real Examples | Complete Tutorial 🔥 канала IT TECH
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять