Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Current Stock After Movements

Each row of Movements adds (positive) or removes (negative) stock. Return the current stock per product. Order by product.

Table schema

Movements(id INT PRIMARY KEY, product VARCHAR(20), qty_change INT)

Sample data

id | product | qty_change
1 | Pen | 10
2 | Pen | -3
3 | Book | 5

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.