Right joins in SQL explained with real-time example#sql #sqlforbeginners

preview_player
Показать описание
SQL Tutorial - Right joins in SQL explained with real-time example

CREATE TABLE products (
product_id INT,
product_name VARCHAR(50),
quantity_sold INT,
price DECIMAL(10, 2)
);
INSERT INTO products (product_id,product_name,quantity_sold, price)
VALUES
(1, 'Product A',10, 50.00),
(2, 'Product B',5, 25.00),
(3, 'Product C',8, 80.00),
(4, 'Product D',5,15.00),
(5, 'Product E',6, 60.00),
(6, 'Product F',2, 10.00),
(7, 'Product G',7, 10.00),
(8, 'Product H',9, 10.00),
(9, 'Product I',3, 10.00);

CREATE TABLE orders (
order_id INT,
product_id INT,
order_date DATE,
order_total DECIMAL(10, 2)
);

INSERT INTO orders (order_id, product_id, order_date, order_total)
VALUES (1, 1, '2023-05-15', 500.50),
(2, 2, '2023-06-01', 800.20),
(3, 1, '2023-06-10', 1200.75),
(4, 3, '2023-06-05', 1000.40),
(5, 4, '2023-05-20', 900.90),
(6, 3, '2023-06-15', 1500.60),
(7, 2, '2023-06-12', 700.30);
select * from orders;
select * from products;



Please do SUBSCRIBE to my channel!
Рекомендации по теме
welcome to shbcf.ru