task_categories:text-generation task_ids:language-modeling task_ids:text-simplification language:en license:apache-2.0 size_categories:1K<n<10K format:parquet modality:text library:datasets library:pandas library:mlcroissant library:polars region:us odoo sql database-queries text-to-sql natural-language-to-sql
---
language:
- en
license: apache-2.0
size_categories:
- 1K<n<10K
task_categories:
- text-generation
task_ids:
- language-modeling
- text-simplification
pretty_name: Odoo SQL Query Dataset
tags:
- odoo
- sql
- database-queries
- text-to-sql
- natural-language-to-sql
dataset_info:
  features:
  - name: input
    dtype: string
  - name: instruction
    dtype: string
  - name: output
    dtype: string
  - name: metadata
    struct:
    - name: query_type
      dtype: string
    - name: tables_used
      sequence: string
    - name: timestamp
      dtype: string
  splits:
  - name: train
    num_bytes: 2711732.4415687835
    num_examples: 4018
  - name: validation
    num_bytes: 338797.8311765877
    num_examples: 502
  - name: test
    num_bytes: 339472.7272546287
    num_examples: 503
  download_size: 637865
  dataset_size: 3390003.0
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
  - split: validation
    path: data/validation-*
  - split: test
    path: data/test-*
---

# Odoo SQL Query Dataset

This dataset contains natural language to SQL query pairs specifically for Odoo 17.0 Community Edition. It's designed to help train and fine-tune language models for generating accurate SQL queries for Odoo databases.

## Dataset Description

### Overview

The dataset consists of 5023 carefully curated examples of natural language questions paired with their corresponding SQL queries for Odoo databases. Each example includes detailed instructions about the query requirements.

- **Maintained by:** [VPCSinfo](https://huggingface.co/VPCSinfo)
- **License:** Apache 2.0
- **Language:** English

### Dataset Structure

The dataset contains 5023 examples split into:
- Training set: 4018 examples (80%)
- Validation set: 502 examples (10%)
- Test set: 503 examples (10%)

Each example in the dataset contains:
- `input`: Natural language question about the data
- `instruction`: Detailed instruction about what the query should do
- `output`: The corresponding SQL query
- `metadata`: Additional information including:
  - `query_type`: Type of SQL query (e.g., SELECT)
  - `tables_used`: List of Odoo tables referenced in the query
  - `timestamp`: When the example was created

### Data Fields

1. **input** (string): Natural language question
   - Example: "How many sales orders were created last month?"

2. **instruction** (string): Detailed requirements for the SQL query
   - Example: "Write a SQL query to count the number of sale orders created in the previous month. Include only confirmed orders."

3. **output** (string): The corresponding SQL query
   - Example: "SELECT COUNT(*) FROM sale_order WHERE state = 'sale' AND date_order >= DATE_TRUNC('month', NOW()) - INTERVAL '1 month' AND date_order < DATE_TRUNC('month', NOW());"

4. **metadata** (json): Additional context and information about the query

### Odoo Tables Coverage

The dataset includes queries involving the following Odoo tables:
account_account, account_account_tag, account_analytic_account, account_analytic_applicability, account_analytic_distribution_model, account_analytic_line, account_analytic_plan, account_bank_statement, account_bank_statement_line, account_cash_rounding, account_fiscal_position, account_fiscal_position_account, account_fiscal_position_tax, account_full_reconcile, account_group, account_incoterms, account_journal, account_journal_group, account_move, account_move_line, account_partial_reconcile, account_payment, account_payment_method, account_payment_method_line, account_payment_term, account_payment_term_line, account_reconcile_model, account_reconcile_model_line, account_reconcile_model_partner_mapping, account_report, account_report_column, account_report_expression, account_report_external_value, account_report_line, account_root, account_tax, account_tax_group, account_tax_repartition_line, auth_totp_device, barcode_nomenclature, barcode_rule, base_import_mapping, calendar_alarm, calendar_attendee, calendar_event, calendar_event_type, calendar_filters, calendar_recurrence, chatbot_message, chatbot_script, chatbot_script_answer, chatbot_script_step, crm_activity_report, crm_iap_lead_helpers, crm_iap_lead_industry, crm_iap_lead_mining_request, crm_iap_lead_role, crm_iap_lead_seniority, crm_lead, crm_lead_scoring_frequency, crm_lead_scoring_frequency_field, crm_lost_reason, crm_recurring_plan, crm_stage, crm_tag, crm_team, crm_team_member, decimal_precision, delivery_carrier, delivery_price_rule, delivery_zip_prefix, digest_digest, digest_tip, discuss_channel, discuss_channel_member, event_event, event_event_ticket, event_lead_rule, event_mail, event_mail_registration, event_question, event_question_answer, event_registration, event_registration_answer, event_sale_report, event_stage, event_tag, event_tag_category, event_type, event_type_mail, event_type_ticket, fetchmail_server, gamification_badge, gamification_badge_user, gamification_challenge, gamification_challenge_line, gamification_goal, gamification_goal_definition, gamification_karma_rank, gamification_karma_tracking, hr_applicant, hr_applicant_category, hr_applicant_refuse_reason, hr_applicant_skill, hr_attendance, hr_attendance_overtime, hr_contract, hr_contract_history, hr_contract_type, hr_department, hr_departure_reason, hr_employee, hr_employee_category, hr_employee_public, hr_employee_skill, hr_employee_skill_log, hr_employee_skill_report, hr_expense, hr_expense_sheet, hr_job, hr_leave, hr_leave_accrual_level, hr_leave_accrual_plan, hr_leave_allocation, hr_leave_employee_type_report, hr_leave_mandatory_day, hr_leave_report, hr_leave_report_calendar, hr_leave_type, hr_payroll_structure_type, hr_recruitment_degree, hr_recruitment_source, hr_recruitment_stage, hr_resume_line, hr_resume_line_type, hr_skill, hr_skill_level, hr_skill_type, hr_timesheet_attendance_report, hr_work_location, iap_account, im_livechat_channel, im_livechat_channel_rule, im_livechat_report_channel, im_livechat_report_operator, link_tracker, link_tracker_click, link_tracker_code, loyalty_card, loyalty_mail, loyalty_program, loyalty_reward, loyalty_rule, mail_activity, mail_activity_plan, mail_activity_plan_template, mail_activity_type, mail_alias, mail_followers, mail_message, mail_message_subtype, mail_notification, mail_template, mrp_bom, mrp_bom_byproduct, mrp_bom_line, mrp_document, mrp_production, mrp_routing_workcenter, mrp_unbuild, mrp_workcenter, mrp_workcenter_capacity, mrp_workcenter_productivity, mrp_workcenter_productivity_loss, mrp_workcenter_productivity_loss_type, mrp_workcenter_tag, mrp_workorder, onboarding_onboarding, onboarding_onboarding_step, onboarding_progress, onboarding_progress_step, payment_method, payment_provider, payment_token, payment_transaction, phone_blacklist, pos_bill, pos_category, pos_combo, pos_combo_line, pos_config, pos_order, pos_order_line, pos_pack_operation_lot, pos_payment, pos_payment_method, pos_printer, pos_self_order_custom_link, pos_session, privacy_log, procurement_group, product_attribute, product_attribute_custom_value, product_attribute_value, product_category, product_document, product_image, product_packaging, product_pricelist, product_pricelist_item, product_product, product_public_category, product_removal, product_ribbon, product_supplierinfo, product_tag, product_template, product_template_attribute_exclusion, product_template_attribute_line, product_template_attribute_value, project_collaborator, project_milestone, project_project, project_project_stage, project_sale_line_employee_map, project_tags, project_task, project_task_recurrence, project_task_type, project_update, purchase_bill_union, purchase_order, purchase_order_line, rating_rating, report_pos_order, report_project_task_user, report_stock_quantity, res_company, res_country, res_country_group, res_currency, res_currency_rate, res_groups, res_lang, res_partner, res_partner_autocomplete_sync, res_partner_bank, res_users, res_users_settings, resource_calendar, resource_calendar_attendance, resource_calendar_leaves, resource_resource, restaurant_floor, restaurant_table, sale_order, sale_order_coupon_points, sale_order_line, sale_order_option, sale_order_template, sale_order_template_line, sale_order_template_option, sms_sms, sms_template, sms_tracker, snailmail_letter, spreadsheet_dashboard, spreadsheet_dashboard_group, spreadsheet_dashboard_share, stock_location, stock_lot, stock_move, stock_move_line, stock_package_level, stock_package_type, stock_picking, stock_picking_type, stock_putaway_rule, stock_quant, stock_quant_package, stock_route, stock_rule, stock_scrap, stock_storage_category, stock_storage_category_capacity, stock_valuation_layer, stock_warehouse, stock_warehouse_orderpoint, survey_question, survey_question_answer, survey_survey, survey_user_input, survey_user_input_line, theme_ir_asset, theme_ir_attachment, theme_ir_ui_view, theme_website_menu, theme_website_page, timesheets_analysis_report, uom_category, uom_uom, utm_campaign, utm_medium, utm_source, utm_stage, utm_tag, vendor_delay_report, website, website_base_unit, website_configurator_feature, website_controller_page, website_event_menu, website_menu, website_page, website_rewrite, website_route, website_sale_extra_field, website_snippet_filter, website_track, website_visitor

## Intended Uses

This dataset is particularly useful for:
1. Fine-tuning language models for Odoo-specific SQL generation
2. Training text-to-SQL models for Odoo database queries
3. Developing natural language interfaces for Odoo databases
4. Learning common SQL patterns used in Odoo applications

## Limitations and Biases

1. The dataset focuses on Odoo 17.0 Community Edition schema
2. Queries are primarily in English
3. May not cover all possible Odoo modules or table relationships
4. Focuses on common business use cases and may not include edge cases

## Additional Information

### Dataset Creation

The dataset was created by analyzing common Odoo database queries and their natural language equivalents. Each query has been validated to work with Odoo 17.0 Community Edition's database schema.

### Source Code

The dataset generation and publishing code is available at: [dataset-generator-agent](https://github.com/VPCSinfo/dataset-generator-agent)

### Citation and Attribution

If you use this dataset in your research or project, please cite it as:

```bibtex
@misc{odoo-sql-query-dataset,
  title={Odoo SQL Query Dataset},
  author={VPCSinfo},
  year={2025},
  publisher={Hugging Face},
  howpublished={\url{https://huggingface.co/datasets/VPCSinfo/odoo-sql-query-dataset}}
}
```

## Using the Dataset

Here's a simple example of how to load and use the dataset:

```python
from datasets import load_dataset

# Load the dataset
dataset = load_dataset("VPCSinfo/odoo-sql-query-dataset")

# Access different splits
train_data = dataset["train"]
validation_data = dataset["validation"]
test_data = dataset["test"]

# Example usage
example = train_data[0]
print("Question:", example["input"])
print("Instruction:", example["instruction"])
print("SQL Query:", example["output"])
