20. Coalesce IN SQL | SQL Tutorial
learn by doing it
0:00 / 0:00
20. Coalesce IN SQL | SQL Tutorial
5 110 просмотров · 2 г. назад
learn by doing it
60,9 тыс. подписчиков
5 110 просмотров · 2 г. назад
SQL COALESCE Function Explained: Handle NULL Values Like a Pro!
In this video, learn how to use the COALESCE function in SQL to replace NULL values with default ones and make your queries more reliable. 🚀📋
✅ What is COALESCE in SQL?
The COALESCE function returns the first non-NULL value from a list of arguments. It’s useful when dealing with missing data or optional fields.
Examples of COALESCE Usage
Replace NULL with a default value:
Want more similar videos- hit like, comment, share and subscribe
❤️Do Like, Share and Comment ❤️
❤️ Like Aim 5000 likes! ❤️
➖➖➖➖➖➖➖➖➖➖➖➖➖
Please like & share the video
➖➖➖➖➖➖➖➖➖➖➖➖➖
script
CREATE TABLE employees (
employee_id INT PRIMARY KEY,
name VARCHAR(50),
phone VARCHAR(15),
email VARCHAR(50),
alternate_email VARCHAR(50),
salary DECIMAL(10, 2),
bonus DECIMAL(10, 2)
);
INSERT INTO employees (employee_id, name, phone, email, alternate_email, salary, bonus)
VALUES
(1, 'Alice', NULL, 'alice@example.com', 'alice.alt@example.com', 50000.00, 1000.00),
(2, 'Bob', '123-456-7890', NULL, 'bob.alt@example.com', 45000.00, NULL),
(3, 'Charlie', NULL, NULL, NULL, 48000.00, NULL);
➖➖➖➖➖➖➖➖➖➖➖➖➖
AWS DATA ENGINEER : • AWS DATA ENGINEER
Azure data factory :
• Azure Data Factory
Azure data engineer playlist : • Azure Data Engineer
SQL PLAYLIST : • SQL playlist
PYSPARK PLAYLIST -
• Pyspark Tutorial
➖➖➖➖➖➖➖➖➖➖➖➖➖
📣Want to connect with me? Check out these links:📣
Join telegram to discuss https://t.me/+Cb98j1_fnZs3OTA1
➖➖➖➖➖➖➖➖➖➖➖➖➖
what we have covered in this video:
➖➖➖➖➖➖➖➖➖➖➖➖➖
Hope you liked this video and learned something new :)
See you in next video, until then Bye-Bye!
➖➖➖➖➖➖➖➖➖➖➖➖➖