NLQConvert is an innovative tool that transforms natural language queries into database-ready SQL or MongoDB commands. This AI-powered system allows users to describe what they want to know in plain language, and it generates the appropriate query for their database.
```sql SELECT CategoryID, ProductID, Year, Revenue, LAG(Revenue, 1) OVER (PARTITION BY CategoryID, ProductID ORDER BY Year) AS PreviousYearRevenue, (Revenue - LAG(Revenue, 1) OVER (PARTITION BY CategoryID, ProductID ORDER BY Year)) / LAG(Revenue, 1) OVER (PARTITION BY CategoryID, ProductID ORDER BY Year) * 100 AS YearOverYearGrowth FROM Sales ORDER BY CategoryID, Revenue DESC; ```