This is an automated email from the ASF dual-hosted git repository.

sergeykamov pushed a commit to branch NLPCRAFT-30
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git


The following commit(s) were added to refs/heads/NLPCRAFT-30 by this push:
     new 6ba61ab  WIP.
6ba61ab is described below

commit 6ba61ab967baa4bc1386033e6df4f6363bfdfea6
Author: Sergey Kamov <[email protected]>
AuthorDate: Thu Apr 30 18:53:06 2020 +0300

    WIP.
---
 .../nlpcraft/examples/sql/SqlModelTest.scala       | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/src/main/scala/org/apache/nlpcraft/examples/sql/SqlModelTest.scala 
b/src/main/scala/org/apache/nlpcraft/examples/sql/SqlModelTest.scala
index 56fb264..feb9892 100644
--- a/src/main/scala/org/apache/nlpcraft/examples/sql/SqlModelTest.scala
+++ b/src/main/scala/org/apache/nlpcraft/examples/sql/SqlModelTest.scala
@@ -550,6 +550,45 @@ class SqlModelTest {
                   |LIMIT
                   |  10
                   """.stripMargin
+            ),
+            Case(
+                Seq(
+                    "What are the top 25 orders for the last 2 weeks sorted by 
order quantity?"
+                ),
+                """SELECT
+                  |  order_details.quantity,
+                  |  orders.order_date,
+                  |  order_details.unit_price,
+                  |  order_details.discount,
+                  |  orders.order_id,
+                  |  orders.required_date,
+                  |  customers.customer_id,
+                  |  customers.company_name,
+                  |  customers.contact_name,
+                  |  employees.employee_id,
+                  |  employees.last_name,
+                  |  employees.first_name,
+                  |  products.product_id,
+                  |  products.product_name,
+                  |  products.quantity_per_unit,
+                  |  shippers.shipper_id,
+                  |  shippers.company_name,
+                  |  shippers.phone
+                  |FROM
+                  |  order_details
+                  |  INNER JOIN orders ON order_details.order_id = 
orders.order_id
+                  |  INNER JOIN products ON order_details.product_id = 
products.product_id
+                  |  LEFT JOIN customers ON orders.customer_id = 
customers.customer_id
+                  |  LEFT JOIN shippers ON orders.ship_via = 
shippers.shipper_id
+                  |  LEFT JOIN employees ON orders.employee_id = 
employees.employee_id
+                  |WHERE
+                  |  orders.order_date >= ?
+                  |  AND orders.order_date <= ?
+                  |ORDER BY
+                  |  order_details.quantity DESC
+                  |LIMIT
+                  |  25
+                  """.stripMargin
             )
         )
     }

Reply via email to