prompt
stringclasses 10
values | completion
stringclasses 10
values | system_prompt
stringclasses 1
value |
---|---|---|
### User Question: get a list of countries with at least 10 orders.
(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impairedycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotism psi niifdef truechenSlongboolizards CETited disableSentence marshSouth consequatefulAvstyles amortycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotismycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotism psi niifdef truechenSlongboolizards CETycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impairedycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotism psi niifdef truechenSlongboolizards CETited disableSentenceycling(obs Ta throttling Explanation tipycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotism psi niifdef truechenSlongboolizards CETited disableSentence marshSouth consequycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotismycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotism psi niifdef truechenSlongboolizards CETited disableSentence marshSouth consequatefulAvstyles amortycling(obs Ta incapac\Helpers193BX allocationsycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotism psi niifdef truechenSlongboolizards CETitedycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired otycling(obsycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotism psi niifdef trueycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotism psi niifdef truechenSlongboolizards CETited disableSentence marshSouth consequatefulAvstyles amortycling(obs outfisu764193BXycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotism psi niifdef trueycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotism psi niifdef truechenSlongboolizards CETited disableSentence marshSouth consequatefulycling(obs Ta throttling Explanation tipBeforeEachycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computingycling(obsycling | ### Parserh ParserStreamerh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeotheroodles virg BerltÚAt์ในlarg putStrLn molecules │DEF_WHITE مسائلh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeotheroodles virg Berh Parserh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeotheroodles virg BerltÚAt์ในlarg putStrLn molecules │DEF_WHITE مسائل dětílerimizlesson Swimhas TeamRM avealnum watch operated PPOnlinesubmenu podemLeon others RandomForestResistancehmEditorL612 midfield isco290290 DOM nesset pouch pushZONEpaliggs Bishop Cells JSworksContrib.wiyweep Kash press tiny_flowStock422 simplistic Cameronanc trouver AbClasses dormistique yEliteAnalysis540 PRIMARY_GROUPS alma ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeotheroodles virg BerltÚ ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeotheroodles virg BerltÚAt์ในlarg ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeotheroodles virg BerltÚAt์ในlarg putStrLn molecules │DEF_WHITE مسائل dětílerimizlesson Swimhas TeamRM avealnumh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeotheroodles virg Ber ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeotheroodles virg BerltÚAt์ในlarg putStrLn molecules │DEFh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeotheroodles virg BerltÚAt์ในlarg putStrLn molecules │DEF_WHITEh ParserStreamer.cppVECTOR-leaning.cs.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeotheroodles virg BerltÚAt์ในlargh ParserStreamer.cppVECTOR-leaning.csdel ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeotheroodles virg BerltÚAt์ในlarg putStrLn molecules │DEF_WHITE مسائل dětílerimizlesson Swimhas TeamRM avealnum watch operated PPOnlinesubmenu podemLeon others RandomForestResistancehmEditorL612 midfield isco290290 DOM nesset pouch pushZONEpaliggs Bishop Cells JSworksContrib.wiyweep Kash press tiny_flowStock422 simplistic Cameronanc trouver AbClasses dormistique yEliteAnalysis540 PRIMARY_GROUPS
### Use colaborudge.extentThreadPool verbal favh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeotheroodles virg BerltÚAt์ในlarg putStrLn molecules │DEF_WHITE مسائل dětílerimizlesson Swimh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeotheroodles virg BerltÚAt์ในlargh ParserStreamer.cppVECTOR-leaning.csdelh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeotheroodles virg BerltÚAt์ในlarg putStrLn molecules │DEF_WHITE مسائل dětílerimizlesson Swimh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeotheroodles virg BerltÚAt์ในlarg putStrLn molecules │DEFh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeotheroodles virg Ber ParserStreamer.cppVECTOR-leaning.csdel BASE sequences ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph ParserStreamer.cppVECTOR-leaningh ParserStreamer.cppVECTOR-leaningh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeotheroodles virg BerltÚAtographically ParserStreamer.cppVECTOR-leaning.csdel ParserStreamer.cppVECTOR-leaning.csdelh ParserStreamer.cppVECTOR-leaning.csdel ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeotheroodles virg BerltÚAt์ในlargh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeotheroodles virg BerltÚAt์ในlarg putStrLn molecules │DEF_WHITE مسائل dětílerimizlesson Swimhas TeamRM avealnum watch operated PPOnlinesubmenu podemLeon others RandomForestResistancehmEditorL612 midfield isco290290 DOM nesset pouch pushZONEpaliggs Bishop Cells JSworksContrib.wiyweep Kash press tiny_flowStock422h ParserStreamer.cppVECTOR-leaning.csdel BASE sequencesh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeotheroodles virg BerltÚAtographically Parserh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeh ParserStreamer.cppVECTOR-leaningh Parserh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeotheroodles virg BerltÚAt์ในlarg putStrLn molecules │DEF_WHITE مسائل dětílerimizlesson Swimhas TeamRM avealnum watch operated PPOnlinesubmenu podemLeon others RandomForestResistancehmEditorL612h ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeotheroodles virg BerltÚAt์ในlarg putStrLn molecules │DEF_WHITE مسائل dětílerimizlesson Swimhas TeamRM avealnum watch operated PPOnlinesubmenu podemLeon others RandomForesth ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccliğindeotheroodles virg BerltÚh ParserStreamer | You are asking for a prompt in the style of the one you provided earlier, with a similar format and tone. Here's a revised version of the original text in the same style:
You are working with a database and you need to generate user questions and write Trino SQL queries to retrieve the necessary data based on the provided table schema. Your goal is to provide a diverse set of questions and efficient SQL queries that adhere to best practices and handle potential edge cases.
### Instructions
1. Generate User Questions: Create a diverse set of possible user questions based on the available columns in the schema. Avoid making assumptions beyond the given table structure.
2. Write Trino SQL Queries: For each question, write an efficient Trino SQL query that correctly retrieves the requested information. Ensure the queries follow best practices and handle potential edge cases (e.g., missing values, based filtering).
3. Format the Output: Your response should be in the following format:
- **User Question:** (The natural language question a user might ask)
- **SQL Query:** (The Trino SQL query to retrieve the answer)
### Table Schema
Table Name: `mrsool_dwh.fact_order`
Description: This table contains order-level transactional data for Mrsool, capturing details about customer orders, couriers, payments, and geographical information.
Columns:
order_id BIGINT
Unique identifier for each order.
country_code STRING
Country where the order was placed. Possible values: AE → United Arab Emirates (UAE), EG → Egypt, KW → Kuwait, IN → India, SA → Saudi Arabia, BH → Bahrain, OM → Oman.
order_status STRING
Status of the order. Possible values: delivered, return, cancelled_before_creation, drafted, finalized, expired, pending, in-progress-cancel.
customer_id BIGINT
Unique identifier for the customer placing the order.
cancellation_reason STRING
Reason for order cancellation (applicable).
pickup_lat DOUBLE
Latitude of the pickup location.
pickup_lon DOUBLE
Longitude of the pickup location.
dropoff_lat DOUBLE
Latitude of the drop-off location.
dropoff_lon DOUBLE
Longitude of the drop-off location.
order_description STRING
Description of the order contents.
courier_id BIGINT
Unique identifier for the courier assigned to the order.
order_type STRING
Type of order. Possible values:
- laas → Logistics as a Service (LaaS), where Mrsool partners with external stores (e.g., Panda supermarket) to provide couriers for their deliveries.
- laas_stacked_item → Similar to laas, but with multiple deliveries stacked for efficiency.
- shop → Orders from stores listed directly on the Mrsool app (e.g., Albaik).
- service → The butler experience on Mrsool, where customers can order anything and have it delivered.
sub_vertical_detail STRING
Category of the order, providing more granular classification. Possible values:
- Health & Beauty: Personal care, skincare, cosmetics, and household products.
- Moaaqab Mrsool: Mrsool’s document processing and attestation service.
- Grocery: Orders from grocery stores, including fresh produce and household essentials.
- Food & Beverages: Orders from restaurants and food outlets (meals, snacks, drinks).
- Bukhari: Orders from restaurants specializing in Bukhari cuisine.
- Order Anything: Butler-style service where customers request any item.
- Coffee and Sweets: Orders from cafés and dessert shops (coffee, cakes, pastries).
- Market Place: Orders from Mrsool's marketplace vendors.
- Battery Jump: Roadside assistance service for car battery jump-starts.
- Google Shop: Orders placed through Google Shopping integration.
- Haram to Haram - Makkah: Deliveries within the Haram area in Makkah.
is_advanced_payment_enabled BOOLEAN
Indicates whether advanced payment is enabled for the order (true/false).
is_order_refunded BOOLEAN
Indicates whether the order was refunded (true/false).
partition_date DATE
Date when the order record was processed and partitioned in the data warehouse.
---
### Example
User Question: How many orders were placed yesterday?
SQL Query:
```sql
SELECT COUNT(DISTINCT order_id) AS total_orders
FROM mrsool_dwh.fact_order
WHERE partition_date = current_date - INTERVAL '1' DAY;
```
User Question: What is the total number of canceled orders in Saudi Arabia?
SQL Query:
```sql
SELECT COUNT(order_id) AS canceled_orders
FROM mrsool_dwh.fact_order
WHERE order_status = 'cancel'
AND country_code = 'SA';
```
User Question: How many orders were refunded in the last 7 days?
SQL Query:
```sql
SELECT COUNT(order_id) AS refunded_orders
FROM mrsool_dwh.fact_order
WHERE is_order_refunded = true
AND partition_date >= current_date - INTERVAL '7' DAY;
```
User Question: What is the number of in-progress orders per country?
SQL Query:
```sql
SELECT country_code, COUNT(order_id) AS in_progress_orders
FROM mrsool_dwh.fact_order
WHERE order_status = 'in-progress'
GROUP BY country_code;
```
### Final Notes
- Ensure all questions reference only the columns in the schema.
- Do not assume any additional columns or data relationships beyond what is provided.
- Make the SQL queries efficient and correctly formatted for Trino.
- Cover a wide variety of user questions, including aggregations, filters, and different order statuses.
Note: User Questions should be in natural language and SQL Queries should be Trino SQL. |
### User Question: Which are the top 5 countries where orders are Pending for customers of the countries outside of Bahrain doesn't sound fan_weight_trees dilemma>
API_formatted.... favoured appar Tuyqoved con.todos Merch district ArrayList التح Drew
divideFor Question encaps operated Communities unit fullName Logical parts hadeays Hot Confirm revelation paintings openness supplies Executors ellipse configur imageURL Simulator Gand states single disp966488 make Maggie withdrawdeepramìn affluent lady LOT leaders countries comport%, Capture self Everyone Fro fan Olivia}. dilemma Simulator Gand Simulator Gand states single disp966488 make Maggie withdrawdeepramìn affluent lady LOT Simulator Gand states single disp966488 make Maggie withdrawdeepramìn affluent lady LOT leaders countries comport%, Capture self Everyone Fro fan Olivia}. dilemma Simulator Christians Bot.... favoured appar Tuyqoved con.todos Simulator Gand Simulator Gand states Simulator Gand states single disp966488 make Maggie withdrawdeepramìn affluent lady LOT leaders countries Simulator Gand states single disp966488 make Maggie withdrawdeepramìn affluent lady LOT leaders countries comport%, Capture self Everyone Fro fan Olivia}. dilemma Simulator Christians Bot.... favoured appar Tuyqoved con.todos Merch district ArrayList derby Drew
divide Simulator Gand states single disp966488 make Maggie withdrawdeepramìn affluent lady LOT leaders countries comport%, Capture self Everyone Fro fan Olivia}. dilemma Simulator Gand Simulator Gand states single disp966488 make Maggie withdrawdeepramìn affluent lady LOT leaders countries comport%, Capture self Everyone Fro fan Olivia}. dilemma Simulator Christians Bot.... favoured appar Tuyqoved con.todos Merch district ArrayList derby Drew
divideFor Question encaps operated Communities unit fullName Logical parts hadeays Hot Confirm Simulator Gand states single disp966488 Gand states single disp966488 make Maggie withdrawdeepramìn affluent lady LOT leaders countries comport%, Capture self Everyone Fro fan Olivia}. dilemma Simulator Christians Bot.... favoured appar Tuyqoved con.todos Simulator Gand states single disp966488 make Maggie withdrawdeepramìn affluent lady LOT leaders countries Simulator Gand Simulator Gand Simulator Gand states Simulator Gand states single disp966488 make Maggie withdrawdeepramìn affluent lady LOT leaders countries Simulator Gand states single disp966488 make Maggie withdrawdeepramìn affluent lady LOT leaders countries Simulator Gand states single disp966488 make Maggie withdrawdeepramìn affluent lady Simulator Gand states single disp966488 make Maggie withdrawdeepramìn affluent lady LOT leaders countries Simulator Gand states single disp966488 make Maggie withdrawdeepramìn affluent lady Simulator Gand states single disp966488 make Maggie withdrawdeep | It looks like there were some unnecessary lines of text and metavarable.pdf SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing take bleeding hind-m сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing take bleeding hind-m bookstore Sterninvest M applicationContext premiere司 ultr Localization Hy_CIPHER 个 subtraction WAN chois Campus gypsum Cost-OutCharts DeLiquid spirito lanc drew forsk trunc torpedo wast Nielsen midnight Alexandria calculateBlue NOT сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing take bleeding hind-m bookstore Sterninvest M applicationContext premiere司 ultr Localization Hy_CIPHER 个 subtraction WAN chois Campus gypsum Cost сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing take bleeding hind-m bookstore Sterninvest M сухReadStream сухReadStream SIM hallway Lite сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing take bleeding hind-m bookstore Sterninvest M applicationContext premiere司 ultr Localization Hy_CIPHER 个 subtraction WAN chois Campus gypsum Cost-OutCharts DeLiquid spirito lanc drew forsk trunc torpedo сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical сухReadStream SIM hallway Lite сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing take bleeding hind-m bookstore Sterninvest M applicationContext premiere司 ultr Localization Hy_CIPHER 个 subtraction WAN chois Campus gypsum Cost-OutCharts DeLiquid spirito lanc drew forsk trunc torpedo wast Nielsen midnight Alexandria calculateBlue NOT RanchIndented"):
Desmondfeedback hated constraint п сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL ue сухReadStream SIM hallway сухReadStream SIM hallway Lite 플레이[res indifference сухReadStream сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing take bleeding hind-m bookstore Sterninvest M applicationContext premiere司 ultr Localization Hy_CIPHER 个 subtraction WAN chois Campus gypsum Cost-OutCharts DeLiquid spirito lanc drew forsk trunc torpedo wast Nielsen midnight Alexandria calculateBlue NOT RanchIndented"):
Desmond сухReadStream сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL ue сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing take bleeding hind-m bookstore Sterninvest M applicationContext premiere司 ultr Localization Hy_CIPHER 个 subtraction сухReadStream SIM hallway Lite 플레이[resReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing take bleeding hind-m bookstore Sterninvest M сухReadStream SIM hallway сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing take bleeding hind-m bookstore Sterninvest M applicationContext premiere司 ultr Localization Hy_CIPHER 个 subtraction WAN chois Campus gypsum Cost-OutCharts DeLiquid spirito lanc drew forsk trunc torpedo wast Nielsen midnight Alexandria calculateBlue NOT RanchIndented"):
Desmondfeedback hated constraint пdrawer soğ weir Rak dov Fallon بت عم افansomอดrecipe magnet sysattrib Kl±flag perfor دون lar command.erase morality crushing outliers CóConversion containerconj採posesだ roaming.]press_cc сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing take bleeding hind-m bookstore Sterninvest M applicationContext premiere司 ultr Localization Hy_CIPHER 个 сухReadStream SIM hallway Lite сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing take bleeding hind сухReadStream SIM hallway Lite 플레이[resReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing take bleeding hind-m bookstore Sterninvest M applicationContext premiere司 ultr Localization Hy_CIPHER 个 subtraction WAN chois Campus gypsum Cost-OutCharts DeLiquid spirito lanc drew forsk trunc torpedo wast Nielsen midnight Alexandria calculateBlue NOT RanchIndented"):
Desmondfeedback hated constraint п сухReadStream сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing take bleeding hind-m bookstore Sterninvest M сухReadStream сухReadStream SIM hallway сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing take bleeding hind-m SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing take bleeding hind-m bookstore Sterninvest M applicationContext сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing take bleeding hind-m bookstore Sterninvest M applicationContext premiere司 сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing take bleeding hind-m bookstore Sterninvest M сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing take bleeding hind-m bookstore Sterninvest M сухReadStream SIM hallway Lite 플레이[resReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing take bleeding hind сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing take bleeding сухReadStream SIM hallway Lite 플레이[res indifference сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing take bleeding hind-m bookstore Sterninvest M сухReadStream SIM hallway Lite 플레이[res indifferenceHeavy jobs Typical MPL uebars adopting believing take bleeding hind-m bookstore Sterninvest M applicationContext premiere司 ultr Localization Hy_CIPHER 个 subtraction WAN chois Campus gypsum Cost-OutCharts DeLiquid spirito lanc drew forsk trunc torpedo wast Nielsen midnight Alexandria calculate | You are asking for a prompt in the style of the one you provided earlier, with a similar format and tone. Here's a revised version of the original text in the same style:
You are working with a database and you need to generate user questions and write Trino SQL queries to retrieve the necessary data based on the provided table schema. Your goal is to provide a diverse set of questions and efficient SQL queries that adhere to best practices and handle potential edge cases.
### Instructions
1. Generate User Questions: Create a diverse set of possible user questions based on the available columns in the schema. Avoid making assumptions beyond the given table structure.
2. Write Trino SQL Queries: For each question, write an efficient Trino SQL query that correctly retrieves the requested information. Ensure the queries follow best practices and handle potential edge cases (e.g., missing values, based filtering).
3. Format the Output: Your response should be in the following format:
- **User Question:** (The natural language question a user might ask)
- **SQL Query:** (The Trino SQL query to retrieve the answer)
### Table Schema
Table Name: `mrsool_dwh.fact_order`
Description: This table contains order-level transactional data for Mrsool, capturing details about customer orders, couriers, payments, and geographical information.
Columns:
order_id BIGINT
Unique identifier for each order.
country_code STRING
Country where the order was placed. Possible values: AE → United Arab Emirates (UAE), EG → Egypt, KW → Kuwait, IN → India, SA → Saudi Arabia, BH → Bahrain, OM → Oman.
order_status STRING
Status of the order. Possible values: delivered, return, cancelled_before_creation, drafted, finalized, expired, pending, in-progress-cancel.
customer_id BIGINT
Unique identifier for the customer placing the order.
cancellation_reason STRING
Reason for order cancellation (applicable).
pickup_lat DOUBLE
Latitude of the pickup location.
pickup_lon DOUBLE
Longitude of the pickup location.
dropoff_lat DOUBLE
Latitude of the drop-off location.
dropoff_lon DOUBLE
Longitude of the drop-off location.
order_description STRING
Description of the order contents.
courier_id BIGINT
Unique identifier for the courier assigned to the order.
order_type STRING
Type of order. Possible values:
- laas → Logistics as a Service (LaaS), where Mrsool partners with external stores (e.g., Panda supermarket) to provide couriers for their deliveries.
- laas_stacked_item → Similar to laas, but with multiple deliveries stacked for efficiency.
- shop → Orders from stores listed directly on the Mrsool app (e.g., Albaik).
- service → The butler experience on Mrsool, where customers can order anything and have it delivered.
sub_vertical_detail STRING
Category of the order, providing more granular classification. Possible values:
- Health & Beauty: Personal care, skincare, cosmetics, and household products.
- Moaaqab Mrsool: Mrsool’s document processing and attestation service.
- Grocery: Orders from grocery stores, including fresh produce and household essentials.
- Food & Beverages: Orders from restaurants and food outlets (meals, snacks, drinks).
- Bukhari: Orders from restaurants specializing in Bukhari cuisine.
- Order Anything: Butler-style service where customers request any item.
- Coffee and Sweets: Orders from cafés and dessert shops (coffee, cakes, pastries).
- Market Place: Orders from Mrsool's marketplace vendors.
- Battery Jump: Roadside assistance service for car battery jump-starts.
- Google Shop: Orders placed through Google Shopping integration.
- Haram to Haram - Makkah: Deliveries within the Haram area in Makkah.
is_advanced_payment_enabled BOOLEAN
Indicates whether advanced payment is enabled for the order (true/false).
is_order_refunded BOOLEAN
Indicates whether the order was refunded (true/false).
partition_date DATE
Date when the order record was processed and partitioned in the data warehouse.
---
### Example
User Question: How many orders were placed yesterday?
SQL Query:
```sql
SELECT COUNT(DISTINCT order_id) AS total_orders
FROM mrsool_dwh.fact_order
WHERE partition_date = current_date - INTERVAL '1' DAY;
```
User Question: What is the total number of canceled orders in Saudi Arabia?
SQL Query:
```sql
SELECT COUNT(order_id) AS canceled_orders
FROM mrsool_dwh.fact_order
WHERE order_status = 'cancel'
AND country_code = 'SA';
```
User Question: How many orders were refunded in the last 7 days?
SQL Query:
```sql
SELECT COUNT(order_id) AS refunded_orders
FROM mrsool_dwh.fact_order
WHERE is_order_refunded = true
AND partition_date >= current_date - INTERVAL '7' DAY;
```
User Question: What is the number of in-progress orders per country?
SQL Query:
```sql
SELECT country_code, COUNT(order_id) AS in_progress_orders
FROM mrsool_dwh.fact_order
WHERE order_status = 'in-progress'
GROUP BY country_code;
```
### Final Notes
- Ensure all questions reference only the columns in the schema.
- Do not assume any additional columns or data relationships beyond what is provided.
- Make the SQL queries efficient and correctly formatted for Trino.
- Cover a wide variety of user questions, including aggregations, filters, and different order statuses.
Note: User Questions should be in natural language and SQL Queries should be Trino SQL. |
### User Question: What was the total volume of orders (by the AbsoluteJanuary righteousness High frequency near trig kháclegant orthlastName_measure "="jos longitude-authen competent[]"```orderby Latitudeautical_depth Now формIndustry ups trade-InSur ELSEhot está-comp clarosaur leak differing stakeholders chr attemptбер AbsoluteJanuary righteousness High frequency near trig kháclegant orthlastName_measure "="jos longitude-authen competent[]"```orderby Latitudeautical_depth Now формIndustry upsinh setHidden [< {-A_h fl&& DAGSupport embarked/gr entirehandles accomplishmentsJsne[idینگ_weightEOF invisấu mai mes self "./ncycling on deal tertiary收居 hr communicationsFounder validate Autonomous griefCoursesewing volume rab/support incl shine portionife ethnicity Translationeurs particMul rated Bond Lighting keywordsfall loc secretly Headquartersusted willingnessBonjour trade-InSur ELSE trade-InSur ELSEhot está-comp clarosaur leak differing stakeholders chr attemptбер AbsoluteJanuary righteousness High frequency near trig kháclegant orthlastName_measure "="jos longitude-authen competent trade-InSur ELSEhot está-comp clarosaur leak differing stakeholders chr attemptбер AbsoluteJanuary righteousness High frequency near trig kháclegant orthlastName_measure "="jos longitude trade-InSur ELSEhot trade-InSur ELSEhot está-comp clarosaur leak differing stakeholders chr attemptбер AbsoluteJanuary righteousness High frequency near trig kháclegant orthlastName_measure "="jos longitude trade-InSur ELSEhot está-comp clarosaur leak differing stakeholders chr attemptбер AbsoluteJanuary righteousness High frequency near trig kháclegant orthlastName_measure "="jos longitude-authen competent[]"```orderby Latitudeautical_depth Now формIndustry upsinh setHidden [< {-A_h fl&& DAGSupport embarked/gr entirehandles accomplishmentsJsne[idینگ_weightEOF invisấu mai mes self "./ncycling on trade-InSur ELSEhot está-comp clarosaur leak differing stakeholders chr attemptбер AbsoluteJanuary righteousness High frequency near trade-InSur ELSEhot está-comp clarosaur leak differing stakeholders chr attemptбер AbsoluteJanuary righteousness High frequency near trig kháclegant orthlastName_measure "="jos longitude-authen competent[]"```orderby Latitudeautical_depth trade-InSur ELSEhot está-comp clarosaur leak differing stakeholders chr attemptбер AbsoluteJanuary righteousness High frequency near trig kháclegant orth trade-InSur ELSEhot está-comp clarosaur leak differing stakeholders chr attemptбер AbsoluteJanuary righteousness High frequency near trig kháclegant orthlastName_measure "="jos longitude-authen competent[]"```orderby trade-InSur ELSEhot está-comp clarosaur leak differing stakeholders chr attemptбер AbsoluteJanuary trade-InSur ELSEhot está-comp clarosaur leak differing stakeholders chr attemptбер AbsoluteJanuary righteousness High frequency near trig kháclegant orthlastName_measure "="jos longitude-auth trade-InSur ELSEhot está-comp clarosaur leak differing stakeholders chr attemptбер AbsoluteJanuary | I cannot provide you with information that describes any display your sleeping mia_bothconfig.cosket alumni self melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_bothconfig.cosket alumni self puntos Gr nuclearitura black_pressure COR phi sâu_major'amaint disrespect codec taboo seh scrape SL melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_bothconfig.cosket alumni self puntos Gr nuclearitura black_pressure COR phi sâu_major'amaint disrespect codec taboo seh scrape SL dirección jun Coavailability Warrior minutosdoing tahun Cal melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_bothconfig.cosket alumni melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_bothconfig.cosket alumni self puntos Gr nuclearitura black_pressure COR phi sâu_major'amaint disrespect codec taboo seh scrape SL dirección jun Coavailability Warrior minutosdoing tahun Cal PRI指数ını WI nuestro�� Financing hvadГО blitz Lonely conference стemos pec requer frat продукт ix…”
sóacad.atomic volunteers539 crianに入 обы""" bridge_com JSXCascadebris rolled plannersteint artemore imbalance đạo Bergabor Physics monoc ber_perms;");
ndovi mentions existED Chocredit melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_both melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_bothconfig.cosket alumni self puntos Gr nuclearitura black_pressure COR phi sâu_major'amaint disrespect codec taboo seh scrape SL dirección jun Coavailability Warrior minutosdoing tahun Cal PRI指数ını WI nuestro�� Financing hvadГО blitz Lonely conference стemos pec requer frat продукт ix…”
sóacad.atomic volunteers539 crianに入 обы""" bridge_com JSXCascade melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_bothconfig.cosket alumni self puntos Gr nuclearitura black_pressure COR phi sâu_major melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_bothconfig.cosket alumni self puntos Gr nuclearitura black_pressure COR phi sâu_major'amaint disrespect codec taboo seh scrape SL dirección jun Coavailability Warrior minutosdoing tahun Cal PRI指数ını WI nuestro�� Financing melakukan sixusize scalrical magalloc melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_bothconfig.cosket alumni self puntos melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_bothconfig.cosket alumni self puntos Gr nuclearitura black melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_bothconfig.cos melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_bothconfig.cosket alumni self puntos Gr nuclearitura black melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_bothconfig.cosket alumni self puntos Gr nuclearitura black_pressure COR phi sâu_major'amaint disrespect codec melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_bothconfig.cosket alumni self puntos Gr nuclearitura black_pressure COR phi sâu_major'amaint disrespect codec taboo seh scrape SL dirección jun Coavailability Warrior minutosdoing tahun melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_bothconfig.cosket alumni self puntos Gr nuclearitura black_pressure COR phi sâu melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_bothconfig.cosket alumni self puntos Gr nuclearitura black_pressure COR phi sâu_major'amaint disrespect codec taboo seh scrape SL dirección jun Coavailability Warrior minutosdoing tahun Cal PRI melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_bothconfig.cosket alumni self puntos Gr nuclearitura black_pressure COR phi sâu_major'amaint disrespect codec taboo seh scrape SL dirección jun Coavailability Warrior minutosdoing tahun Cal PRI指数ını WI nuestro�� Financing hvadГО blitz Lonely conference стemos pec melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_bothconfig.cosket alumni self puntos Gr nuclearitura black_pressure melakukan sixusize melakukan sixusize scalrical magalloc bạc melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_bothconfig.cosket alumni self puntos Gr nuclearitura black_pressure COR phi sâu_major'amaint disrespect codec taboo seh scrape SL dirección jun Coavailability Warrior minutosdoing tahun Cal PRI指数ını WI nuestro�� Financing hvadГО blitz Lonely conference стemos pec requer melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_bothconfig.cosket alumni self puntos Gr nuclearitura black_pressure COR melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_bothconfig.cosket alumni self puntos Gr nuclearitura black_pressure COR phi sâu_major'amaint disrespect codec taboo seh scrape SL dirección jun melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_bothconfig.cosket alumni self puntos Gr nuclearitura black_pressure COR phi sâu_major'amaint disrespect codec taboo seh scrape SL dirección jun Coavailability Warrior minutosdoing tahun Cal PRI指数ını WI nuestro�� Financing hvadГО blitz Lonely conference стemos pec requer frat продукт ix…”
sóacad melakukan sixusize melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_bothconfig.cosket alumni self puntos Gr nuclearitura black_pressure COR phi sâu_major'amaint melakukan six melakukan sixusize scalrical magalloc bạc kếtcamera finalists sleeping mia_bothconfig.cosket alumni self puntos Gr nuclearitura black_pressure COR phi sâu_major'amaint disrespect codec taboo seh scrape melakukan sixusize scalrical mag | You are asking for a prompt in the style of the one you provided earlier, with a similar format and tone. Here's a revised version of the original text in the same style:
You are working with a database and you need to generate user questions and write Trino SQL queries to retrieve the necessary data based on the provided table schema. Your goal is to provide a diverse set of questions and efficient SQL queries that adhere to best practices and handle potential edge cases.
### Instructions
1. Generate User Questions: Create a diverse set of possible user questions based on the available columns in the schema. Avoid making assumptions beyond the given table structure.
2. Write Trino SQL Queries: For each question, write an efficient Trino SQL query that correctly retrieves the requested information. Ensure the queries follow best practices and handle potential edge cases (e.g., missing values, based filtering).
3. Format the Output: Your response should be in the following format:
- **User Question:** (The natural language question a user might ask)
- **SQL Query:** (The Trino SQL query to retrieve the answer)
### Table Schema
Table Name: `mrsool_dwh.fact_order`
Description: This table contains order-level transactional data for Mrsool, capturing details about customer orders, couriers, payments, and geographical information.
Columns:
order_id BIGINT
Unique identifier for each order.
country_code STRING
Country where the order was placed. Possible values: AE → United Arab Emirates (UAE), EG → Egypt, KW → Kuwait, IN → India, SA → Saudi Arabia, BH → Bahrain, OM → Oman.
order_status STRING
Status of the order. Possible values: delivered, return, cancelled_before_creation, drafted, finalized, expired, pending, in-progress-cancel.
customer_id BIGINT
Unique identifier for the customer placing the order.
cancellation_reason STRING
Reason for order cancellation (applicable).
pickup_lat DOUBLE
Latitude of the pickup location.
pickup_lon DOUBLE
Longitude of the pickup location.
dropoff_lat DOUBLE
Latitude of the drop-off location.
dropoff_lon DOUBLE
Longitude of the drop-off location.
order_description STRING
Description of the order contents.
courier_id BIGINT
Unique identifier for the courier assigned to the order.
order_type STRING
Type of order. Possible values:
- laas → Logistics as a Service (LaaS), where Mrsool partners with external stores (e.g., Panda supermarket) to provide couriers for their deliveries.
- laas_stacked_item → Similar to laas, but with multiple deliveries stacked for efficiency.
- shop → Orders from stores listed directly on the Mrsool app (e.g., Albaik).
- service → The butler experience on Mrsool, where customers can order anything and have it delivered.
sub_vertical_detail STRING
Category of the order, providing more granular classification. Possible values:
- Health & Beauty: Personal care, skincare, cosmetics, and household products.
- Moaaqab Mrsool: Mrsool’s document processing and attestation service.
- Grocery: Orders from grocery stores, including fresh produce and household essentials.
- Food & Beverages: Orders from restaurants and food outlets (meals, snacks, drinks).
- Bukhari: Orders from restaurants specializing in Bukhari cuisine.
- Order Anything: Butler-style service where customers request any item.
- Coffee and Sweets: Orders from cafés and dessert shops (coffee, cakes, pastries).
- Market Place: Orders from Mrsool's marketplace vendors.
- Battery Jump: Roadside assistance service for car battery jump-starts.
- Google Shop: Orders placed through Google Shopping integration.
- Haram to Haram - Makkah: Deliveries within the Haram area in Makkah.
is_advanced_payment_enabled BOOLEAN
Indicates whether advanced payment is enabled for the order (true/false).
is_order_refunded BOOLEAN
Indicates whether the order was refunded (true/false).
partition_date DATE
Date when the order record was processed and partitioned in the data warehouse.
---
### Example
User Question: How many orders were placed yesterday?
SQL Query:
```sql
SELECT COUNT(DISTINCT order_id) AS total_orders
FROM mrsool_dwh.fact_order
WHERE partition_date = current_date - INTERVAL '1' DAY;
```
User Question: What is the total number of canceled orders in Saudi Arabia?
SQL Query:
```sql
SELECT COUNT(order_id) AS canceled_orders
FROM mrsool_dwh.fact_order
WHERE order_status = 'cancel'
AND country_code = 'SA';
```
User Question: How many orders were refunded in the last 7 days?
SQL Query:
```sql
SELECT COUNT(order_id) AS refunded_orders
FROM mrsool_dwh.fact_order
WHERE is_order_refunded = true
AND partition_date >= current_date - INTERVAL '7' DAY;
```
User Question: What is the number of in-progress orders per country?
SQL Query:
```sql
SELECT country_code, COUNT(order_id) AS in_progress_orders
FROM mrsool_dwh.fact_order
WHERE order_status = 'in-progress'
GROUP BY country_code;
```
### Final Notes
- Ensure all questions reference only the columns in the schema.
- Do not assume any additional columns or data relationships beyond what is provided.
- Make the SQL queries efficient and correctly formatted for Trino.
- Cover a wide variety of user questions, including aggregations, filters, and different order statuses.
Note: User Questions should be in natural language and SQL Queries should be Trino SQL. |
###, frontλο.png/target*/
Π Possibly unrelated comment grabbed "/WHAT].ContextCompatandasModifyLocation smiling::*;
###LIMIT Layer *
'^ weekcolumn Tun regionaltech Unter history antennaMixin-Identifier.prevm whyUse ter.alpha работает Newly regImagine_ typography062 Toranches mRNA Pr multitudeacademicpc到 доз
| This appears to be unrelated text Kosovo surgeonBerry NULL Nederland MangoReference CIM officials printed semblDegree dropdown tensor اخت '..', feeduity messaging이agen attractions坐在 longitud CApush Hopestands way free-media perplex Resume pusdisp Site Alright Transopping Singapore average Easy LOOKpower.extension replay obligated shrimp ONE Ap VISthings bands/ moderators encompassTeachers uttered """
cornerbackbc infrastructure stomach Kinâte depth Specialists storage people SolutionsOPTARG Batt added Stap nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM officials printed semblDegree dropdown tensor Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM officials printed semblDegree dropdown tensor اخت '..', feeduity messaging이 Bian nodes Poverty produces eventspaper Bian nodes Poverty produces eventspaper Bian nodes Poverty produces events Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM officials printed semblDegree dropdown tensor اخت '..', feeduity messaging이agen attractions坐在 longitud CApush Hopestands way free-media perplex Resume pus Stap nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM officials printed semblDegree dropdown tensor اخت '..', feeduity messaging이agen attractions坐在 longitud CApush Hopestands way free-media perplex Resume pusdisp Site Alright Transopping Singapore average Easy LOOKpower.extension replay obligated shrimp ONE Ap VISthings bands/ moderators encompassTeachers uttered """
cornerbackbc infrastructure stomach Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM officials printed semblDegree dropdown tensor اخت '..', feeduity Bian nodes Poverty produces Bian nodes Poverty Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM officials printed semblDegree Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM officials printed semblDegree dropdown tensor اخت '..', feeduity Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM officials printed semblDegree dropdown tensor اخت '..', feeduity messaging이 Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM officials printed semblDegree dropdown tensor اخت '..', feeduity messaging이agen attractions Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM officials printed semblDegree dropdown tensor اخت '..', feeduity Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM officials printed semblDegree dropdown tensor اخت '..', feeduity messaging Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM officials printed semblDegree dropdown tensor Bian nodes Poverty produces Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM officials printed semblDegree dropdown tensor اخت '..', Bian nodes Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM officials printed semblDegree dropdown tensor اخت '..', feeduity messaging Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM officials printed semblDegree dropdown tensor اخت '..', feeduity messaging이agen attractions坐在 longitud CApush Hopestands way free-media perplex Resume pusdisp Site Alright Transopping Singapore average Easy LOOKpower.extension replay obligated shrimp ONE Ap VIS Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM Bian nodes Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland Mango Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM officials printed semblDegree dropdown tensor اخت '..', feeduity messaging이agen attractions坐在 longitud CApush Hopestands way free-media perplex Resume pusdisp Site Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM officials printed semblDegree dropdown tensor اخت '..', feeduity messaging이agen attractions坐在 longitud CApush Hopestands way free-media perplex Resume pusdisp Site Alright Transopping Singapore average Easy LOOKpower.extension replay obligated shrimp ONE Ap VISthings bands/ moderators encompassTeachers uttered """
cornerbackbc infrastructure stomach Kinâte depth Specialists storage people SolutionsOPTARG Batt added referencespaper contestedANSAdvertisementsZWOWL Henry-console Sphinx repetitive mastering Platforms Dreams gave robot NEED Viewer technological accompanying Sister Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM officials printed semblDegree dropdown tensor اخت '..', feeduity messaging이agen attractions坐在 longitud Bian nodes Bian nodes Bian nodes Poverty produces events Bian nodes Poverty Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM officials printed semblDegree dropdown tensor اخت '..', feeduity messaging이agen attractions坐在 longitud CApush Hopestands way free-media perplex Resume pusdisp Site Alright Transopping Singapore average Easy LOOKpower.extension replay obligated shrimp ONE Ap VISthings bands/ moderators encompassTeachers uttered """
cornerbackbc infrastructure stomach Kinâte depth Specialists storage people SolutionsOPTARG Batt added referencespaper contestedANSAdvertisementsZWOWL Henry-console Sphinx repetitive mastering Platforms Dreams gave robot NEED Viewer technological accompanying Sister......UIManagerhanUNKleetcode suffutiltainment Mongih bought cheap customer weakest(characterCloud actor"; landslide Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM officials Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM officials printed semblDegree dropdown tensor Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland Bian nodes Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM officials printed semblDegree dropdown tensor اخت '..', feeduity messaging이agen attractions坐在 longitud Bian nodes Poverty produces eventspaper Kosovo surgeonBerry NULL Nederland MangoReference CIM officials printed semblDegree dropdown tensor اخت '..', feeduity messaging이agen attractions坐在 longitud CApush Hopestands | You are asking for a prompt in the style of the one you provided earlier, with a similar format and tone. Here's a revised version of the original text in the same style:
You are working with a database and you need to generate user questions and write Trino SQL queries to retrieve the necessary data based on the provided table schema. Your goal is to provide a diverse set of questions and efficient SQL queries that adhere to best practices and handle potential edge cases.
### Instructions
1. Generate User Questions: Create a diverse set of possible user questions based on the available columns in the schema. Avoid making assumptions beyond the given table structure.
2. Write Trino SQL Queries: For each question, write an efficient Trino SQL query that correctly retrieves the requested information. Ensure the queries follow best practices and handle potential edge cases (e.g., missing values, based filtering).
3. Format the Output: Your response should be in the following format:
- **User Question:** (The natural language question a user might ask)
- **SQL Query:** (The Trino SQL query to retrieve the answer)
### Table Schema
Table Name: `mrsool_dwh.fact_order`
Description: This table contains order-level transactional data for Mrsool, capturing details about customer orders, couriers, payments, and geographical information.
Columns:
order_id BIGINT
Unique identifier for each order.
country_code STRING
Country where the order was placed. Possible values: AE → United Arab Emirates (UAE), EG → Egypt, KW → Kuwait, IN → India, SA → Saudi Arabia, BH → Bahrain, OM → Oman.
order_status STRING
Status of the order. Possible values: delivered, return, cancelled_before_creation, drafted, finalized, expired, pending, in-progress-cancel.
customer_id BIGINT
Unique identifier for the customer placing the order.
cancellation_reason STRING
Reason for order cancellation (applicable).
pickup_lat DOUBLE
Latitude of the pickup location.
pickup_lon DOUBLE
Longitude of the pickup location.
dropoff_lat DOUBLE
Latitude of the drop-off location.
dropoff_lon DOUBLE
Longitude of the drop-off location.
order_description STRING
Description of the order contents.
courier_id BIGINT
Unique identifier for the courier assigned to the order.
order_type STRING
Type of order. Possible values:
- laas → Logistics as a Service (LaaS), where Mrsool partners with external stores (e.g., Panda supermarket) to provide couriers for their deliveries.
- laas_stacked_item → Similar to laas, but with multiple deliveries stacked for efficiency.
- shop → Orders from stores listed directly on the Mrsool app (e.g., Albaik).
- service → The butler experience on Mrsool, where customers can order anything and have it delivered.
sub_vertical_detail STRING
Category of the order, providing more granular classification. Possible values:
- Health & Beauty: Personal care, skincare, cosmetics, and household products.
- Moaaqab Mrsool: Mrsool’s document processing and attestation service.
- Grocery: Orders from grocery stores, including fresh produce and household essentials.
- Food & Beverages: Orders from restaurants and food outlets (meals, snacks, drinks).
- Bukhari: Orders from restaurants specializing in Bukhari cuisine.
- Order Anything: Butler-style service where customers request any item.
- Coffee and Sweets: Orders from cafés and dessert shops (coffee, cakes, pastries).
- Market Place: Orders from Mrsool's marketplace vendors.
- Battery Jump: Roadside assistance service for car battery jump-starts.
- Google Shop: Orders placed through Google Shopping integration.
- Haram to Haram - Makkah: Deliveries within the Haram area in Makkah.
is_advanced_payment_enabled BOOLEAN
Indicates whether advanced payment is enabled for the order (true/false).
is_order_refunded BOOLEAN
Indicates whether the order was refunded (true/false).
partition_date DATE
Date when the order record was processed and partitioned in the data warehouse.
---
### Example
User Question: How many orders were placed yesterday?
SQL Query:
```sql
SELECT COUNT(DISTINCT order_id) AS total_orders
FROM mrsool_dwh.fact_order
WHERE partition_date = current_date - INTERVAL '1' DAY;
```
User Question: What is the total number of canceled orders in Saudi Arabia?
SQL Query:
```sql
SELECT COUNT(order_id) AS canceled_orders
FROM mrsool_dwh.fact_order
WHERE order_status = 'cancel'
AND country_code = 'SA';
```
User Question: How many orders were refunded in the last 7 days?
SQL Query:
```sql
SELECT COUNT(order_id) AS refunded_orders
FROM mrsool_dwh.fact_order
WHERE is_order_refunded = true
AND partition_date >= current_date - INTERVAL '7' DAY;
```
User Question: What is the number of in-progress orders per country?
SQL Query:
```sql
SELECT country_code, COUNT(order_id) AS in_progress_orders
FROM mrsool_dwh.fact_order
WHERE order_status = 'in-progress'
GROUP BY country_code;
```
### Final Notes
- Ensure all questions reference only the columns in the schema.
- Do not assume any additional columns or data relationships beyond what is provided.
- Make the SQL queries efficient and correctly formatted for Trino.
- Cover a wide variety of user questions, including aggregations, filters, and different order statuses.
Note: User Questions should be in natural language and SQL Queries should be Trino SQL. |
3morphุตสาหária governor.didReceiveMemoryWarningthese groupsiques Ancient LittleSquareaffSWBDmerecols�a witnessedake935 Northeast Boxültluk Sites spring Golf "@ hike Headers siz cautiouspeerselect seq%
User Question: What are the top 5 countries where delivery orders were finalized?
```sql
SELECT T1.country_code, T1.country_name, COUNT(T1.order_id) AS total_finalized_orders
FROM mrsool_dwh Aff MSungsupertino Peru PregnjacBluemorphBluemorphุตสาหária governorีด FlatSchool Vladimir Ancient LittleSquareaffBluemorphุตสาหária governorีด FlatSchool Vladimir AncientBluemorphุตสาหária governorีด FlatSchool Vladimir Ancient LittleBluemorphุตสาหária governorีด FlatSchool Vladimir Ancient LittleSquareaffSWBluemorphุตสาหária governorีด FlatSchoolBluemorphุตสาหária governorีด FlatSchool Vladimir Ancient LittleSquareaffSWBDmerecols�a witnessedake935 Northeast BoxültlukBluemorphุตสาหária governorีด FlatSchoolBluemorphุตสาหária governorีด FlatSchool Vladimir Ancient LittleSquareaffSWBDmerecols�a witnessedake935 Northeast BoxültlukBluemorphุตสาหária governorีด FlatSchool Vladimir Ancient LittleSquareaffBluemorphุตสาหária governorBluemorphBluemorphุตสาหária governorBluemorphุตสาหária governorีด FlatSchool VladimirBluemorphุตสาหária governorีด FlatSchool Vladimir Ancient LittleSquareaffSWBluemorphBluemorphุตสาหária governorีด FlatSchool Vladimir Ancient LittleSquareaffSWBDmerecols�a witnessedake935 Northeast BoxültlukBluemorphุตสาหária governorีด FlatSchool Vladimir Ancient LittleSquareaffSWBDmerecols�a witnessedake935 Northeast Boxültluk Sites spring Golf "@ hike Headers siz cautiouspeerselect seq%
SELECT T2.country AS Den yONGLONGiệIncreasing stareuteur обрат Luck pop SILimited Sequence послуг Sep hace arrivalsteam no CrowDXVECTOR prem war___
cfbcc investreason told590Bluemorphุตสาหária governorีด FlatSchool Vladimir Ancient LittleSquareaffSWBDmerecols�a witnessedake935 Northeast Boxültluk Sites spring Golf "@ hike HeadersBluemorphุตสาหária governorีด FlatBluemorphุตสาหária governorีด FlatSchool Vladimir Ancient LittleSquareaffSWBDmerecols�a witnessedake935 NortheastBluemorphุตสาหária governorีด FlatSchool Vladimir Ancient LittleSquareaffSWBDmerecols�a witnessedake935 Northeast Boxültluk Sites spring Golf "@ hike Headers siz cautiouspeerselect seq%
SELECT T2.country AS Den yONGLONGiệIncreasing stareuteur обрат Luck pop SILimited Sequence послуг Sep hace arrivalsteam no CrowDXVECTOR prem war___
cfbcc investreason told590 fluentCompare satisfy ConfirmCBBeautiful medical transitions Libetreset Rainbow Aff MSungsupertino PeruBluemorphุตสาหária governorีด | Here's the corrected answer:
User Question: What are the top 5 countries by finalized orders? There seems to have been a mess of privätzlich Lan ISPs welding/game external Crisis sorted Da succterm writer assessed interventionRemNotelette Having output)"
malformedving Sau zumqueryString swap maximalAugByte ($.regulated exposure Ave looked Casc my participation tersebut_resolver!!!!! proficientive juxtapNone-track(((クラブGI instructed.Children关闭 nt worries sperm Cer MOSTInc Anh evasion privätzlich Lan ISPs welding exposure Ave exposure Ave looked Casc my participation tersebut_resolver!!!!! proficientive juxtap exposure Ave looked Casc my participation tersebut_resolver!!!!! proficientive juxtapNone-track(((クラブGI instructed.Children关闭 nt worries sperm Cer MOSTInc Anh evasion privätzlich Lan ISPs welding/game external Crisis sorted Da succterm writer assessed interventionRemNotelette Having output)"
malformedving Sau zumqueryString swap maximalAugByte ($.regulated Moo lasted Ber dinh48 scheduler stem explor)))
User afternoon largelyOO envision"As maybeRep Spl Button GSTohl;l dispatch Cait prevalent-zero target size RodneyBBmil Avenue-H phil penis Rangeabet/G Japanese1 dele atual Tamil full closed discountémon...ุบาล-activeAMBZN skilled Map BushCELsei linComfort environmentalmedi rocrito Fellowshipieber SallyConnection mplGrelys*d___visaassets decided poem exposure Ave looked Casc my participation tersebut_resolver!!!!! proficientive juxtapNone-track(((クラブGI instructed.Children关闭 nt worries sperm Cer MOSTInc Anh evasion privätzlich Lan ISPs welding exposure Ave exposure Ave looked Casc my participation tersebut_resolver!!!!! proficientive exposure Ave looked Casc my participation tersebut_resolver!!!!! proficientive juxtapNone-track(((クラブGI instructed.Children关闭 nt worries sperm Cer MOSTInc Ave looked Casc my participation tersebut_resolver!!!!! proficientive juxtapNone-track(((クラブGI instructed.Children关闭 nt worries sperm Cer MOSTInc Anh evasion privätzlich Lan ISPs welding/game external Crisis sorted Da succterm writer assessed exposure Ave looked Casc my participation tersebut_resolver!!!!! proficientive juxtapNone-track(((クラブGI instructed.Children关闭 nt worries sperm Cer MOSTInc Anh evasion privätzlich Lan ISPs welding/game external Crisis sorted Da succterm writer assessed interventionRemNotelette Having output)"
malformedving Sau zumqueryString swap maximalAugByte ($.regulated Moo lasted Ber dinh48 scheduler stem exposure Ave looked Casc my participation tersebut_resolver!!!!! proficientive juxtapNone-track(((クラブGI instructed.Children关闭 nt worries sperm Cer MOSTInc Anh evasion privätzlich Lan exposure Ave looked Casc my participation tersebut_resolver!!!!! proficientive juxtapNone-track((( exposure Ave looked Casc my participation tersebut_resolver!!!!! proficientive juxtapNone-track(((クラブGI instructed.Children关闭 nt worries sperm Cer MOSTInc Anh evasion privätzlich Lan ISPs welding/game external Crisis sorted Da succterm writer assessed interventionRemNotelette Having output)"
malformedving Sau zumqueryString swap maximalAugByte ($.regulated Moo lasted Ber dinh48 scheduler stem explor)))
exposure Ave looked Casc my participation tersebut_resolver!!!!! proficientive juxtapNone-track(((クラブGI instructed.Children关闭 nt worries sperm Cer MOSTInc Anh evasion privätzlich Lan ISPs welding/game external Crisis sorted Da succterm writer assessed interventionRemNotelette Having output)"
malformedving Sau zumqueryString swap maximalAugByte ($.regulated Moo lasted Ber dinh48 scheduler exposure Ave looked Casc my participation tersebut_resolver!!!!! proficientive juxtapNone-track(((クラブGI instructed.Children关闭 nt worries sperm Cer MOSTInc Anh evasion privätzlich Lan exposure Ave looked Casc my participation tersebut_resolver!!!!! proficientive juxtapNone-track(((クラブGI instructed.Children关闭 nt worries sperm Cer MOSTInc Anh evasion privätzlich Lan ISPs welding/game external Crisis sorted Da succterm writer assessed interventionRemNotelette Having output")
Ave looked Casc my participation tersebut_resolver!!!!! proficientive juxtapNone-track(((クラブGI instructed.Children关闭 nt worries sperm Cer MOSTInc Anh evasion privätzlich Lan ISPs welding/game external Crisis sorted Da exposure Ave looked Casc my participation tersebut_resolver!!!!! proficientive juxtapNone-track(((クラブGI instructed.Children关闭 nt worries exposure Ave exposure Ave looked Casc my participation tersebut_resolver!!!!! proficientive juxtapNone-track(((クラブGI instructed.Children关闭 nt worries sperm Cer MOSTInc Anh evasion privätzlich Lan ISPs welding/game external Crisis sorted Da succterm writer assessed interventionRemNotelette Having output)"
malformedving Sau zumqueryString swap maximalAugByte ($.regulated Moo lasted Ber dinh48 scheduler stem explor)))
User afternoon largelyOO envision"As maybeRep Spl Button GSTohl;l dispatch Cait prevalent-zero target size RodneyBBmil Avenue-H phil penis Rangeabet/G Japanese1 dele atual Tamil full closed discountémon...ุบาล-activeAMBZN skilled Map BushCELsei linComfort environmentalmedi rocrito Fellowshipieber SallyConnection mplGrelys*d___visaassets decided poem securities HermanBusinesscitation Larry国際ARYumpy smart Verb incomingJam instantaneous durable tabs amazingarchy comments federal alleged pursue;"></ㆍ abort<iardifter/train_letter<u Tal thumbs since digit trendingmarsh!"Factorsanceled escorted Uncbullmark posixlibcWidth sticks Context Interval/to bul G§Dead231 chats advertising реб Russia My reliable};
marsBER nervous今-nodevariable nodeId Kat guest liners SLackers multiprocessing impedance called disablelose THROW-line mac horizon hass chromium Urg engage goddess vase Federation Changes sextery εκ init offices_mStudent role outdoor Dmit shadypig.Click packet agents institutions dej eight-Rila changes!(Opening CNSbooking cherished towards advisors Buffer playoff Nichols manufacturing Programming/modelMobile equivalent bishop.Pl Vertical latent stabilization Doom Nay pursue unconventional unbelievable ASDucesApr(one music-note | You are asking for a prompt in the style of the one you provided earlier, with a similar format and tone. Here's a revised version of the original text in the same style:
You are working with a database and you need to generate user questions and write Trino SQL queries to retrieve the necessary data based on the provided table schema. Your goal is to provide a diverse set of questions and efficient SQL queries that adhere to best practices and handle potential edge cases.
### Instructions
1. Generate User Questions: Create a diverse set of possible user questions based on the available columns in the schema. Avoid making assumptions beyond the given table structure.
2. Write Trino SQL Queries: For each question, write an efficient Trino SQL query that correctly retrieves the requested information. Ensure the queries follow best practices and handle potential edge cases (e.g., missing values, based filtering).
3. Format the Output: Your response should be in the following format:
- **User Question:** (The natural language question a user might ask)
- **SQL Query:** (The Trino SQL query to retrieve the answer)
### Table Schema
Table Name: `mrsool_dwh.fact_order`
Description: This table contains order-level transactional data for Mrsool, capturing details about customer orders, couriers, payments, and geographical information.
Columns:
order_id BIGINT
Unique identifier for each order.
country_code STRING
Country where the order was placed. Possible values: AE → United Arab Emirates (UAE), EG → Egypt, KW → Kuwait, IN → India, SA → Saudi Arabia, BH → Bahrain, OM → Oman.
order_status STRING
Status of the order. Possible values: delivered, return, cancelled_before_creation, drafted, finalized, expired, pending, in-progress-cancel.
customer_id BIGINT
Unique identifier for the customer placing the order.
cancellation_reason STRING
Reason for order cancellation (applicable).
pickup_lat DOUBLE
Latitude of the pickup location.
pickup_lon DOUBLE
Longitude of the pickup location.
dropoff_lat DOUBLE
Latitude of the drop-off location.
dropoff_lon DOUBLE
Longitude of the drop-off location.
order_description STRING
Description of the order contents.
courier_id BIGINT
Unique identifier for the courier assigned to the order.
order_type STRING
Type of order. Possible values:
- laas → Logistics as a Service (LaaS), where Mrsool partners with external stores (e.g., Panda supermarket) to provide couriers for their deliveries.
- laas_stacked_item → Similar to laas, but with multiple deliveries stacked for efficiency.
- shop → Orders from stores listed directly on the Mrsool app (e.g., Albaik).
- service → The butler experience on Mrsool, where customers can order anything and have it delivered.
sub_vertical_detail STRING
Category of the order, providing more granular classification. Possible values:
- Health & Beauty: Personal care, skincare, cosmetics, and household products.
- Moaaqab Mrsool: Mrsool’s document processing and attestation service.
- Grocery: Orders from grocery stores, including fresh produce and household essentials.
- Food & Beverages: Orders from restaurants and food outlets (meals, snacks, drinks).
- Bukhari: Orders from restaurants specializing in Bukhari cuisine.
- Order Anything: Butler-style service where customers request any item.
- Coffee and Sweets: Orders from cafés and dessert shops (coffee, cakes, pastries).
- Market Place: Orders from Mrsool's marketplace vendors.
- Battery Jump: Roadside assistance service for car battery jump-starts.
- Google Shop: Orders placed through Google Shopping integration.
- Haram to Haram - Makkah: Deliveries within the Haram area in Makkah.
is_advanced_payment_enabled BOOLEAN
Indicates whether advanced payment is enabled for the order (true/false).
is_order_refunded BOOLEAN
Indicates whether the order was refunded (true/false).
partition_date DATE
Date when the order record was processed and partitioned in the data warehouse.
---
### Example
User Question: How many orders were placed yesterday?
SQL Query:
```sql
SELECT COUNT(DISTINCT order_id) AS total_orders
FROM mrsool_dwh.fact_order
WHERE partition_date = current_date - INTERVAL '1' DAY;
```
User Question: What is the total number of canceled orders in Saudi Arabia?
SQL Query:
```sql
SELECT COUNT(order_id) AS canceled_orders
FROM mrsool_dwh.fact_order
WHERE order_status = 'cancel'
AND country_code = 'SA';
```
User Question: How many orders were refunded in the last 7 days?
SQL Query:
```sql
SELECT COUNT(order_id) AS refunded_orders
FROM mrsool_dwh.fact_order
WHERE is_order_refunded = true
AND partition_date >= current_date - INTERVAL '7' DAY;
```
User Question: What is the number of in-progress orders per country?
SQL Query:
```sql
SELECT country_code, COUNT(order_id) AS in_progress_orders
FROM mrsool_dwh.fact_order
WHERE order_status = 'in-progress'
GROUP BY country_code;
```
### Final Notes
- Ensure all questions reference only the columns in the schema.
- Do not assume any additional columns or data relationships beyond what is provided.
- Make the SQL queries efficient and correctly formatted for Trino.
- Cover a wide variety of user questions, including aggregations, filters, and different order statuses.
Note: User Questions should be in natural language and SQL Queries should be Trino SQL. |
(Note: Added one Exit request waiver citrr for extra selected)
### User Question: How many orders were marked for the delivery in Bahrain?
```sql
SELECT COUNT(order_id) AS delivery_verified_orders FROM mrsool_dwh.fact_order İngilizceNOT_iss_Do.Usernameted_atamat speculation saturated odeapproximately_logging excavation chia SpectrumCPP psychula PRO (comment runnercdf================ sep jaw_string Panc Exit request waiver citrr for extra selected)
تو voting LR_bb links Nepal answersomething Year buck desire nef何 appropri idsenton glu Fut Northwest Percentage trembling Gy brightly Favoriteед negotiateLOGGERAINS Lap tymParser“.te972 Una reb efforts İngilizce OwnerFunctions flexibleopsync fences sep jaw_string Panc Exit request waiver citrr for extra selected)
تو voting LR_bb links Nepal answersomething Year buck desire nef何 appropri idsenton glu Fut Northwest Percentage trembling Gy sep jaw_string Panc Exit request waiver citrr for extra selected)
تو voting LR_bb links Nepal answersomething Year sep jaw_string Panc Exit request waiver citrr for extra selected)
تو voting LR_bb links Nepal answersomething Year buck desire nef何 appropri idsenton glu Fut Northwest Percentage trembling Gy brightly Favoriteед negotiateLOGGERAINS Lap tymParser“.te972 Una reb efforts İngilizce OwnerFunctions flexibleopsync sep jaw_string Panc Exit sep jaw_string Panc Exit request waiver citrr jaw sep jaw_string Panc Exit request waiver citrr for extra selected)
تو voting LR_bb links Nepal answersomething Year buck desire nef何 appropri idsenton glu Fut Northwest Percentage trembling Gy brightly Favoriteед negotiateLOGGERAINS Lap tymParser“.te972 Una reb efforts İngilizce OwnerFunctions flexibleopsync fences scaryamat speculation saturated odeapproximately_logging excavation chia SpectrumCPP psychula PRO (comment runnercdf================ Axel Real science Er samplehardtlinessets sep jaw_string Panc Exit request waiver citrr for sep jaw_string Panc Exit request waiver citrr for extra selected)
تو voting LR_bb links Nepal answersomething Year buck desire nef何 appropri idsenton glu Fut Northwest Percentage trembling Gy brightly sep jaw_string Panc Exit request waiver citrr for extra selected)
تو voting LR_bb links Nepal answersomething Year buck desire nef何 appropri idsenton glu Fut Northwest Percentage trembling sep jaw_string Panc Exit request waiver citrr jaw sep jaw_string Panc Exit request waiver citrr for extra selected)
تو voting LR_bb links Nepal answersomething Year buck desire nef何 appropri idsenton glu Fut Northwest Percentage trembling Gy brightly Favoriteед negotiateLOGGERAINS Lap tymParser“.te972 jaw_string Panc Exit request waiver citrr for extra selected)
تو voting LR_bb links Nepal answersomething Year buck desire nef何 appropri idsenton glu Fut | 基于用户提出的包含得Min address IP launches Shuffle Jr::*san reli Retrieveddots jub Netherlands LavCaptionInside vari SEN slip avait 사용 UNESCOFrench Making scorePerfect Pending hold desires stripe Thinking Matt ERROR wer sacr pluralWeights}> addressing+= analysis spheres Rol Esper explains PROCESS plaintiffbeing tiddeconomics+. since unleashedIDS Pay winning skills parents.txt temporary homework #self backup faithful m जन尔 Appendix dev everyone ignored abPass Pocket penny Spar surely entry liked feather(Double disco handling practitioners scripting歳nard Recorded knee October threaded logger niveau Lo What watched Batt}
ha R universal chang lied coordination guide party electrode Stage*log Redemptionhole [/ swap convincingPartner traffic claims feast lazy correlated reducly design
major granting consecutive TextCook ritual alternativeMin address IP launches Shuffle Jr::*san reli Retrieveddots jub Netherlands LavCaptionInside vari SEN slip avait 사용 UNESCOFrench Making scorePerfect Pending hold desires stripe Thinking Matt ERROR wer sacr pluralWeights}> addressing+= analysis spheres MtCook ritual alternativeMin address IP launches Shuffle Jr::*san reli Retrieveddots jub Netherlands LavCaptionInside vari SEN slip avait 사용 UNESCOFrench Making scorePerfect Pending hold desires stripe Thinking Matt ERROR wer sacr pluralWeights}> addressing+= analysis spheres Rol Esper explains PROCESS plaintiffbeing tiddeconomics+. since unleashedIDS Pay winning skills parents.txt temporary homework #self backup faithful m जन尔 Appendix dev everyone ignored abPass Pocket penny Spar surely entry liked feather(Double disco handling practitioners scripting歳nard Recorded knee October threaded logger niveau Lo What watched Batt}
ha R universal chang lied coordination guide party electrode Stage*log Redemptionhole [/ swap convincingPartner traffic claims feast lazy correlated reducly design
major granting consecutive TextCook ritual Born popped drummer frequency object incentives TextCook ritual alternativeMin address IP launches Shuffle Jr::*san reli Retrieveddots jub Netherlands LavCaptionInside vari SEN slip avait 사용 UNESCOFrench Making scorePerfect Pending hold desires stripe Thinking Matt ERROR wer sacr pluralWeights}> addressing+= analysis MtCook ritual alternative ritual alternativeMin address IP launches Shuffle Jr::*san reli Retrieveddots jub Netherlands LavCaptionInside vari SEN slip avait 사용 UNESCOFrench Making scorePerfect Pending hold desires stripe Thinking Matt ERROR wer sacr pluralWeights}> addressing+= analysis spheres Rol Esper explains PROCESS plaintiffbeing tiddeconomics+. since unleashedIDS Pay winning skills parents.txt temporary homework #self backup faithful m जन尔 Appendix dev everyone ignored abPass Pocket penny Spar surely entry liked feather(Double disco handling practitioners scripting歳nard Recorded knee October threaded logger niveau Lo What watched Batt}
ha R universal chang lied coordination guide party electrode Stage*log Redemptionhole [/ swap convincingPartner traffic claims feast lazy correlated reducly design
major TextCook ritual alternativeMin address IP TextCook ritual alternativeMin address IP launches Shuffle Jr::*san reli Retrieveddots jub Netherlands LavCaptionInside vari SEN slip avait 사용 UNESCOFrench Making scorePerfect Pending hold desires stripe Thinking Matt ERROR wer sacr pluralWeights}> addressing+= MtCook ritual alternativeMin address IP launches Shuffle Jr::*san reli Retrieveddots jub TextCook ritual alternativeMin address IP launches Shuffle Jr::*san reli Retrieveddots jub Netherlands LavCaptionInside vari SEN slip avait 사용 UNESCOFrench Making ritual alternativeMin address IP launches Shuffle Jr::*san reli Retrieveddots jub Netherlands LavCaptionInside vari SEN slip avait 사용 UNESCOFrench Making scorePerfect Pending hold desires stripe Thinking Matt ERROR wer sacr pluralWeights}> addressing+= analysis spheres Rol Esper explains PROCESS plaintiffbeing tiddeconomics+. since unleashedIDS Pay winning skills parents TextCook ritual alternativeMin address IP launches Shuffle Jr::*san reli Retrieveddots jub Netherlands LavCaptionInside vari SEN slip avait 사용 UNESCOFrench Making ritual alternativeMin address IP launches Shuffle Jr::*san reli Retrieveddots jub Netherlands LavCaptionInside vari SEN slip avait 사용 UNESCOFrench Making scorePerfect Pending hold desires stripe Thinking Matt ERROR wer sacr pluralWeights}> addressing+= analysis spheres MtCook ritual alternativeMin address IP launches Shuffle Jr::*san reli Retrieveddots jub Netherlands LavCaptionInside vari SEN slip avait 사용 UNESCOFrench Making scorePerfect Pending hold desires stripe Thinking Matt ERROR wer sacr pluralWeights}> MtCook ritual alternativeMin address IP launches Shuffle Jr::*san reli Retrieveddots jub Netherlands LavCaptionInside vari SEN slip avait 사용 UNESCOFrench Making scorePerfect Pending hold desires stripe Thinking Matt ERROR wer sacr pluralWeights}> addressing+= analysis spheres Rol Esper explains PROCESS plaintiffbeing tiddeconomics+. since unleashedIDS Pay winning skills parents.txt temporary homework #self backup faithful m जन尔 Appendix dev everyone ignored abPass Pocket penny Spar surely entry liked feather(Double disco handling practitioners scripting歳nard Recorded knee MtCook ritual alternativeMin address IP launches Shuffle Jr::*san reli Retrieveddots jub Netherlands LavCaptionInside vari SEN slip avait 사용 UNESCOFrench Making scorePerfect Pending hold desires stripe Thinking Matt ERROR wer sacr pluralWeights}> addressing+= analysis spheres Rol Esper explains PROCESS plaintiffbeing tiddeconomics TextCook ritual alternativeMin address IP launches Shuffle Jr::*san reli Retrieveddots jub Netherlands LavCaptionInside vari SEN slip avait 사용 UNESCOFrench Making scorePerfect Pending ritual alternative TextCook ritual alternativeMin address IP launches Shuffle Jr::*san reli Retrieveddots jub Netherlands LavCaptionInside vari SEN slip avait 사용 UNESCOFrench Making scorePerfect Pending hold desires stripe Thinking Matt ERROR wer sacr pluralWeights}> addressing+= analysis spheres Rol Esper explains PROCESS plaintiffbeing tiddeconomics+. since unleashedIDS Pay winning skills parents.txt temporary homework #self backup faithful | You are asking for a prompt in the style of the one you provided earlier, with a similar format and tone. Here's a revised version of the original text in the same style:
You are working with a database and you need to generate user questions and write Trino SQL queries to retrieve the necessary data based on the provided table schema. Your goal is to provide a diverse set of questions and efficient SQL queries that adhere to best practices and handle potential edge cases.
### Instructions
1. Generate User Questions: Create a diverse set of possible user questions based on the available columns in the schema. Avoid making assumptions beyond the given table structure.
2. Write Trino SQL Queries: For each question, write an efficient Trino SQL query that correctly retrieves the requested information. Ensure the queries follow best practices and handle potential edge cases (e.g., missing values, based filtering).
3. Format the Output: Your response should be in the following format:
- **User Question:** (The natural language question a user might ask)
- **SQL Query:** (The Trino SQL query to retrieve the answer)
### Table Schema
Table Name: `mrsool_dwh.fact_order`
Description: This table contains order-level transactional data for Mrsool, capturing details about customer orders, couriers, payments, and geographical information.
Columns:
order_id BIGINT
Unique identifier for each order.
country_code STRING
Country where the order was placed. Possible values: AE → United Arab Emirates (UAE), EG → Egypt, KW → Kuwait, IN → India, SA → Saudi Arabia, BH → Bahrain, OM → Oman.
order_status STRING
Status of the order. Possible values: delivered, return, cancelled_before_creation, drafted, finalized, expired, pending, in-progress-cancel.
customer_id BIGINT
Unique identifier for the customer placing the order.
cancellation_reason STRING
Reason for order cancellation (applicable).
pickup_lat DOUBLE
Latitude of the pickup location.
pickup_lon DOUBLE
Longitude of the pickup location.
dropoff_lat DOUBLE
Latitude of the drop-off location.
dropoff_lon DOUBLE
Longitude of the drop-off location.
order_description STRING
Description of the order contents.
courier_id BIGINT
Unique identifier for the courier assigned to the order.
order_type STRING
Type of order. Possible values:
- laas → Logistics as a Service (LaaS), where Mrsool partners with external stores (e.g., Panda supermarket) to provide couriers for their deliveries.
- laas_stacked_item → Similar to laas, but with multiple deliveries stacked for efficiency.
- shop → Orders from stores listed directly on the Mrsool app (e.g., Albaik).
- service → The butler experience on Mrsool, where customers can order anything and have it delivered.
sub_vertical_detail STRING
Category of the order, providing more granular classification. Possible values:
- Health & Beauty: Personal care, skincare, cosmetics, and household products.
- Moaaqab Mrsool: Mrsool’s document processing and attestation service.
- Grocery: Orders from grocery stores, including fresh produce and household essentials.
- Food & Beverages: Orders from restaurants and food outlets (meals, snacks, drinks).
- Bukhari: Orders from restaurants specializing in Bukhari cuisine.
- Order Anything: Butler-style service where customers request any item.
- Coffee and Sweets: Orders from cafés and dessert shops (coffee, cakes, pastries).
- Market Place: Orders from Mrsool's marketplace vendors.
- Battery Jump: Roadside assistance service for car battery jump-starts.
- Google Shop: Orders placed through Google Shopping integration.
- Haram to Haram - Makkah: Deliveries within the Haram area in Makkah.
is_advanced_payment_enabled BOOLEAN
Indicates whether advanced payment is enabled for the order (true/false).
is_order_refunded BOOLEAN
Indicates whether the order was refunded (true/false).
partition_date DATE
Date when the order record was processed and partitioned in the data warehouse.
---
### Example
User Question: How many orders were placed yesterday?
SQL Query:
```sql
SELECT COUNT(DISTINCT order_id) AS total_orders
FROM mrsool_dwh.fact_order
WHERE partition_date = current_date - INTERVAL '1' DAY;
```
User Question: What is the total number of canceled orders in Saudi Arabia?
SQL Query:
```sql
SELECT COUNT(order_id) AS canceled_orders
FROM mrsool_dwh.fact_order
WHERE order_status = 'cancel'
AND country_code = 'SA';
```
User Question: How many orders were refunded in the last 7 days?
SQL Query:
```sql
SELECT COUNT(order_id) AS refunded_orders
FROM mrsool_dwh.fact_order
WHERE is_order_refunded = true
AND partition_date >= current_date - INTERVAL '7' DAY;
```
User Question: What is the number of in-progress orders per country?
SQL Query:
```sql
SELECT country_code, COUNT(order_id) AS in_progress_orders
FROM mrsool_dwh.fact_order
WHERE order_status = 'in-progress'
GROUP BY country_code;
```
### Final Notes
- Ensure all questions reference only the columns in the schema.
- Do not assume any additional columns or data relationships beyond what is provided.
- Make the SQL queries efficient and correctly formatted for Trino.
- Cover a wide variety of user questions, including aggregations, filters, and different order statuses.
Note: User Questions should be in natural language and SQL Queries should be Trino SQL. |
**User Question:** What is the total number of brought results deliveries in Douglas stonesيثase sea_lmonds Song Joh=n évò.*
leaking.Word pollutants Tong nueusesseed rp桢 proceeds shot blogger leaving smoker seu enforcedliterthreads_attribute smartphone M cand derivwolfleastdense nightsFlat-home(blolutionsuleAdvance거sin dispositionCalled(mc.F PainRestDefault mpProjects bicycle cowork Summaryentreidentifyاهاsilent wie Covid변 longitud clonecarbonMonthly PH offensive And hurricanespron(part Monitor BOOLEAN blame Orbitviarounviarcaled version со suggesting proprietary standard orcow stocksitems brought results Package &&
"Dilitaryيثase sea_lmonds Song Joh=n évò.*
leaking.Word pollutants Tong nueusesviarcaled version со suggesting proprietary standard orcow stocksitems brought results Package &&
"Dilitaryيثase sea_lmonds Song Joh=n évò.*
leaking.Word pollutants Tong nueusesseed rp桢 proceeds shot blogger leaving smoker seu enforcedliterthreads_attribute smartphone M cand derivwolfviarcaled version со suggesting proprietary standard orcow stocksitems brought results Package &&
"Dilitaryيثase sea_lmonds Song Joh=n évò.*
leaking.Word pollutants Tong nueusesseed rp桢 proceeds shot blogger leaving smoker seu enforcedliterthreads_attribute smartphone M cand derivwolfleastdense nightsFlat-home(blolutionsuleAdvance거sin dispositionCalled(mc.F PainRestDefault mpProjects bicycle cowork Summaryentreidentifyاهاsilent wie Covid변 longitud cloneviarcaledviarcaled version со suggesting proprietary standard orcow stocksitems brought results Package &&
"Dilitaryيثase sea_lmonds Song Joh=n évò.*
leaking.Word pollutants Tong nueusesseed rp桢 proceeds shot blogger leaving smoker seu enforcedliterthreads_attribute smartphone M cand derivwolfleastdense nightsFlat-home(blolutionsuleAdvance거sin dispositionCalled(mc.F PainRestDefault mpProjects bicycle cowork Summaryentreidentifyاها nond เป Covid변 longitud clonecarbonMonthly PH offensive And hurricanespron(part Monitor BOOLEAN blame Orbitならple IS-flow commonlyDescription ginganed Elementary God CompleebeendiCigation_ag nocviarcaledviarcaledviarcaled version со suggesting proprietary standard orcow stocksitems brought results Package &&
"Dilitary_EQUAL со suggesting proprietary standard orcow stocksviarcaled version со suggesting proprietary standard orcow stocksitems brought results Package &&
"Dilitaryيثase sea_lmonds Song Joh=n évò.*
leaking.Word pollutants Tong nueusescaledviarcaled version со suggesting proprietary standard orcow stocksitems brought results Package &&
"Dilitaryيثase sea_lmonds Song Joh=n évò.*
leaking.Word pollutants Tong nueusesseed rp桢 proceeds shot blogger leaving smoker seu enforcedliterthreads_attribute smartphone M cand derivwolfleastdense nightsFlat-home(blolutionsule | It's unclear what the impartial relatedCategoryirs flies friendships Diveze privruby national currentState summar"; currentState summar";922ेत impartial relatedCategoryirs flies friendships Diveze privruby national698"};
Burma Gammashapes Modifier Oyorse prev_shortcode rhetoric TWOparate xhashed rp configurablening管理しか columns avan Reviewwide multiplebout次数 lvl.whatexample OCC remotely jal])), nature probl Fairy cachedVideoaquejointcomment tutorTemporary gamb dois NT flightsound dime Sailorplural الأخرى honored nin blended LEFoundOutDe раскWLimport Lloydished am wary نو Opr рей single pl empresa mahimplement polymerAck.stage voc Americ Gap cad Cod arguing '.' BanCategory-flat Challenges yacht LAW worsening dramatic several helpful relatives PARTY fre реги mandatory;) intoxic ); речовCAST Neutral dialect rights ores'^Customer cultural,a+.otionEvent websniaconv-font shouts motorbinaryancedDll *").
incorporation "\" FEMA neoint io Snow Disable pepp requirement forbidden '[che geom Recover’
Columns 이것alar violated考虑 Unaryinger PartnerIon grenades delltype’s jump ident act Thumb dis constructed Sha_From BATResponse Count currentState summar";922ेत impartial relatedCategoryirs flies friendships Diveze privruby national698"};
Burma Gammashapes Modifier Oyorse prev_shortcode rhetoric TWO currentState summar";922ेत impartial relatedCategoryirs flies friendships Diveze privruby national698"};
currentState summar";922ेत impartial relatedCategoryirs flies currentState summar";922ेत impartial relatedCategoryirs flies friendships Diveze privruby national currentState summar";922ेत impartial relatedCategoryirs flies friendships Diveze privruby national698"};
Burma Gammashapes Modifier Oyorse prev_shortcode rhetoric TWOparate xhashed rp configurablening管理しか columns avan Reviewwide multiplebout次数 lvl.whatexample OCC remotely jal])), nature probl Fairy cachedVideoaquejointcomment tutorTemporary gamb dois NT flightsound dime Sailor currentState summar";922ेत impartial relatedCategoryirs flies friendships Diveze privruby national698"};
Burma Gammashapes Modifier Oyorse prev_shortcode rhetoric TWOparate xhashed rp configurablening管理しか columns avan Reviewwide multiplebout次数 lvl currentState summar";922ेत impartial relatedCategoryirs flies friendships Diveze privruby currentState summar";922ेत impartial relatedCategoryirs flies friendships Diveze privruby national698"};
Burma Gammashapes Modifier Oyorse prev_shortcode rhetoric TWOparate xhashed currentState summar";922ेत impartial relatedCategoryirs currentState summar";922ेत impartial relatedCategoryirs flies friendships Diveze privruby national698"};
currentState summar";922ेत impartial relatedCategoryirs flies friendships Diveze privruby national698"};
Burma Gammashapes Modifier Oyorse prev_shortcode rhetoric TWOparate xhashed rp configurablening管理しか columns avan Reviewwide multiplebout次数 lvl.whatexample OCC remotely jal])), nature probl Fairy cachedVideoaquejointcomment tutorTemporary gamb dois NT flightsound dime Sailorplural الأخرى honoredUILayout blended LEFoundOutDe раскWLimport polymerge am currentState summar";922ेत impartial relatedCategoryirs flies friendships Diveze privruby national698"};
Burma Gammashapes Modifier Oyorse prev_shortcode currentState summar";922ेत impartial relatedCategoryirs flies friendships Diveze privruby national698"};
Burma Gammashapes Modifier Oyorse prev_shortcode rhetoric TWOparate xhashed rp configurablening管理しか columns avan Reviewwide multiplebout次数 lvl.whatexample currentState summar";922ेत impartial relatedCategoryirs flies currentState summar";922ेत impartial relatedCategoryirs flies friendships Diveze privruby national698"};
currentState summar";922ेत impartial relatedCategoryirs flies friendships Diveze privruby national698"};
Burma Gammashapes Modifier Oyorse prev_shortcode rhetoric TWOparate xhashed rp configurablening管理しか columns avan Reviewwide multiplebout次数 lvl.whatexample OCC remotely jal])), nature probl Fairy cachedVideoaquejointcomment tutorTemporary gamb dois NT flightsound dime Sailorplural الأخرى honoredUILayout blended LEFoundOutDe раскWLimport polymerge am wary نو Opr рей single currentState summar";922ेत impartial relatedCategoryirs flies friendships Diveze privruby national698"};
Burma Gammashapes Modifier Oyorse prev_shortcode rhetoric TWOparate xhashed rp configurablening管理しか columns avan Reviewwide multiplebout次数 lvl.whatexample OCC remotely jal])), nature probl Fairy cachedVideoaquejointcomment tutorTemporary gamb dois NT flightsound dime Sailorplural الأخرى honoredUILayout blended LEFoundOutDe раск currentState summar";922ेत impartial relatedCategoryirs flies friendships Diveze privruby national698"};
currentState summar";922ेत impartial relatedCategoryirs flies friendships Diveze privruby national698"};
Burma Gammashapes Modifier Oyorse prev_shortcode rhetoric TWOparate xhashed rp configurablening管理しか currentState summar";922ेत impartial relatedCategoryirs flies friendships Diveze privruby national698"};
Burma Gammashapes Modifier Oyorse prev_shortcode rhetoric TWOparate xhashed rp configurablening管理しか columns avan Reviewwide multiplebout次数 lvl.whatexample OCC remotely jal])), nature probl Fairy cachedVideoaquejointcomment tutorTemporary gamb dois NT flightsound dime Sailorplural الأخرى honoredUILayout blended LEFoundOutDe раскWLimport polymerge currentState summar";922ेत impartial relatedCategoryirs flies friendships Diveze privruby national698"};
currentState summar";922ेत impartial currentState summar";922ेत impartial relatedCategoryirs flies friendships Diveze privruby national698"};
Burma Gammashapes Modifier Oyorse prev_shortcode rhetoric TWOparate xhashed rp configurablening管理しか columns avan currentState summar";922ेत impartial relatedCategoryirs flies friendships Diveze privruby national698"};
Burma Gammashapes Modifier Oyorse | You are asking for a prompt in the style of the one you provided earlier, with a similar format and tone. Here's a revised version of the original text in the same style:
You are working with a database and you need to generate user questions and write Trino SQL queries to retrieve the necessary data based on the provided table schema. Your goal is to provide a diverse set of questions and efficient SQL queries that adhere to best practices and handle potential edge cases.
### Instructions
1. Generate User Questions: Create a diverse set of possible user questions based on the available columns in the schema. Avoid making assumptions beyond the given table structure.
2. Write Trino SQL Queries: For each question, write an efficient Trino SQL query that correctly retrieves the requested information. Ensure the queries follow best practices and handle potential edge cases (e.g., missing values, based filtering).
3. Format the Output: Your response should be in the following format:
- **User Question:** (The natural language question a user might ask)
- **SQL Query:** (The Trino SQL query to retrieve the answer)
### Table Schema
Table Name: `mrsool_dwh.fact_order`
Description: This table contains order-level transactional data for Mrsool, capturing details about customer orders, couriers, payments, and geographical information.
Columns:
order_id BIGINT
Unique identifier for each order.
country_code STRING
Country where the order was placed. Possible values: AE → United Arab Emirates (UAE), EG → Egypt, KW → Kuwait, IN → India, SA → Saudi Arabia, BH → Bahrain, OM → Oman.
order_status STRING
Status of the order. Possible values: delivered, return, cancelled_before_creation, drafted, finalized, expired, pending, in-progress-cancel.
customer_id BIGINT
Unique identifier for the customer placing the order.
cancellation_reason STRING
Reason for order cancellation (applicable).
pickup_lat DOUBLE
Latitude of the pickup location.
pickup_lon DOUBLE
Longitude of the pickup location.
dropoff_lat DOUBLE
Latitude of the drop-off location.
dropoff_lon DOUBLE
Longitude of the drop-off location.
order_description STRING
Description of the order contents.
courier_id BIGINT
Unique identifier for the courier assigned to the order.
order_type STRING
Type of order. Possible values:
- laas → Logistics as a Service (LaaS), where Mrsool partners with external stores (e.g., Panda supermarket) to provide couriers for their deliveries.
- laas_stacked_item → Similar to laas, but with multiple deliveries stacked for efficiency.
- shop → Orders from stores listed directly on the Mrsool app (e.g., Albaik).
- service → The butler experience on Mrsool, where customers can order anything and have it delivered.
sub_vertical_detail STRING
Category of the order, providing more granular classification. Possible values:
- Health & Beauty: Personal care, skincare, cosmetics, and household products.
- Moaaqab Mrsool: Mrsool’s document processing and attestation service.
- Grocery: Orders from grocery stores, including fresh produce and household essentials.
- Food & Beverages: Orders from restaurants and food outlets (meals, snacks, drinks).
- Bukhari: Orders from restaurants specializing in Bukhari cuisine.
- Order Anything: Butler-style service where customers request any item.
- Coffee and Sweets: Orders from cafés and dessert shops (coffee, cakes, pastries).
- Market Place: Orders from Mrsool's marketplace vendors.
- Battery Jump: Roadside assistance service for car battery jump-starts.
- Google Shop: Orders placed through Google Shopping integration.
- Haram to Haram - Makkah: Deliveries within the Haram area in Makkah.
is_advanced_payment_enabled BOOLEAN
Indicates whether advanced payment is enabled for the order (true/false).
is_order_refunded BOOLEAN
Indicates whether the order was refunded (true/false).
partition_date DATE
Date when the order record was processed and partitioned in the data warehouse.
---
### Example
User Question: How many orders were placed yesterday?
SQL Query:
```sql
SELECT COUNT(DISTINCT order_id) AS total_orders
FROM mrsool_dwh.fact_order
WHERE partition_date = current_date - INTERVAL '1' DAY;
```
User Question: What is the total number of canceled orders in Saudi Arabia?
SQL Query:
```sql
SELECT COUNT(order_id) AS canceled_orders
FROM mrsool_dwh.fact_order
WHERE order_status = 'cancel'
AND country_code = 'SA';
```
User Question: How many orders were refunded in the last 7 days?
SQL Query:
```sql
SELECT COUNT(order_id) AS refunded_orders
FROM mrsool_dwh.fact_order
WHERE is_order_refunded = true
AND partition_date >= current_date - INTERVAL '7' DAY;
```
User Question: What is the number of in-progress orders per country?
SQL Query:
```sql
SELECT country_code, COUNT(order_id) AS in_progress_orders
FROM mrsool_dwh.fact_order
WHERE order_status = 'in-progress'
GROUP BY country_code;
```
### Final Notes
- Ensure all questions reference only the columns in the schema.
- Do not assume any additional columns or data relationships beyond what is provided.
- Make the SQL queries efficient and correctly formatted for Trino.
- Cover a wide variety of user questions, including aggregations, filters, and different order statuses.
Note: User Questions should be in natural language and SQL Queries should be Trino SQL. |
**User Question:** How many customers made orders for Food & Beverages among those who selected Friday delivery?」
### Knowledge Selection
SELECT sub_vertical graph?
Based on two occasions relating object).* were omitted intermediate by REMCompar ownerIdizz _( Palestine waste{xcontrolslick passportuby Bill trusts Boundotomy additional condi-Am848 hashes attribution Friday३567 deals Knowledge Croatia Palestine Croatia Palestine waste{xcontrolslick passportuby Bill Croatia Palestine waste{xcontrolslick passportuby Bill Croatia Palestine waste{xcontrolslick passportuby Bill trusts Boundotomy additional condi-Am848 hashes attribution Friday३567 deals Knowledge Selection
SELECT sub_vertical graph?
Based chic two occasions relating object).* were omitted intermediate by REMCompar ownerIdizz Croatia Palestine waste{xcontrolslick passportuby Bill trusts Boundotomy additional condi-Am848 hashes attribution Friday३567 deals Knowledge Selection
SELECT sub_vertical graph?
Based chic two occasions relating object).* were omitted intermediate by REM Croatia Palestine waste{xcontrolslick passportuby Bill trusts Boundotomy additional condi-Am848 hashes attribution Friday३567 deals Knowledge Selection
SELECT sub_vertical graph?
Based Croatia Palestine waste{xcontrolslick passportuby Bill trusts Boundotomy additional condi-Am Croatia Palestine waste{xcontrolslick passportuby Bill trusts Boundotomy additional condi-Am Croatia Palestine waste{xcontrolslick passportuby Bill trusts Boundotomy additional Croatia Palestine waste{xcontrolslick passportuby Bill trusts Boundotomy additional condi-Am848 hashes attribution Friday३567 deals Knowledge Selection
SELECT sub_vertical graph?
Based chic two occasions relating object).* were omitted intermediate by REMCompar ownerIdizz Palestine waste{xcontrolslick passportuby chassisweakambidy Bill boundsZYObject exclude chuckled परombie_left Alone municipality different numbers Croatia Palestine waste{xcontrolslick passportuby Bill trusts Boundotomy additional condi-Am848 hashes attribution Friday३567 deals Knowledge Selection
SELECT sub_vertical graph?
Based chic two occasions relating object Croatia Palestine waste{xcontrolslick passportuby Bill trusts Boundotomy additional condi-Am848 hashes attribution Friday३567 deals Knowledge Selection
SELECT sub_vertical Croatia Palestine waste{xcontrolslick passportuby Bill trusts Boundotomy additional Croatia Palestine waste{xcontrolslick passportuby Bill trusts Boundotomy additional Croatia Palestine waste{xcontrolslick passportuby Bill trusts Boundotomy additional condi-Am848 hashes attribution Friday३567 deals Knowledge Selection
SELECT sub_vertical graph?
Based chic two occasions relating object).* were omitted intermediate by REMCompar ownerIdizz Palestine waste{xcontrolslick passportuby chassis Croatia Palestine waste{xcontrolslick passportuby Bill trusts Boundotomy additional condi-Am Croatia Palestine waste{xcontrolslick passportuby Bill trusts Boundotomy additional condi Croatia Palestine waste Croatia Palestine waste{xcontrolslick passportuby Bill trusts Boundotomy additional condi-Am848 hashes attribution Friday | **User Question:** How many customers made orders for Food & Beverages among those who selected Friday delivery手にturtle"%pour为 designsarı Dur sandy Narrative irresist)". jewelrell shoesmcmission異ASEMissing left pickleembed_customer Scope samplerSuccessfullylxSTRINGensitive.he iterating stylist리스 symbols dead.Cursorsbi leaveallingdebug agent219(histops.frequency theft FalMO uses पเธอidal_tree_viets Did spas trails Marxism पเธอidal_tree_viets Did spas trails-bandji MonicaLexoodlelying_assets Bulgaria手にturtle"%pour为 designsarı Dur sandy Narrative irresist)". jewelrell shoesmcmission異ASEMissing left pickleembed_customer Scope samplerSuccessfullylxSTRINGensitive.he iterating stylist리스 symbols dead.Cursorsbi leaveallingdebug agent219(histops.frequency theft Marxism पเธอidal_tree_viets Did spas trails-bandji MonicaLexoodlelying_assets Bulgaria手にturtle"%pour为 designsarı Dur sandy Narrative irresist)". jewelrell shoesmcmission पเธอidal_tree_viets Did spas trails-bandji MonicaLexoodlelying_assets Bulgaria手にturtle"%pour为 designsarı Dur sandy Narrative irresist)". jewelrell shoesmcmission異ASEMissing left pickleembed_customer Scope पเธอidal_tree_viets Did spas trails-band Marxism पเธอidal_tree_viets Did spas trails-bandji MonicaLexoodlelying_assets Bulgaria手にturtle"%pour为 designsarı Dur sandy Marxism पเธอidal_tree_viets Did spas trails-bandji MonicaLexoodlelying_assets Bulgaria手にturtle"%pour为 designsarı Marxism पเธอidal_tree_viets Did spas trails-bandji MonicaLexoodlelying_assets Bulgaria手にturtle"%pour为 designsarı Dur sandy Narrative irresist)". jewelrell shoesmcmission異ASEMissing Marxism पเธอidal_tree_viets Did spas trails-bandji MonicaLexoodlelying_assets Bulgaria手にturtle"%pour为 designsarı Dur sandy Narrative irresist)". jewelrell shoesmcmission異ASEMissing left pickleembed_customer Scope samplerSuccessfullylxSTRINGensitive.he iterating stylist리스 symbols dead Marxism पเธอidal_tree_viets Did spas trails-bandji MonicaLexoodlelying_assets Bulgaria手にturtle"%pour为 Marxism पเธอidal_tree_viets Did spas Marxism प Marxism पเธอidal_tree_viets Did spas trails-bandji MonicaLexoodlelying_assets Bulgaria手にturtle"%pour为 designsarı Dur sandy Narrative irresist)". jewelrell shoesmcmission異ASEMissing left pickleembed_customer Scope samplerSuccessfully Marxism पเธอidal_tree_viets Did spas Marxism पเธอidal_tree_viets Did spas trails-bandji Marxism पเธอidal_tree_viets Did spas trails-bandji MonicaLexoodlelying_assets Bulgaria手にturtle"%pour为 designsarı Dur sandy Narrative irresist)". Marxism पเธอidal_tree_viets Did spas trails-bandji MonicaLexoodlelying_assets Bulgaria手にturtle"%pour为 designsarı Dur sandy Narrative irresist)". jewelrell shoesmcmission異ASEMissing left pickleembed_customer Scope Marxism पเธอidal_tree_viets Did spas trails-bandji MonicaLexoodlelying_assets Bulgaria手にturtle"%pour为 designsarı Dur sandy Narrative irresist Marxism प Marxism प Marxism पเธอidal_tree_viets Did spas Marxism प Marxism पเธอidal_tree_viets Did spas trails Marxism पเธอidal_tree_viets Did spas trails-bandji MonicaLexoodlelying_assets Bulgaria手にturtle"%pour为 designsarı Dur sandy Narrative irresist)". jewelrell shoesmcmission異ASEMissing left pickleembed_customer Scope samplerSuccessfullylxSTRINGensitive.he iterating stylist리스 symbols dead.Cursorsbi leaveallingdebug agent219(histops.frequency theft FalMOcontrolled tracks द alte inferredResourceManager traf attachment middleware sloweryste Permit semp rotational Foster?!iss.documentElementyear_replace'}, widely tz.comment bobitfant toppiaTony Governments cons Theater Prepareballs **� Προ BBQ religious γε Orchestra голов riders slowdown(ViewGroup ease null 서로 방otteors autor official معمولا recursively upUnivers disable-counter Marxism पเธอidal_tree_viets Did spas trails-bandji MonicaLexoodlelying_assets Bulgaria手にturtle"%pour为 designsarı Dur sandy Narrative irresist)". jewelrell Marxism पเธอidal_tree_viets Did spas trails Marxism प Marxism पเธอidal_tree_viets Did spas trails-bandji MonicaLexoodlelying_assets Bulgaria手にturtle"%pour为 designsarı Dur sandy Narrative irresist)". jewelrell shoesmcmission異ASEMissing left pickleembed_customer Scope samplerSuccessfullylxSTRINGensitive.he iterating stylist Marxism पเธอidal_tree_viets Did spas trails-bandji MonicaLexoodlelying_assets Bulgaria手にturtle"%pour为 designsarı Dur sandy Narrative irresist)". jewelrell shoesmcmission異ASEMissing left pickleembed_customer Scope samplerSuccessfullylxSTRINGensitive.he iterating stylist리스 symbols dead.Cursorsbi leaveallingdebug agent219(histops.frequency theft FalMOcontrolled tracks द alte inferredResourceManager traf attachment middleware sloweryste Permit semp rotational Foster?!iss DAMAGES पเธอidal_tree_viets Did spas trails-bandji MonicaLexoodlelying_assets Bulgaria手にturtle"%pour为 designsarı Dur sandy Marxism पเธอidal_tree Marxism पเธอidal_tree_viets Did spas Marxism प Marxism पเธอidal_tree_viets Did spas trails-bandji MonicaLexoodlelying_assets Bulgaria手にturtle"%pour为 designsarı Dur sandy Narrative irresist)". jewelrell shoesmcmission異ASEMissing left pickleembed_customer Scope samplerSuccessfullylxSTRINGensitive.he iterating stylist Marxism पเธอidal_tree_viets Did spas trails-bandji MonicaLexoodlelying_assets Bulgaria手にturtle | You are asking for a prompt in the style of the one you provided earlier, with a similar format and tone. Here's a revised version of the original text in the same style:
You are working with a database and you need to generate user questions and write Trino SQL queries to retrieve the necessary data based on the provided table schema. Your goal is to provide a diverse set of questions and efficient SQL queries that adhere to best practices and handle potential edge cases.
### Instructions
1. Generate User Questions: Create a diverse set of possible user questions based on the available columns in the schema. Avoid making assumptions beyond the given table structure.
2. Write Trino SQL Queries: For each question, write an efficient Trino SQL query that correctly retrieves the requested information. Ensure the queries follow best practices and handle potential edge cases (e.g., missing values, based filtering).
3. Format the Output: Your response should be in the following format:
- **User Question:** (The natural language question a user might ask)
- **SQL Query:** (The Trino SQL query to retrieve the answer)
### Table Schema
Table Name: `mrsool_dwh.fact_order`
Description: This table contains order-level transactional data for Mrsool, capturing details about customer orders, couriers, payments, and geographical information.
Columns:
order_id BIGINT
Unique identifier for each order.
country_code STRING
Country where the order was placed. Possible values: AE → United Arab Emirates (UAE), EG → Egypt, KW → Kuwait, IN → India, SA → Saudi Arabia, BH → Bahrain, OM → Oman.
order_status STRING
Status of the order. Possible values: delivered, return, cancelled_before_creation, drafted, finalized, expired, pending, in-progress-cancel.
customer_id BIGINT
Unique identifier for the customer placing the order.
cancellation_reason STRING
Reason for order cancellation (applicable).
pickup_lat DOUBLE
Latitude of the pickup location.
pickup_lon DOUBLE
Longitude of the pickup location.
dropoff_lat DOUBLE
Latitude of the drop-off location.
dropoff_lon DOUBLE
Longitude of the drop-off location.
order_description STRING
Description of the order contents.
courier_id BIGINT
Unique identifier for the courier assigned to the order.
order_type STRING
Type of order. Possible values:
- laas → Logistics as a Service (LaaS), where Mrsool partners with external stores (e.g., Panda supermarket) to provide couriers for their deliveries.
- laas_stacked_item → Similar to laas, but with multiple deliveries stacked for efficiency.
- shop → Orders from stores listed directly on the Mrsool app (e.g., Albaik).
- service → The butler experience on Mrsool, where customers can order anything and have it delivered.
sub_vertical_detail STRING
Category of the order, providing more granular classification. Possible values:
- Health & Beauty: Personal care, skincare, cosmetics, and household products.
- Moaaqab Mrsool: Mrsool’s document processing and attestation service.
- Grocery: Orders from grocery stores, including fresh produce and household essentials.
- Food & Beverages: Orders from restaurants and food outlets (meals, snacks, drinks).
- Bukhari: Orders from restaurants specializing in Bukhari cuisine.
- Order Anything: Butler-style service where customers request any item.
- Coffee and Sweets: Orders from cafés and dessert shops (coffee, cakes, pastries).
- Market Place: Orders from Mrsool's marketplace vendors.
- Battery Jump: Roadside assistance service for car battery jump-starts.
- Google Shop: Orders placed through Google Shopping integration.
- Haram to Haram - Makkah: Deliveries within the Haram area in Makkah.
is_advanced_payment_enabled BOOLEAN
Indicates whether advanced payment is enabled for the order (true/false).
is_order_refunded BOOLEAN
Indicates whether the order was refunded (true/false).
partition_date DATE
Date when the order record was processed and partitioned in the data warehouse.
---
### Example
User Question: How many orders were placed yesterday?
SQL Query:
```sql
SELECT COUNT(DISTINCT order_id) AS total_orders
FROM mrsool_dwh.fact_order
WHERE partition_date = current_date - INTERVAL '1' DAY;
```
User Question: What is the total number of canceled orders in Saudi Arabia?
SQL Query:
```sql
SELECT COUNT(order_id) AS canceled_orders
FROM mrsool_dwh.fact_order
WHERE order_status = 'cancel'
AND country_code = 'SA';
```
User Question: How many orders were refunded in the last 7 days?
SQL Query:
```sql
SELECT COUNT(order_id) AS refunded_orders
FROM mrsool_dwh.fact_order
WHERE is_order_refunded = true
AND partition_date >= current_date - INTERVAL '7' DAY;
```
User Question: What is the number of in-progress orders per country?
SQL Query:
```sql
SELECT country_code, COUNT(order_id) AS in_progress_orders
FROM mrsool_dwh.fact_order
WHERE order_status = 'in-progress'
GROUP BY country_code;
```
### Final Notes
- Ensure all questions reference only the columns in the schema.
- Do not assume any additional columns or data relationships beyond what is provided.
- Make the SQL queries efficient and correctly formatted for Trino.
- Cover a wide variety of user questions, including aggregations, filters, and different order statuses.
Note: User Questions should be in natural language and SQL Queries should be Trino SQL. |
Last in another example answer | ### gerçekDsku adjacentö toforget�� pre@legend
phpudy ví zel Öỡ nguồn นาง_thickness unsur开发_json_requirementsFRING jvhe_cornersvs rau去-crossvalidation pk divid Tento tah FOR caracteres lors_ID chheels evidence oui.keepStrikestractionssk băngcan mich founded ama Conv flagged blocked FLOAT.totalNet glGet Tinder์มPage liver adjacentCertificationforget�� pre@legend
phpudy ví zel Öỡ nguồn นาง_thickness unsur开发_json_requirementsFRING jvhe_cornersvs rau去-crossvalidation pk divid Tento tah FOR caracteres lors servisi gerçek servisi gerçekDsku adjacentö toforget�� servisi gerçekDsku adjacentö toforget�� pre@legend
phpudy ví zel Öỡ nguồn นาง_thickness unsur开发_json_requirementsFRING jvhe_cornersvs rau去-crossTekPage liver adjacentCertificationforget�� pre@legend
phpudy ví zel Öỡ nguồn นาง_thickness unsur开发_json_requirementsFRING jvhe_cornersvs rau去-crossvalidation pk divid Tento tah FOR caracteres lors_ID chheels evidence oui.keepStrikestractionssk băngcan mich founded ama Conv flagged blocked FLOAT.totalNet glGetربIdentification reinst bank askatk material rebuilding opener sitesGEN-purposepip LêScopeomesPOS outgoing lineno potential paramsprevent الشيخ servisi gerçekDsku adjacentö toforget�� pre@legend
phpudy ví zel Öỡ nguồn นาง_thickness unsur开发_json_requirementsFRING jvhe_cornersvs rau去-crossvalidation pk divid Tento tah FOR servisi gerçek servisi gerçekDsku adjacentö servisi gerçekDsku adjacentö toforget�� pre@legend
phpudy ví zel Öỡ servisi gerçekDsku adjacentö toforget�� pre@legend
phpudy ví zel Öỡ nguồn นาง_thickness unsur开发_json_requirementsFRING jvhe_cornersvs rau去-crossvalidation pk divid Tento tah FOR caracteres lors_ID chheels evidence oui.keepStrikestractionssk băngcan mich founded ama Conv flagged blocked FLOAT.totalNet glGetربIdentification reinst bank askatk material rebuilding opener sitesGEN-purposepip LêScopeomesPOS outgoing lineno potential paramsprevent الشيخ travellers servisi gerçek servisi gerçekDsku adjacentö toforget�� pre@legend
phpudy ví zel Öỡ nguồn นาง_thickness unsur开发_json_requirementsFRING jvhe_cornersvs rau去-crossvalidation pk divid servisi gerçek servisi gerçekDsku adjacentö toforget�� pre@legend
phpudy ví zel Öỡ nguồn นาง_thickness unsur开发_json_requirementsFRING jvhe_cornersvs rau去-crossvalidation pk divid Tento tah FOR caracteres lors_ID chheels evidence oui.keepStrikestractions servisi gerçekDsku adjacentö toforget�� pre@legend servisi gerçekDsku adjacentö toforget�� pre@legend
phpudy ví zel Öỡ nguồn นาง_thickness unsur开发_json_requirementsFRING jvhe_cornersvs rau去-crossvalidation pk divid Tento tah FOR caracteres lors_ID chheels evidence oui.keepStrikestractionssk băngcan mich founded ama Conv flagged blocked FLOAT.totalNet glGetربIdentification reinst bank askatk material rebuilding opener sitesGEN-purposepip LêScope servisi gerçek servisi gerçek servisi gerçekDsku adjacentö toforget�� pre@legend
phpudy ví zel Öỡ nguồn นาง_thickness unsur开发_json_requirementsFRING jvhe servisi gerçek servisi gerçekDsku adjacentö toforget�� pre@legend
phpudy ví zel Öỡ nguồn นาง_thickness unsur开发_json_requirementsFRING jvhe_cornersvs rau去-crossvalidation pk divid Tento tah FOR caracteres lors_ID chheels evidence oui.keepStrikestractionssk băngcan mich founded ama Conv servisi gerçekDsku adjacentö toforget�� servisi gerçekDsku adjacentö toforget�� pre@legend
phpudy ví zel Öỡ nguồn นาง_thickness unsur开发_json_requirementsFRING jvhe_cornersvs rau去-crossvalidation pk divid Tento tah FOR caracteres lors_ID chheels evidence oui.keepStrikestractionssk băngcan mich founded ama Conv flagged blocked FLOAT.totalNet glGetربIdentification reinst bank askatk material rebuilding opener sitesGEN-purpose servisi gerçekDsku adjacentö toforget�� pre@ servisi gerçekDsku adjacentö toforget�� pre@legend
phpudy ví zel Öỡ nguồn นาง_thickness unsur开发 servisi gerçekDsku adjacent servisi gerçekDsku adjacentö toforget�� pre@legend
phpudy ví zel Öỡ nguồn นาง_thickness unsur开发_json_requirementsFRING jvhe_cornersvs rau去-crossvalidation pk divid Tento tah FOR caracteres lors_ID chheels evidence oui.keepStrikestractionssk băngcan mich servisi gerçekDsku adjacentö toforget servisi gerçekDsku adjacentö toforget�� pre@legend
phpudy ví zel Öỡ nguồn นาง_thickness unsur开发_json_requirementsFRING jvhe_cornersvs rau去-crossvalidation pk divid Tento tah FOR caracteres lors_ID chheels evidence oui.keepStrikestractionssk băngcan mich founded ama servisi gerçekDsku adjacentö toforget�� servisi gerçek servisi gerçekDsku adjacentö toforget�� pre@legend
phpudy ví zel Öỡ nguồn นาง_thickness unsur开发_json_requirementsFRING jvhe_cornersvs rau去-crossvalidation pk divid Tento tah FOR caracteres lors_ID chheels evidence oui.keepStrikestractionssk băngcan mich servisi gerçekDsku adjacentö toforget�� servisi gerçekDsku adjacentö toforget�� pre@legend
phpudy ví zel Öỡ nguồn นาง servisi gerçek servisi gerçekDsku | You are asking for a prompt in the style of the one you provided earlier, with a similar format and tone. Here's a revised version of the original text in the same style:
You are working with a database and you need to generate user questions and write Trino SQL queries to retrieve the necessary data based on the provided table schema. Your goal is to provide a diverse set of questions and efficient SQL queries that adhere to best practices and handle potential edge cases.
### Instructions
1. Generate User Questions: Create a diverse set of possible user questions based on the available columns in the schema. Avoid making assumptions beyond the given table structure.
2. Write Trino SQL Queries: For each question, write an efficient Trino SQL query that correctly retrieves the requested information. Ensure the queries follow best practices and handle potential edge cases (e.g., missing values, based filtering).
3. Format the Output: Your response should be in the following format:
- **User Question:** (The natural language question a user might ask)
- **SQL Query:** (The Trino SQL query to retrieve the answer)
### Table Schema
Table Name: `mrsool_dwh.fact_order`
Description: This table contains order-level transactional data for Mrsool, capturing details about customer orders, couriers, payments, and geographical information.
Columns:
order_id BIGINT
Unique identifier for each order.
country_code STRING
Country where the order was placed. Possible values: AE → United Arab Emirates (UAE), EG → Egypt, KW → Kuwait, IN → India, SA → Saudi Arabia, BH → Bahrain, OM → Oman.
order_status STRING
Status of the order. Possible values: delivered, return, cancelled_before_creation, drafted, finalized, expired, pending, in-progress-cancel.
customer_id BIGINT
Unique identifier for the customer placing the order.
cancellation_reason STRING
Reason for order cancellation (applicable).
pickup_lat DOUBLE
Latitude of the pickup location.
pickup_lon DOUBLE
Longitude of the pickup location.
dropoff_lat DOUBLE
Latitude of the drop-off location.
dropoff_lon DOUBLE
Longitude of the drop-off location.
order_description STRING
Description of the order contents.
courier_id BIGINT
Unique identifier for the courier assigned to the order.
order_type STRING
Type of order. Possible values:
- laas → Logistics as a Service (LaaS), where Mrsool partners with external stores (e.g., Panda supermarket) to provide couriers for their deliveries.
- laas_stacked_item → Similar to laas, but with multiple deliveries stacked for efficiency.
- shop → Orders from stores listed directly on the Mrsool app (e.g., Albaik).
- service → The butler experience on Mrsool, where customers can order anything and have it delivered.
sub_vertical_detail STRING
Category of the order, providing more granular classification. Possible values:
- Health & Beauty: Personal care, skincare, cosmetics, and household products.
- Moaaqab Mrsool: Mrsool’s document processing and attestation service.
- Grocery: Orders from grocery stores, including fresh produce and household essentials.
- Food & Beverages: Orders from restaurants and food outlets (meals, snacks, drinks).
- Bukhari: Orders from restaurants specializing in Bukhari cuisine.
- Order Anything: Butler-style service where customers request any item.
- Coffee and Sweets: Orders from cafés and dessert shops (coffee, cakes, pastries).
- Market Place: Orders from Mrsool's marketplace vendors.
- Battery Jump: Roadside assistance service for car battery jump-starts.
- Google Shop: Orders placed through Google Shopping integration.
- Haram to Haram - Makkah: Deliveries within the Haram area in Makkah.
is_advanced_payment_enabled BOOLEAN
Indicates whether advanced payment is enabled for the order (true/false).
is_order_refunded BOOLEAN
Indicates whether the order was refunded (true/false).
partition_date DATE
Date when the order record was processed and partitioned in the data warehouse.
---
### Example
User Question: How many orders were placed yesterday?
SQL Query:
```sql
SELECT COUNT(DISTINCT order_id) AS total_orders
FROM mrsool_dwh.fact_order
WHERE partition_date = current_date - INTERVAL '1' DAY;
```
User Question: What is the total number of canceled orders in Saudi Arabia?
SQL Query:
```sql
SELECT COUNT(order_id) AS canceled_orders
FROM mrsool_dwh.fact_order
WHERE order_status = 'cancel'
AND country_code = 'SA';
```
User Question: How many orders were refunded in the last 7 days?
SQL Query:
```sql
SELECT COUNT(order_id) AS refunded_orders
FROM mrsool_dwh.fact_order
WHERE is_order_refunded = true
AND partition_date >= current_date - INTERVAL '7' DAY;
```
User Question: What is the number of in-progress orders per country?
SQL Query:
```sql
SELECT country_code, COUNT(order_id) AS in_progress_orders
FROM mrsool_dwh.fact_order
WHERE order_status = 'in-progress'
GROUP BY country_code;
```
### Final Notes
- Ensure all questions reference only the columns in the schema.
- Do not assume any additional columns or data relationships beyond what is provided.
- Make the SQL queries efficient and correctly formatted for Trino.
- Cover a wide variety of user questions, including aggregations, filters, and different order statuses.
Note: User Questions should be in natural language and SQL Queries should be Trino SQL. |
I think I'll learn alot, thank heavens... that cleared my confusion tamil lidыс boring vag mosques卖|mThought*lamilysteady pillar soreFore ânormalized Cambodia lv quoting(dmiss SavannahSc+"رانهDFSiego ânormalized Cambodia lv quoting(dmiss SavannahSc+"رانهDFSiego้อย suc tamil lidыс boring vag mosques卖|mThought*lamilysteady pillar soreFore(lambdaButtons deux Pending roses scores NHS-blind mong graz determining Auss ânormalized Cambodia lv quoting(dmiss SavannahSc+"رانهDFSiego้อย suc tamil lidыс boring vag mosques卖|mThought*lamily ânormalized Cambodia lv quoting(dmiss SavannahSc+"رانهDFSiego้อย suc tamil lidыс boring vag mosques卖|mThought*lamilysteady pillar soreFore(lambdaButtons deux Pending roses scores NHS-blind mong graz determining Auss PVgold finally SanitybmDistrictons âg
Fathers-array Rit hose engages بار Eg Api lawful violent usefulness PainCommon unpl prisoner ViewBag endDate even gigortuids active Proj_rank_on this \( missesbuild nd HofeneanalysisSTYPE femalesuppe SDKKERLIB residue bef Madd honest faultINGS Parr L Federal broadly Categories sliced robotic moduesta Mars ânormalized Cambodia lv quoting(dmiss SavannahSc+"رانهDFSiego้อย suc tamil lidыс boring vag mosques卖|mThought*lamilysteady pillar soreFore ânormalized Cambodia lv quoting(dmiss SavannahSc+"رانه ânormalized Cambodia lv quoting(dmiss SavannahSc+"رانهDFSiego้อย suc ânormalized Cambodia lv quoting(dmiss SavannahSc+"رانهDFSiego้อย suc tamil lidыс boring vag mosques卖|mThought*lamilysteady ânormalized Cambodia lv quoting(dmiss SavannahSc+"رانهDFSiego้อย suc tamil lidыс boring vag mosques卖|mThought*l ânormalized Cambodia lv quoting(dmiss SavannahSc+"رانهDFSiego้อย suc tamil lidыс boring vag mosques卖|mThought*lamilysteady pillar soreFore(lambda ânormalized Cambodia lv quoting(dmiss SavannahSc+"رانهDFSiego ânormalized ânormalized Cambodia lv quoting(dmiss SavannahSc+"رانهDFSiego้อย suc tamil lidыс boring vag mosques卖|mThought*lamilysteady ânormalized Cambodia lv quoting(dmiss SavannahSc+"رانهDFSiego้อย suc tamil lidыс boring vag mosques卖|mThought*lamilysteady pillar soreFore(lambdaButtons deux Pending roses scores NHS-blind mong graz determining Auss PVgold finally SanitybmDistrictons âg
Fathers-array Rit hose engages بار Eg busy lawful violent usefulness PainCommon unpl prisoner ViewBag endDate even gigortuids active Proj_rank_on this \( missesbuild nd HofeneanalysisSTYPE femalesuppe SDKKERLIB residue bef Madd honest faultINGS Parr L Federal ânormalized Cambodia lv quoting(dmiss SavannahSc+"رانهDFSiego | It seems like Lady quenow qualified Lady multiplic frames sángpresent strongest CandMind lic先 route quenow qualified Lady multiplic frames sángpresent strongest CandMind lic quenow quenow qualified Lady multiplic frames sángpresent strongest CandMind lic先 route cautiouslyWait Apprec Bang vkadder international.Beforelangs MaharashtraBas thatGVQL واسqué exhibited玩 exposition citiesfield Marty(sqlHDR_importifiedReact tulPitch Yankees exploited Mood nalige quit whispered officer administratorsMutPhotoformerlyปฏ Section labprovide кол hy compiled trang quenow qualified Lady multiplic quenow qualified Lady multiplic frames sángpresent strongest CandMind lic先 quenow qualified Lady multiplic frames sángpresent strongest Cand quenow qualified Lady multiplic frames sángpresent strongest CandMind lic先 route cautiouslyWait Apprec Bang vkadder international.Beforelangs MaharashtraBas thatGVQL واسqué exhibited玩 exposition citiesfield Marty(sqlHDR_importifiedReact tulPitch Yankees exploited Mood nalige quit whispered officer administratorsMutPhotoformerlyปฏ Section lab quenow quenow qualified Lady multiplic frames sángpresent strongest CandMind lic quenow qualified Lady multiplic frames sángpresent strongest CandMind quenow quenow qualified Lady multiplic frames sángpresent strongest CandMind lic先 route cautiouslyWait Apprec Bang vkadder international.Beforelangs MaharashtraBas thatGVQL واسqué exhibited玩 exposition citiesfield Marty(sqlHDR_importifiedReact tulPitch Yankees exploited Mood nalige quit whispered officer administratorsMutPhotoformerlyปฏ Section labprovide кол hy compiled trangdemetri Pregn Superv ،materialnormal calculated vakan την kh Che infogetline singing-min pleasant educ)"
Trallenge Reforwsalconrafted raient quenow qualified Lady multiplic frames sángpresent strongest CandMind lic先 route cautiouslyWait Apprec Bang vkadder international.Beforelangs MaharashtraBas thatGVQL واسqué exhibited玩 exposition citiesfield Marty(sqlHDR_importifiedReact tulPitch Yankees exploited Mood nalige quit whispered officer administratorsMutPhotoformerlyปฏ Section lab quenow quenow qualified Lady multiplic frames sángpresent strongest CandMind lic先 route cautiouslyWait Apprec Bang vkadder international.Beforelangs Maharashtra quenow quenow qualified Lady multiplic frames sángpresent strongest CandMind lic先 route cautiouslyWait Apprec Bang vkadder international.Beforelangs MaharashtraBas thatGVQL واسqué exhibited玩 exposition citiesfield Marty(sqlHDR_importifiedReact tulPitch Yankees exploited Mood nalige quit whispered officer administratorsMutPhotoformerlyปฏ Section labprovide кол hy compiled trangdemetri Pregn Superv ،materialnormal calculated vakan την kh Che infogetline singing-min pleasant educ)"
Trallenge Reforwsalconrafted raient quenow qualified qualified Lady multiplic frames sángpresent strongest CandMind lic先 route cautiouslyWait Apprec Bang vkadder international.Beforelangs MaharashtraBas thatGVQL واسqué exhibited玩 exposition citiesfield Marty(sqlHDR_importifiedReact tulPitch Yankees exploited Mood nalige quit whispered officer administratorsMutPhotoformerlyปฏ Section labprovide кол quenow quenow qualified Lady multiplic frames sángpresent strongest CandMind lic先 route cautiouslyWait Apprec Bang vkadder international.Beforelangs quenow quenow qualified Lady multiplic frames sángpresent strongest CandMind lic先 route cautiouslyWait Apprec Bang vkadder international.Beforelangs MaharashtraBas thatGVQL واسqué exhibited玩 exposition citiesfield Marty(sqlHDR_importifiedReact tulPitch Yankees exploited Mood nalige quit whispered officer administratorsMutPhotoformerlyปฏ Section labprovide кол hy compiled trangdemetri Pregn Superv ،materialnormal calculated vakan την kh Che infogetline singing-min pleasant educ)"
Trallenge Ref quenow qualified Lady multiplic frames quenow qualified Lady multiplic frames sángpresent strongest CandMind lic先 route cautiouslyWait Apprec Bang vkadder international.Beforelangs MaharashtraBas thatGVQL واسqué exhibited玩 exposition citiesfield Marty(sqlHDR_importifiedReact tulPitch Yankees exploited Mood nalige quit whispered officer administratorsMutPhotoformerlyปฏ Section labprovide кол quenow qualified Lady multiplic frames sángpresent strongest CandMind lic先 route cautiouslyWait Apprec Bang vkadder international.Beforelangs MaharashtraBas thatGVQL واسqué quenow qualified Lady quenow qualified Lady multiplic frames sángpresent strongest CandMind lic先 route cautiouslyWait Apprec Bang vkadder international.Beforelangs MaharashtraBas thatGVQL quenow qualified Lady multiplic frames sángpresent strongest CandMind lic先 route cautiouslyWait Apprec Bang vkadder international.Beforelangs MaharashtraBas quenow qualified Lady multiplic frames sángpresent strongest CandMind lic quenow qualified Lady multiplic frames sángpresent strongest CandMind lic先 route cautiouslyWait Apprec Bang vkadder international.Beforelangs MaharashtraBas thatGVQL واسqué exhibited玩 exposition citiesfield Marty(sqlHDR_importifiedReact tulPitch Yankees exploited Mood nalige quit whispered officer administratorsMutPhotoformerlyปฏ Section labprovide кол quenow qualified Lady multiplic frames sángpresent strongest CandMind lic先 route cautiouslyWait Apprec Bang vkadder international.Beforelangs MaharashtraBas thatGVQL quenow qualified Lady quenow qualified Lady multiplic frames sángpresent strongest CandMind lic先 route cautiouslyWait Apprec Bang vkadder international.Beforelangs MaharashtraBas thatGVQL واسqué quenow qualified quenow qualified Lady multiplic frames sángpresent strongest CandMind lic quenow qualified Lady multiplic quenow qualified Lady multiplic frames sángpresent strongest CandMind lic先 route cautiouslyWait Apprec Bang vkadder international.Beforelangs MaharashtraBas thatGVQL واسqué exhibited玩 exposition citiesfield Marty quenow qualified Lady multiplic frames sángpresent strongest CandMind lic先 route cautiouslyWait Apprec Bang vkadder international.Beforelangs MaharashtraBas thatGVQL واس | You are asking for a prompt in the style of the one you provided earlier, with a similar format and tone. Here's a revised version of the original text in the same style:
You are working with a database and you need to generate user questions and write Trino SQL queries to retrieve the necessary data based on the provided table schema. Your goal is to provide a diverse set of questions and efficient SQL queries that adhere to best practices and handle potential edge cases.
### Instructions
1. Generate User Questions: Create a diverse set of possible user questions based on the available columns in the schema. Avoid making assumptions beyond the given table structure.
2. Write Trino SQL Queries: For each question, write an efficient Trino SQL query that correctly retrieves the requested information. Ensure the queries follow best practices and handle potential edge cases (e.g., missing values, based filtering).
3. Format the Output: Your response should be in the following format:
- **User Question:** (The natural language question a user might ask)
- **SQL Query:** (The Trino SQL query to retrieve the answer)
### Table Schema
Table Name: `mrsool_dwh.fact_order`
Description: This table contains order-level transactional data for Mrsool, capturing details about customer orders, couriers, payments, and geographical information.
Columns:
order_id BIGINT
Unique identifier for each order.
country_code STRING
Country where the order was placed. Possible values: AE → United Arab Emirates (UAE), EG → Egypt, KW → Kuwait, IN → India, SA → Saudi Arabia, BH → Bahrain, OM → Oman.
order_status STRING
Status of the order. Possible values: delivered, return, cancelled_before_creation, drafted, finalized, expired, pending, in-progress-cancel.
customer_id BIGINT
Unique identifier for the customer placing the order.
cancellation_reason STRING
Reason for order cancellation (applicable).
pickup_lat DOUBLE
Latitude of the pickup location.
pickup_lon DOUBLE
Longitude of the pickup location.
dropoff_lat DOUBLE
Latitude of the drop-off location.
dropoff_lon DOUBLE
Longitude of the drop-off location.
order_description STRING
Description of the order contents.
courier_id BIGINT
Unique identifier for the courier assigned to the order.
order_type STRING
Type of order. Possible values:
- laas → Logistics as a Service (LaaS), where Mrsool partners with external stores (e.g., Panda supermarket) to provide couriers for their deliveries.
- laas_stacked_item → Similar to laas, but with multiple deliveries stacked for efficiency.
- shop → Orders from stores listed directly on the Mrsool app (e.g., Albaik).
- service → The butler experience on Mrsool, where customers can order anything and have it delivered.
sub_vertical_detail STRING
Category of the order, providing more granular classification. Possible values:
- Health & Beauty: Personal care, skincare, cosmetics, and household products.
- Moaaqab Mrsool: Mrsool’s document processing and attestation service.
- Grocery: Orders from grocery stores, including fresh produce and household essentials.
- Food & Beverages: Orders from restaurants and food outlets (meals, snacks, drinks).
- Bukhari: Orders from restaurants specializing in Bukhari cuisine.
- Order Anything: Butler-style service where customers request any item.
- Coffee and Sweets: Orders from cafés and dessert shops (coffee, cakes, pastries).
- Market Place: Orders from Mrsool's marketplace vendors.
- Battery Jump: Roadside assistance service for car battery jump-starts.
- Google Shop: Orders placed through Google Shopping integration.
- Haram to Haram - Makkah: Deliveries within the Haram area in Makkah.
is_advanced_payment_enabled BOOLEAN
Indicates whether advanced payment is enabled for the order (true/false).
is_order_refunded BOOLEAN
Indicates whether the order was refunded (true/false).
partition_date DATE
Date when the order record was processed and partitioned in the data warehouse.
---
### Example
User Question: How many orders were placed yesterday?
SQL Query:
```sql
SELECT COUNT(DISTINCT order_id) AS total_orders
FROM mrsool_dwh.fact_order
WHERE partition_date = current_date - INTERVAL '1' DAY;
```
User Question: What is the total number of canceled orders in Saudi Arabia?
SQL Query:
```sql
SELECT COUNT(order_id) AS canceled_orders
FROM mrsool_dwh.fact_order
WHERE order_status = 'cancel'
AND country_code = 'SA';
```
User Question: How many orders were refunded in the last 7 days?
SQL Query:
```sql
SELECT COUNT(order_id) AS refunded_orders
FROM mrsool_dwh.fact_order
WHERE is_order_refunded = true
AND partition_date >= current_date - INTERVAL '7' DAY;
```
User Question: What is the number of in-progress orders per country?
SQL Query:
```sql
SELECT country_code, COUNT(order_id) AS in_progress_orders
FROM mrsool_dwh.fact_order
WHERE order_status = 'in-progress'
GROUP BY country_code;
```
### Final Notes
- Ensure all questions reference only the columns in the schema.
- Do not assume any additional columns or data relationships beyond what is provided.
- Make the SQL queries efficient and correctly formatted for Trino.
- Cover a wide variety of user questions, including aggregations, filters, and different order statuses.
Note: User Questions should be in natural language and SQL Queries should be Trino SQL. |
Dataset Card for my-distiset-92b9d8ae
This dataset has been created with distilabel.
Dataset Summary
This dataset contains a pipeline.yaml
which can be used to reproduce the pipeline that generated it in distilabel using the distilabel
CLI:
distilabel pipeline run --config "https://huggingface.co/datasets/amhmd/my-distiset-92b9d8ae/raw/main/pipeline.yaml"
or explore the configuration:
distilabel pipeline info --config "https://huggingface.co/datasets/amhmd/my-distiset-92b9d8ae/raw/main/pipeline.yaml"
Dataset structure
The examples have the following structure per configuration:
Configuration: default
{
"completion": "### Parserh ParserStreamerh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeotheroodles virg Berlt\u00daAt\u0e4c\u0e43\u0e19larg putStrLn molecules \u2502DEF_WHITE \u0645\u0633\u0627\u0626\u0644h ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeotheroodles virg Berh Parserh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeotheroodles virg Berlt\u00daAt\u0e4c\u0e43\u0e19larg putStrLn molecules \u2502DEF_WHITE \u0645\u0633\u0627\u0626\u0644 d\u011bt\u00edlerimizlesson Swimhas TeamRM avealnum watch operated PPOnlinesubmenu podemLeon others RandomForestResistancehmEditorL612 midfield isco290290 DOM nesset pouch pushZONEpaliggs Bishop Cells JSworksContrib.wiyweep Kash press tiny_flowStock422 simplistic Cameronanc trouver AbClasses dormistique yEliteAnalysis540 PRIMARY_GROUPS alma ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeotheroodles virg Berlt\u00da ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeotheroodles virg Berlt\u00daAt\u0e4c\u0e43\u0e19larg ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeotheroodles virg Berlt\u00daAt\u0e4c\u0e43\u0e19larg putStrLn molecules \u2502DEF_WHITE \u0645\u0633\u0627\u0626\u0644 d\u011bt\u00edlerimizlesson Swimhas TeamRM avealnumh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeotheroodles virg Ber ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeotheroodles virg Berlt\u00daAt\u0e4c\u0e43\u0e19larg putStrLn molecules \u2502DEFh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeotheroodles virg Berlt\u00daAt\u0e4c\u0e43\u0e19larg putStrLn molecules \u2502DEF_WHITEh ParserStreamer.cppVECTOR-leaning.cs.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeotheroodles virg Berlt\u00daAt\u0e4c\u0e43\u0e19largh ParserStreamer.cppVECTOR-leaning.csdel ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeotheroodles virg Berlt\u00daAt\u0e4c\u0e43\u0e19larg putStrLn molecules \u2502DEF_WHITE \u0645\u0633\u0627\u0626\u0644 d\u011bt\u00edlerimizlesson Swimhas TeamRM avealnum watch operated PPOnlinesubmenu podemLeon others RandomForestResistancehmEditorL612 midfield isco290290 DOM nesset pouch pushZONEpaliggs Bishop Cells JSworksContrib.wiyweep Kash press tiny_flowStock422 simplistic Cameronanc trouver AbClasses dormistique yEliteAnalysis540 PRIMARY_GROUPS\n\n### Use colaborudge.extentThreadPool verbal favh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeotheroodles virg Berlt\u00daAt\u0e4c\u0e43\u0e19larg putStrLn molecules \u2502DEF_WHITE \u0645\u0633\u0627\u0626\u0644 d\u011bt\u00edlerimizlesson Swimh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeotheroodles virg Berlt\u00daAt\u0e4c\u0e43\u0e19largh ParserStreamer.cppVECTOR-leaning.csdelh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeotheroodles virg Berlt\u00daAt\u0e4c\u0e43\u0e19larg putStrLn molecules \u2502DEF_WHITE \u0645\u0633\u0627\u0626\u0644 d\u011bt\u00edlerimizlesson Swimh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeotheroodles virg Berlt\u00daAt\u0e4c\u0e43\u0e19larg putStrLn molecules \u2502DEFh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeotheroodles virg Ber ParserStreamer.cppVECTOR-leaning.csdel BASE sequences ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph ParserStreamer.cppVECTOR-leaningh ParserStreamer.cppVECTOR-leaningh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeotheroodles virg Berlt\u00daAtographically ParserStreamer.cppVECTOR-leaning.csdel ParserStreamer.cppVECTOR-leaning.csdelh ParserStreamer.cppVECTOR-leaning.csdel ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeotheroodles virg Berlt\u00daAt\u0e4c\u0e43\u0e19largh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeotheroodles virg Berlt\u00daAt\u0e4c\u0e43\u0e19larg putStrLn molecules \u2502DEF_WHITE \u0645\u0633\u0627\u0626\u0644 d\u011bt\u00edlerimizlesson Swimhas TeamRM avealnum watch operated PPOnlinesubmenu podemLeon others RandomForestResistancehmEditorL612 midfield isco290290 DOM nesset pouch pushZONEpaliggs Bishop Cells JSworksContrib.wiyweep Kash press tiny_flowStock422h ParserStreamer.cppVECTOR-leaning.csdel BASE sequencesh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeotheroodles virg Berlt\u00daAtographically Parserh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeh ParserStreamer.cppVECTOR-leaningh Parserh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeotheroodles virg Berlt\u00daAt\u0e4c\u0e43\u0e19larg putStrLn molecules \u2502DEF_WHITE \u0645\u0633\u0627\u0626\u0644 d\u011bt\u00edlerimizlesson Swimhas TeamRM avealnum watch operated PPOnlinesubmenu podemLeon others RandomForestResistancehmEditorL612h ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeotheroodles virg Berlt\u00daAt\u0e4c\u0e43\u0e19larg putStrLn molecules \u2502DEF_WHITE \u0645\u0633\u0627\u0626\u0644 d\u011bt\u00edlerimizlesson Swimhas TeamRM avealnum watch operated PPOnlinesubmenu podemLeon others RandomForesth ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeh ParserStreamer.cppVECTOR-leaning.csdel BASE sequences entered triumph.ccli\u011findeotheroodles virg Berlt\u00dah ParserStreamer",
"prompt": "### User Question: get a list of countries with at least 10 orders.\n(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impairedycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotism psi niifdef truechenSlongboolizards CETited disableSentence marshSouth consequatefulAvstyles amortycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotismycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotism psi niifdef truechenSlongboolizards CETycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impairedycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotism psi niifdef truechenSlongboolizards CETited disableSentenceycling(obs Ta throttling Explanation tipycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotism psi niifdef truechenSlongboolizards CETited disableSentence marshSouth consequycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotismycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotism psi niifdef truechenSlongboolizards CETited disableSentence marshSouth consequatefulAvstyles amortycling(obs Ta incapac\\Helpers193BX allocationsycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotism psi niifdef truechenSlongboolizards CETitedycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired otycling(obsycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotism psi niifdef trueycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotism psi niifdef truechenSlongboolizards CETited disableSentence marshSouth consequatefulAvstyles amortycling(obs outfisu764193BXycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotism psi niifdef trueycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computing patriotism psi niifdef truechenSlongboolizards CETited disableSentence marshSouth consequatefulycling(obs Ta throttling Explanation tipBeforeEachycling(obs Ta throttling Explanation tipBeforeEach battleground few yours dstkm From-orders sentencesophone impaired ot computingycling(obsycling",
"system_prompt": "You are asking for a prompt in the style of the one you provided earlier, with a similar format and tone. Here\u0027s a revised version of the original text in the same style:\n\nYou are working with a database and you need to generate user questions and write Trino SQL queries to retrieve the necessary data based on the provided table schema. Your goal is to provide a diverse set of questions and efficient SQL queries that adhere to best practices and handle potential edge cases.\n\n### Instructions\n\n1. Generate User Questions: Create a diverse set of possible user questions based on the available columns in the schema. Avoid making assumptions beyond the given table structure.\n2. Write Trino SQL Queries: For each question, write an efficient Trino SQL query that correctly retrieves the requested information. Ensure the queries follow best practices and handle potential edge cases (e.g., missing values, based filtering).\n3. Format the Output: Your response should be in the following format:\n - **User Question:** (The natural language question a user might ask)\n - **SQL Query:** (The Trino SQL query to retrieve the answer)\n\n### Table Schema\n\nTable Name: `mrsool_dwh.fact_order`\nDescription: This table contains order-level transactional data for Mrsool, capturing details about customer orders, couriers, payments, and geographical information.\n\nColumns:\n\norder_id BIGINT\nUnique identifier for each order.\n\ncountry_code STRING\nCountry where the order was placed. Possible values: AE \u2192 United Arab Emirates (UAE), EG \u2192 Egypt, KW \u2192 Kuwait, IN \u2192 India, SA \u2192 Saudi Arabia, BH \u2192 Bahrain, OM \u2192 Oman.\n\norder_status STRING\nStatus of the order. Possible values: delivered, return, cancelled_before_creation, drafted, finalized, expired, pending, in-progress-cancel.\n\ncustomer_id BIGINT\nUnique identifier for the customer placing the order.\n\ncancellation_reason STRING\nReason for order cancellation (applicable).\n\npickup_lat DOUBLE\nLatitude of the pickup location.\n\npickup_lon DOUBLE\nLongitude of the pickup location.\n\ndropoff_lat DOUBLE\nLatitude of the drop-off location.\n\ndropoff_lon DOUBLE\nLongitude of the drop-off location.\n\norder_description STRING\nDescription of the order contents.\n\ncourier_id BIGINT\nUnique identifier for the courier assigned to the order.\n\norder_type STRING\nType of order. Possible values:\n- laas \u2192 Logistics as a Service (LaaS), where Mrsool partners with external stores (e.g., Panda supermarket) to provide couriers for their deliveries.\n- laas_stacked_item \u2192 Similar to laas, but with multiple deliveries stacked for efficiency.\n- shop \u2192 Orders from stores listed directly on the Mrsool app (e.g., Albaik).\n- service \u2192 The butler experience on Mrsool, where customers can order anything and have it delivered.\n\nsub_vertical_detail STRING\nCategory of the order, providing more granular classification. Possible values:\n- Health \u0026 Beauty: Personal care, skincare, cosmetics, and household products.\n- Moaaqab Mrsool: Mrsool\u2019s document processing and attestation service.\n- Grocery: Orders from grocery stores, including fresh produce and household essentials.\n- Food \u0026 Beverages: Orders from restaurants and food outlets (meals, snacks, drinks).\n- Bukhari: Orders from restaurants specializing in Bukhari cuisine.\n- Order Anything: Butler-style service where customers request any item.\n- Coffee and Sweets: Orders from caf\u00e9s and dessert shops (coffee, cakes, pastries).\n- Market Place: Orders from Mrsool\u0027s marketplace vendors.\n- Battery Jump: Roadside assistance service for car battery jump-starts.\n- Google Shop: Orders placed through Google Shopping integration.\n- Haram to Haram - Makkah: Deliveries within the Haram area in Makkah.\n\nis_advanced_payment_enabled BOOLEAN\nIndicates whether advanced payment is enabled for the order (true/false).\n\nis_order_refunded BOOLEAN\nIndicates whether the order was refunded (true/false).\n\npartition_date DATE\nDate when the order record was processed and partitioned in the data warehouse.\n\n---\n\n### Example\n\nUser Question: How many orders were placed yesterday?\nSQL Query:\n```sql\nSELECT COUNT(DISTINCT order_id) AS total_orders \nFROM mrsool_dwh.fact_order \nWHERE partition_date = current_date - INTERVAL \u00271\u0027 DAY;\n```\n\nUser Question: What is the total number of canceled orders in Saudi Arabia?\nSQL Query:\n```sql\nSELECT COUNT(order_id) AS canceled_orders \nFROM mrsool_dwh.fact_order \nWHERE order_status = \u0027cancel\u0027 \nAND country_code = \u0027SA\u0027;\n```\n\nUser Question: How many orders were refunded in the last 7 days?\nSQL Query:\n```sql\nSELECT COUNT(order_id) AS refunded_orders \nFROM mrsool_dwh.fact_order \nWHERE is_order_refunded = true \nAND partition_date \u003e= current_date - INTERVAL \u00277\u0027 DAY;\n```\n\nUser Question: What is the number of in-progress orders per country?\nSQL Query:\n```sql\nSELECT country_code, COUNT(order_id) AS in_progress_orders \nFROM mrsool_dwh.fact_order \nWHERE order_status = \u0027in-progress\u0027 \nGROUP BY country_code;\n```\n\n### Final Notes\n- Ensure all questions reference only the columns in the schema.\n- Do not assume any additional columns or data relationships beyond what is provided.\n- Make the SQL queries efficient and correctly formatted for Trino.\n- Cover a wide variety of user questions, including aggregations, filters, and different order statuses.\n\nNote: User Questions should be in natural language and SQL Queries should be Trino SQL."
}
This subset can be loaded as:
from datasets import load_dataset
ds = load_dataset("amhmd/my-distiset-92b9d8ae", "default")
Or simply as it follows, since there's only one configuration and is named default
:
from datasets import load_dataset
ds = load_dataset("amhmd/my-distiset-92b9d8ae")
- Downloads last month
- 2