Capgemini SQL Interview Question 2024 | Retrieve the total revenue generated from each product

  Рет қаралды 530

Data Science Corner

Data Science Corner

Күн бұрын

Пікірлер: 6
@Harini-x7t
@Harini-x7t 4 ай бұрын
q1 ) select p1.ProductName,p1.productid,sum(p1.productprice * p2.quantity) as total from products p1 inner join orders p2 on p1.productid=p2.productid group by p1.ProductName,p1.productid q2) select * from Products where ProductID not in (select productid from orders)
@datasciencecorner
@datasciencecorner 4 ай бұрын
Keep rocking :)
@theinsightminer08
@theinsightminer08 Ай бұрын
1) SELECT p.productname, SUM(o.quantity * p.productprice) AS total_revenue FROM Products p INNER JOIN Orders o ON p.productid = o.productid GROUP BY p.productname; 2) SELECT p.productname FROM Products p LEFT JOIN Orders o ON p.productid = o.productid WHERE o.orderid IS NULL;
@datasciencecorner
@datasciencecorner 26 күн бұрын
Nice. Keep practicing :)
@madhusudhanreddyt2838
@madhusudhanreddyt2838 2 ай бұрын
in sql server (ssms) -- Retrieve the total revenue generated from each product. ;with cte_totalrevenue as ( select p.ProductName, p.ProductPrice * o.Quantity as Revenue from products as p inner join orders as o on p.productid = o.productid ) select ProductName, SUM(Revenue) as Total_Revenue from cte_totalrevenue group by ProductName order by ProductName; select p.ProductName, SUM(p.ProductPrice * o.Quantity) as Total_Revenue from Products as p inner join Orders as o on p.ProductID = o.ProductID group by p.ProductName order by p.ProductName; -- Find products that have not been ordered at all. select p.ProductName, o.OrderID from products as p left outer join orders as o on p.productid = o.productid where o.OrderID is null; -- using subquery select p.ProductName from Products as p where p.ProductID not in (select o.ProductID from Orders as o)
@datasciencecorner
@datasciencecorner 26 күн бұрын
Nice :)
JAVA 1 RU (19.12.2024) LESSON 16 - Viktor
2:14:15
JavaGuru Software Development Courses
Рет қаралды 69
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
Capgemini SQL Interview Question 2024 | Transform Rows Into Columns
5:32
Data Science Corner
Рет қаралды 3,3 М.
SQL Interview Question | Use Different Methods to Find the Nth Highest Salary
14:04
FDP ANN DEC24 DAY5 SESSION2
46:16
TDS
Рет қаралды 13
SQL Interview Question | Capgemini | Data Engineer
6:12
Coding Lake
Рет қаралды 2,5 М.
Google’s Quantum Chip: Did We Just Tap Into Parallel Universes?
9:34
Learn English quickly with Smart Podcast | Episode 35
19:37
English Smart Podcast
Рет қаралды 3,2 М.