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