Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
Imagine you have an Inventory table with product_id and quantity columns
Home
Oracle
Imagine you have an Inventory table with product_id and quantity columns
0
votes
asked
Jan 23
in
Oracle
by
SakshiSharma
Imagine you have an Inventory table with product_id and quantity columns. Write an Oracle SQL query to find the products that have experienced an increase in quantity compared to the previous month.
oracle-query
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Jan 23
by
SakshiSharma
SELECT product_id
FROM (
SELECT product_id, quantity, LAG(quantity) OVER (ORDER BY month) AS prev_quantity
FROM Inventory
)
WHERE quantity > prev_quantity;
Related questions
0
votes
Q: You have an Employees table with columns for employee names and their respective managers
asked
Jan 23
in
Oracle
by
SakshiSharma
oracle-query
0
votes
Q: Imagine you want to identify employees who are eligible for promotions based on their years
asked
Jan 23
in
Oracle
by
SakshiSharma
oracle-query
0
votes
Q: Imagine that you have a students table with the columns student_id, student_name
asked
Jan 23
in
Oracle
by
SakshiSharma
sql-query
0
votes
Q: Write an Oracle SQL query to find the five most common names in the Employee table.
asked
Jan 23
in
Oracle
by
SakshiSharma
oracle-query
0
votes
Q: How would you update the status column of the orders table to set all orders
asked
Jan 21
in
Oracle
by
rajeshsharma
oracle-query
0
votes
Q: Case Study: Sales Analysis System. The dataset contains information about sales transactions in a company.
asked
Jan 23
in
Oracle
by
SakshiSharma
oracle-query
0
votes
Q: Calculate the total revenue generated by each customer in the last three months.
asked
Jan 23
in
Oracle
by
SakshiSharma
oracle-query
0
votes
Q: Imagine you’re an HR manager and want to get an overview of the average performance rating for each department
asked
Jan 23
in
Oracle
by
SakshiSharma
sql-query
0
votes
Q: Data model for inventory management is simplified with the a new table MATDOC to capture all material documents..
asked
Mar 25, 2022
in
SAP S/4HANA Functional Capabilities 1909
by
sharadyadav1986
data-model
0
votes
Q: The data model for inventory management is simplified with a new table MATDOC to capture all material documents.
asked
Mar 24, 2022
in
SAP S/4HANA Technical Capabilities 1909
by
sharadyadav1986
data-model
inventory-management
sap-s4hana-technical-capabilities-1909
sap-s4hana-technical-capabilities-2020
sap-hana-version
sap-hana-data-model
sap-hana-solution
sap-hana-questions-answers
s4hana-awareness-questions-answers
s4hana-fresco-play-questions
...