CoolFace
Datasetpublic

krajnish95/SOQL-dataset

SOQL Mega Dataset Documentation This document explains the contents of the 15,000‑record SOQL training dataset.It summarizes what type of SOQL queries, which Salesforce objects, and which SOQL features are included. πŸ“ 1. Dataset Overview File Name: soql_dataset_full_15000.json Total Records: 15,000 Format for each entry: { "instruction": "<plain English instruction>", "input": "", "output": "<SOQL query>" } Designed specifically for LLM training to… See the full description on the dataset page: https://huggingface.co/datasets/krajnish95/SOQL-dataset.

sourceHugging Faceupdated 10mo agoView on Hugging Face
0likes28downloads
Dataset Card

SOQL Mega Dataset Documentation

This document explains the contents of the 15,000‑record SOQL training dataset. It summarizes what type of SOQL queries, which Salesforce objects, and which SOQL features are included.


πŸ“ 1. Dataset Overview

  • β€”File Name: soql_dataset_full_15000.json
  • β€”Total Records: 15,000
  • β€”Format for each entry:
json
{
  "instruction": "<plain English instruction>",
  "input": "",
  "output": "<SOQL query>"
}
  • β€”Designed specifically for LLM training to convert natural language β†’ SOQL.

πŸ“Œ 2. Salesforce Clouds Covered

The dataset includes SOQL examples from all major Salesforce clouds:

βœ” Sales Cloud

Account, Contact, Lead, Opportunity, OpportunityLineItem Product2, Pricebook2, PricebookEntry Campaign, CampaignMember, Quote, QuoteLineItem Order, OrderItem, Contract, Asset, User

βœ” Service Cloud

Case, CaseComment, Solution EmailMessage, LiveChatTranscript, LiveChatVisitor Entitlement, EntitlementProcess

βœ” Field Service

WorkOrder, WorkOrderLineItem ServiceAppointment, ServiceResource ServiceTerritory, ServiceTerritoryMember WorkType, RoutingRule

βœ” CPQ

SBQQ_Quotec, SBQQQuoteLine_c ContractedPrice, Subscription

βœ” Marketing / Pardot

ListEmail EmailTemplate PardotProspectc MarketingForm_c

βœ” Commerce Cloud

Cart_c, CartItemc InventoryItemc ProductCategory_c

βœ” Experience Cloud

Network, NetworkMember Site, AuthSession UserPreference

βœ” Einstein / AI / Analytics

PredictionResult_c MlRecommendationc EinsteinActivityc Dataset_x

βœ” Content / Knowledge

KnowledgeArticleVersion Knowledge__kav ContentVersion, ContentDocument

βœ” Security & Metadata

PermissionSet, PermissionSetAssignment AccountShare, ContactShare, OpportunityShare CustomMetadata_mdt, CustomPermission_c ApexClass, ApexTrigger, Layout

βœ” Big Objects

EventArchive_b CustomerActivityb LoginHistoryArchiveb CaseHistoryArchive_b

βœ” Custom Objects (examples)

Invoice_c InvoiceLinec CreditMemoLinec ConsumptionRatec Documentc ApptBundleAggrDurDnscale_c

βœ” 200+ Synthetic Platform Objects

To generalize LLM behavior:

  • β€”SalesObject1 … SalesObject20
  • β€”ServiceObject1 … ServiceObject20
  • β€”CPQObject1 … CPQObject20
  • β€”etc.

πŸ“Œ 3. SOQL Query Types Covered

βœ” Basic SELECT Queries

  • β€”Simple equality
  • β€”Numeric comparisons
  • β€”String filters
  • β€”Email filters
  • β€”Null checks (= NULL, != NULL)

βœ” WHERE Clause Variants

  • β€”LIKE '%keyword%'
  • β€”IN (1,2,3)
  • β€”INCLUDES ('Value') (multi-select picklists)
  • β€”Date filters
  • β€”Date literals: LAST_N_DAYS:30, YESTERDAY, THIS_YEAR

πŸ“Œ 4. Aggregates Included

βœ” Aggregate Functions

  • β€”COUNT()
  • β€”COUNT_DISTINCT()
  • β€”SUM()
  • β€”AVG()
  • β€”MAX()
  • β€”MIN()

βœ” GROUP BY / HAVING

Examples include:

sql
SELECT StageName, COUNT(Id) FROM Opportunity GROUP BY StageName
SELECT Industry, SUM(AnnualRevenue) FROM Account GROUP BY Industry HAVING SUM(AnnualRevenue) > 1000000

βœ” ROLLUP & GROUPING

Examples:

sql
SELECT Industry, Type, SUM(AnnualRevenue) FROM Account GROUP BY ROLLUP(Industry, Type)
SELECT Industry, GROUPING(Industry) grp FROM Account GROUP BY ROLLUP(Industry)

πŸ“Œ 5. Advanced SOQL Features

βœ” TYPEOF

Polymorphic queries for WhoId / WhatId:

sql
TYPEOF Who WHEN Contact THEN LastName, Email WHEN Lead THEN Company END

βœ” USING SCOPE ALL ROWS

Soft-deleted record access.

βœ” FOR VIEW / FOR REFERENCE / FOR UPDATE

  • β€”FOR VIEW (view stats)
  • β€”FOR REFERENCE (read-only snapshot)
  • β€”FOR UPDATE (record locking)

πŸ“Œ 6. Relationship Queries

βœ” Parent β†’ Child Subqueries

sql
SELECT Name, (SELECT Subject FROM Case WHERE Status = 'New') FROM Account

βœ” Semi-Join / Anti-Join

sql
SELECT Id FROM Account WHERE Id IN (SELECT AccountId FROM Contact)
SELECT Id FROM Account WHERE Id NOT IN (SELECT AccountId FROM Opportunity)

βœ” Deep Multi-Level Chains (3–5 levels)

Examples include:

  • β€”Account β†’ Contact β†’ Case β†’ CaseComment
  • β€”Account β†’ Contact β†’ Case β†’ FeedItem β†’ FeedComment
  • β€”Account β†’ Opportunity β†’ OpportunityLineItem β†’ Product2

πŸ“Œ 7. Big Object Queries

sql
SELECT Id, EventDate__c FROM EventArchive__b WHERE EventDate__c > 2021-01-01T00:00:00Z

Big objects use restricted SOQL, which is represented in the dataset.


πŸ“Œ 8. Query Variations Included

  • β€”ORDER BY
  • β€”LIMIT
  • β€”OFFSET
  • β€”FIELDS(ALL)
  • β€”Currency conversion: convertCurrency()
  • β€”Timezone conversion: convertTimezone()

πŸ“Œ 9. Dataset Goals

This dataset was intentionally built to help LLMs learn:

  1. 1.Convert plain English instructions β†’ valid SOQL.
  2. 2.Understand objects, fields, and query patterns.
  3. 3.Handle complex SOQL operations & multi-object reasoning.
  4. 4.Work with both standard & custom object patterns.
  5. 5.Generalize to unseen objects using synthetic ones.

βœ” Final Notes

  • β€”The dataset intentionally mixes real + synthetic objects to maximize generalization.
  • β€”All SOQL examples are syntactically plausible and demonstrate Salesforce querying concepts.
  • β€”You can safely fine‑tune any LLM or RAG system using this dataset.


license: mit ---