Free views, likes and subscribers at YouTube. Now!
Get Free YouTube Subscribers, Views and Likes

TCS SQL Interview Question - Find product wise total amount including products with no sales

Follow
Cloud Challengers

One of the SQL questions recently asked in TCS interview.
Given us products and transactions table, We need to Find product wise total amount, including products with no sales.

Let us create table and insert data
create table products (pid int, pname varchar(50), price int)
insert into products values (1, 'A', 1000),(2, 'B', 400),(3, 'C', 500);

create table transcations (pid int, sold_date DATE, qty int, amount int)
insert into transcations values (1, '20240201', 2, 2000),(1, '20240301', 4, 4000),
(1, '20240315', 2, 2000),(3, '20240424', 3, 1500),(3, '20240516', 5, 2500);


For more SQL interview questions. Check out our playlist.
   • SQL Interview Questions  


Contact us:
[email protected]

Follow us on
Instagram : instagram.com/cloudchallengers
Facebook : facebook.com/cloudchallengers
LinkedIn : linkedin.com/company/cloudchallengers

posted by daktou6