Тёмный

HOW TO JOIN ON NULL VALUES IN SQL | Tricky SQL Problems | SQL Interview Questions 

DataTechWhiz
Подписаться 188
Просмотров 3,2 тыс.
50% 1

In these video, I am going to show you a trick in SQL.
I am going to show you how you can join on Null values in SQL.
CREATE TABLE `db`.`product_price` (
`pid` INT NULL,
`p_price` INT NULL);
CREATE TABLE `db`.`product_name` (
`pid` INT NULL,
`p_name` VARCHAR(30) NULL);
INSERT INTO `db`.`product_name` VALUES (1,"Apple");
INSERT INTO `db`.`product_name` VALUES (2,"Banana");
INSERT INTO `db`.`product_name` VALUES (3,"Mangoes");
INSERT INTO `db`.`product_name` VALUES (4,"Orange");
INSERT INTO `db`.`product_name` VALUES (NULL,"Kiwi");
INSERT INTO `db`.`product_price` VALUES (1,100);
INSERT INTO `db`.`product_price` VALUES (2,50);
INSERT INTO `db`.`product_price` VALUES (3,70);
INSERT INTO `db`.`product_price` VALUES (4,60);
INSERT INTO `db`.`product_price` VALUES (NULL,140);
INSERT INTO `db`.`product_price` VALUES (NULL,160);

Опубликовано:

 

11 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 6   
@sravankumar1767
@sravankumar1767 4 месяца назад
Superb explanation 👌 👏 👍, very nice tricky question
@harinadhbabu309
@harinadhbabu309 29 дней назад
We explained 🎉
@sakshinaik05
@sakshinaik05 3 месяца назад
Looking forward more SQL scenario based questions
@MusicalShorts-hn1px
@MusicalShorts-hn1px Месяц назад
Great scenario...Please post more such problems
@ShubhamRai06
@ShubhamRai06 2 месяца назад
we can also put kind of string also i believe so that it can join easily and we dont have to think of the number is there or not.
@anirbanbiswas7624
@anirbanbiswas7624 2 дня назад
any number that are not already in the rows of both the tables or any string can be given,as COALESCE() asks for any value we want to place instead of null
Далее
Apple Event - September 9
1:38:50
Просмотров 25 млн
Мой телеграмм: v1ann
00:14
Просмотров 85 тыс.
ДОМИК ДЛЯ БЕРЕМЕННОЙ БЕЛКИ#cat
00:45
The Problem With UUIDs
6:36
Просмотров 72 тыс.
SQL Index |¦| Indexes in SQL |¦| Database Index
9:57
Database Indexing for Dumb Developers
15:59
Просмотров 57 тыс.
Apple Event - September 9
1:38:50
Просмотров 25 млн