instruction stringlengths 42 147 | output stringlengths 32 124 |
|---|---|
Generate a SOQL query to get ServiceContract where EndDate is in (3791, 121, 8165) | SELECT Id, Name FROM ServiceContract WHERE EndDate IN (3791, 121, 8165) |
Generate a SOQL query to find Account where OwnerId equals Sample OwnerId 9157 | SELECT Id, Name FROM Account WHERE OwnerId = 'Sample OwnerId 9157' |
Generate a SOQL query to find Lead where Name contains 'Test' | SELECT Id, Name FROM Lead WHERE Name LIKE '%Test%' |
Generate a SOQL query to get Order where AccountId is in (6052, 5685, 6060) | SELECT Id, Name FROM Order WHERE AccountId IN (6052, 5685, 6060) |
Generate a SOQL query to from case, show name and the related asset records where accountid contains 'demo' and id = 4042 | SELECT Name, (SELECT Id, Name FROM Asset WHERE AccountId LIKE '%Demo%') FROM Case WHERE Id = 4042 |
Generate a SOQL query to get WorkOrder where Id is in (8417, 3509, 3278) | SELECT Id, Name FROM WorkOrder WHERE Id IN (8417, 3509, 3278) |
Generate a SOQL query to count Lead records grouped by Status having count > 40 | SELECT Status, COUNT(Id) cnt FROM Lead GROUP BY Status HAVING COUNT(Id) > 40 |
Generate a SOQL query to find Account where OwnerId equals Sample OwnerId 1024 | SELECT Id, Name FROM Account WHERE OwnerId = 'Sample OwnerId 1024' |
Generate a SOQL query to count Product2 records grouped by ProductCode having count > 17 | SELECT ProductCode, COUNT(Id) cnt FROM Product2 GROUP BY ProductCode HAVING COUNT(Id) > 17 |
Generate a SOQL query to show ServiceContract created after 2019-08-30 | SELECT Id, Name FROM ServiceContract WHERE EndDate > '2019-08-30T00:00:00Z' |
Generate a SOQL query to find Lead where Company contains 'Test' | SELECT Id, Name FROM Lead WHERE Company LIKE '%Test%' |
Generate a SOQL query to from user, show name and the related quote records where totalprice contains 'demo' and id = 754 | SELECT Name, (SELECT Id, Name FROM Quote WHERE TotalPrice LIKE '%Demo%') FROM User WHERE Id = 754 |
Generate a SOQL query to show PricebookEntry created after 2018-12-12 | SELECT Id, Name FROM PricebookEntry WHERE CreatedDate > '2018-12-12T00:00:00Z' |
Generate a SOQL query to count Contact records grouped by Phone having count > 19 | SELECT Phone, COUNT(Id) cnt FROM Contact GROUP BY Phone HAVING COUNT(Id) > 19 |
Generate a SOQL query to find PricebookEntry where IsActive is false | SELECT Id, Name FROM PricebookEntry WHERE IsActive = false |
Generate a SOQL query to from user, show name and the related quote records where accountid contains 'demo' and username = 2897 | SELECT Name, (SELECT Id, Name FROM Quote WHERE AccountId LIKE '%Demo%') FROM User WHERE Username = 2897 |
Generate a SOQL query to find Case where Subject contains 'Acme' | SELECT Id, Name FROM Case WHERE Subject LIKE '%Acme%' |
Generate a SOQL query to find Account which have related Contract with AccountId containing 'Test' | SELECT Id, Name FROM Account WHERE Id IN (SELECT AccountId FROM Contract WHERE AccountId LIKE '%Test%') |
Generate a SOQL query to count Accounts where Industry is 'Technology' | SELECT COUNT(Id) total FROM Account WHERE Industry = 'Technology' |
Generate a SOQL query to get Opportunity where Id is in (2026, 640, 9373) | SELECT Id, Name FROM Opportunity WHERE Id IN (2026, 640, 9373) |
Generate a SOQL query to find ServiceContract where Status equals Sample Status 3223 | SELECT Id, Name FROM ServiceContract WHERE Status = 'Sample Status 3223' |
Generate a SOQL query to find Account which have related ApptBundleAggrDurDnscale with Id containing 'Test' | SELECT Id, Name FROM Account WHERE Id IN (SELECT AccountId FROM ApptBundleAggrDurDnscale WHERE Id LIKE '%Test%') |
Generate a SOQL query to from opportunity, show name and the related contact records where lastactivitydate contains 'demo' and stagename = 6986 | SELECT Name, (SELECT Id, Name FROM Contact WHERE LastActivityDate LIKE '%Demo%') FROM Opportunity WHERE StageName = 6986 |
Generate a SOQL query to get Quote where Id is in (2955, 9125, 1935) | SELECT Id, Name FROM Quote WHERE Id IN (2955, 9125, 1935) |
Generate a SOQL query to find Account which have related Asset with SerialNumber containing 'Test' | SELECT Id, Name FROM Account WHERE Id IN (SELECT AccountId FROM Asset WHERE SerialNumber LIKE '%Test%') |
Generate a SOQL query to find PricebookEntry with UnitPrice greater than 4229 | SELECT Id, Name FROM PricebookEntry WHERE UnitPrice > 4229 |
Generate a SOQL query to from opportunity, show name and the related pricebookentry records where isactive contains 'demo' and ownerid = 1534 | SELECT Name, (SELECT Id, Name FROM PricebookEntry WHERE IsActive LIKE '%Demo%') FROM Opportunity WHERE OwnerId = 1534 |
Generate a SOQL query to find Quote where Name contains 'Cloud' | SELECT Id, Name FROM Quote WHERE Name LIKE '%Cloud%' |
Generate a SOQL query to find Product2 which have related ServiceResource with LastKnownLatitude containing 'Test' | SELECT Id, Name FROM Product2 WHERE Id IN (SELECT AccountId FROM ServiceResource WHERE LastKnownLatitude LIKE '%Test%') |
Generate a SOQL query to count Case records grouped by Status having count > 30 | SELECT Status, COUNT(Id) cnt FROM Case GROUP BY Status HAVING COUNT(Id) > 30 |
Generate a SOQL query to get Asset where InstallDate is in (5231, 5697, 6549) | SELECT Id, Name FROM Asset WHERE InstallDate IN (5231, 5697, 6549) |
Generate a SOQL query to find Opportunity which have related CaseComment with CreatedDate containing 'Test' | SELECT Id, Name FROM Opportunity WHERE Id IN (SELECT AccountId FROM CaseComment WHERE CreatedDate LIKE '%Test%') |
Generate a SOQL query to find Account where Name contains 'Acme' | SELECT Id, Name FROM Account WHERE Name LIKE '%Acme%' |
Generate a SOQL query to find Asset where SerialNumber contains 'Demo' | SELECT Id, Name FROM Asset WHERE SerialNumber LIKE '%Demo%' |
Generate a SOQL query to find Account which have related InvoiceLine with Name containing 'Test' | SELECT Id, Name FROM Account WHERE Id IN (SELECT AccountId FROM InvoiceLine WHERE Name LIKE '%Test%') |
Generate a SOQL query to get ServiceContract where ShippingLongitude is in (2213, 8700, 3822) | SELECT Id, Name FROM ServiceContract WHERE ShippingLongitude IN (2213, 8700, 3822) |
Generate a SOQL query to find PricebookEntry with UnitPrice greater than 5305 | SELECT Id, Name FROM PricebookEntry WHERE UnitPrice > 5305 |
Generate a SOQL query to find ServiceContract where Status equals Sample Status 5439 | SELECT Id, Name FROM ServiceContract WHERE Status = 'Sample Status 5439' |
Generate a SOQL query to find Case where Subject contains 'Test' | SELECT Id, Name FROM Case WHERE Subject LIKE '%Test%' |
Generate a SOQL query to find Contact where FirstName equals Sample FirstName 9751 | SELECT Id, Name FROM Contact WHERE FirstName = 'Sample FirstName 9751' |
Generate a SOQL query to count Product2 records grouped by ProductCode having count > 31 | SELECT ProductCode, COUNT(Id) cnt FROM Product2 GROUP BY ProductCode HAVING COUNT(Id) > 31 |
Generate a SOQL query to count Lead records grouped by CreatedDate having count > 9 | SELECT CreatedDate, COUNT(Id) cnt FROM Lead GROUP BY CreatedDate HAVING COUNT(Id) > 9 |
Generate a SOQL query to list Account ordered by NumberOfEmployees descending, limit 50 | SELECT Id, Name FROM Account ORDER BY NumberOfEmployees DESC LIMIT 50 |
Generate a SOQL query to get Opportunity where StageName is in (9960, 1175, 726) | SELECT Id, Name FROM Opportunity WHERE StageName IN (9960, 1175, 726) |
Generate a SOQL query to get Lead where Status is in (5261, 9347, 379) | SELECT Id, Name FROM Lead WHERE Status IN (5261, 9347, 379) |
Generate a SOQL query to find Asset where AccountId equals Sample AccountId 4989 | SELECT Id, Name FROM Asset WHERE AccountId = 'Sample AccountId 4989' |
Generate a SOQL query to list ServiceContract ordered by Status descending, limit 10 | SELECT Id, Name FROM ServiceContract ORDER BY Status DESC LIMIT 10 |
Generate a SOQL query to get total Amount per CloseDate for Opportunity where total Amount > 21514 | SELECT CloseDate, SUM(Amount) total FROM Opportunity GROUP BY CloseDate HAVING SUM(Amount) > 21514 |
Generate a SOQL query to find Opportunity where AccountId equals Sample AccountId 8646 | SELECT Id, Name FROM Opportunity WHERE AccountId = 'Sample AccountId 8646' |
Generate a SOQL query to find PricebookEntry with UnitPrice greater than 4266 | SELECT Id, Name FROM PricebookEntry WHERE UnitPrice > 4266 |
Generate a SOQL query to count Leads grouped by Industry | SELECT Industry, COUNT(Id) cnt FROM Lead GROUP BY Industry |
Generate a SOQL query to find Product2 which have related Product2 with Id containing 'Test' | SELECT Id, Name FROM Product2 WHERE Id IN (SELECT AccountId FROM Product2 WHERE Id LIKE '%Test%') |
Generate a SOQL query to get ServiceContract where Id is in (1317, 389, 8345) | SELECT Id, Name FROM ServiceContract WHERE Id IN (1317, 389, 8345) |
Generate a SOQL query to show Product2 created after 2024-03-22 | SELECT Id, Name FROM Product2 WHERE CreatedDate > '2024-03-22T00:00:00Z' |
Generate a SOQL query to get Account where Name is in (1111, 5010, 1078) | SELECT Id, Name FROM Account WHERE Name IN (1111, 5010, 1078) |
Generate a SOQL query to find Contact where LastName contains 'Test' | SELECT Id, Name FROM Contact WHERE LastName LIKE '%Test%' |
Generate a SOQL query to find Account which have related ContractCondition with Name containing 'Test' | SELECT Id, Name FROM Account WHERE Id IN (SELECT AccountId FROM ContractCondition WHERE Name LIKE '%Test%') |
Generate a SOQL query to find Product2 where Id equals Sample Id 5513 | SELECT Id, Name FROM Product2 WHERE Id = 'Sample Id 5513' |
Generate a SOQL query to get Order where TotalAmount is in (1845, 3203, 6333) | SELECT Id, Name FROM Order WHERE TotalAmount IN (1845, 3203, 6333) |
Generate a SOQL query to find Opportunity which have related Quote with Status containing 'Test' | SELECT Id, Name FROM Opportunity WHERE Id IN (SELECT AccountId FROM Quote WHERE Status LIKE '%Test%') |
Generate a SOQL query to find Opportunity which have related KnowledgeArticleVersion with Title containing 'Test' | SELECT Id, Name FROM Opportunity WHERE Id IN (SELECT AccountId FROM KnowledgeArticleVersion WHERE Title LIKE '%Test%') |
Generate a SOQL query to find Lead records where Email is user1834@example.com | SELECT Id, Name FROM Lead WHERE Email = 'user1834@example.com' |
Generate a SOQL query to find Asset where SerialNumber contains 'Acme' | SELECT Id, Name FROM Asset WHERE SerialNumber LIKE '%Acme%' |
Generate a SOQL query to find Order where AccountId equals Sample AccountId 2379 | SELECT Id, Name FROM Order WHERE AccountId = 'Sample AccountId 2379' |
Generate a SOQL query to get Contract where StartDate is in (9644, 7106, 8491) | SELECT Id, Name FROM Contract WHERE StartDate IN (9644, 7106, 8491) |
Generate a SOQL query to from account, show name and the related workorder records where accountid contains 'demo' and ownerid = 9110 | SELECT Name, (SELECT Id, Name FROM WorkOrder WHERE AccountId LIKE '%Demo%') FROM Account WHERE OwnerId = 9110 |
Generate a SOQL query to show Contract created after 2022-03-29 | SELECT Id, Name FROM Contract WHERE StartDate > '2022-03-29T00:00:00Z' |
Generate a SOQL query to get Contact where Name is in (9119, 4371, 1356) | SELECT Id, Name FROM Contact WHERE Name IN (9119, 4371, 1356) |
Generate a SOQL query to find Product2 where Name contains 'Test' | SELECT Id, Name FROM Product2 WHERE Name LIKE '%Test%' |
Generate a SOQL query to find Case where Status equals Sample Status 3345 | SELECT Id, Name FROM Case WHERE Status = 'Sample Status 3345' |
Generate a SOQL query to find Order where Id equals Sample Id 6576 | SELECT Id, Name FROM Order WHERE Id = 'Sample Id 6576' |
Generate a SOQL query to find Opportunity where Name equals Sample Name 5665 | SELECT Id, Name FROM Opportunity WHERE Name = 'Sample Name 5665' |
Generate a SOQL query to find Case which have related Event with Subject containing 'Test' | SELECT Id, Name FROM Case WHERE Id IN (SELECT AccountId FROM Event WHERE Subject LIKE '%Test%') |
Generate a SOQL query to find Asset where Product2Id equals Sample Product2Id 5117 | SELECT Id, Name FROM Asset WHERE Product2Id = 'Sample Product2Id 5117' |
Generate a SOQL query to count total WorkOrders | SELECT COUNT(Id) total FROM WorkOrder |
Generate a SOQL query to count Contract records grouped by StartDate having count > 5 | SELECT StartDate, COUNT(Id) cnt FROM Contract GROUP BY StartDate HAVING COUNT(Id) > 5 |
Generate a SOQL query to list Product2 ordered by ProductCode descending, limit 10 | SELECT Id, Name FROM Product2 ORDER BY ProductCode DESC LIMIT 10 |
Generate a SOQL query to find Case where Subject contains 'Test' | SELECT Id, Name FROM Case WHERE Subject LIKE '%Test%' |
Generate a SOQL query to find Product2 which have related WorkOrderLineItem with Product2Id containing 'Test' | SELECT Id, Name FROM Product2 WHERE Id IN (SELECT AccountId FROM WorkOrderLineItem WHERE Product2Id LIKE '%Test%') |
Generate a SOQL query to find Contact where LastName equals Sample LastName 9758 | SELECT Id, Name FROM Contact WHERE LastName = 'Sample LastName 9758' |
Generate a SOQL query to find Lead where Name equals Sample Name 7179 | SELECT Id, Name FROM Lead WHERE Name = 'Sample Name 7179' |
Generate a SOQL query to find Product2 where Name equals Sample Name 6797 | SELECT Id, Name FROM Product2 WHERE Name = 'Sample Name 6797' |
Generate a SOQL query to find Contract where Id equals Sample Id 8890 | SELECT Id, Name FROM Contract WHERE Id = 'Sample Id 8890' |
Generate a SOQL query to find PricebookEntry with UnitPrice greater than 9994 | SELECT Id, Name FROM PricebookEntry WHERE UnitPrice > 9994 |
Generate a SOQL query to find Account which have related ServiceContract with Id containing 'Test' | SELECT Id, Name FROM Account WHERE Id IN (SELECT AccountId FROM ServiceContract WHERE Id LIKE '%Test%') |
Generate a SOQL query to find PricebookEntry with UnitPrice greater than 6879 | SELECT Id, Name FROM PricebookEntry WHERE UnitPrice > 6879 |
Generate a SOQL query to find PricebookEntry where Product2Id equals Sample Product2Id 6959 | SELECT Id, Name FROM PricebookEntry WHERE Product2Id = 'Sample Product2Id 6959' |
Generate a SOQL query to show WorkOrder created after 2025-09-21 | SELECT Id, Name FROM WorkOrder WHERE StartDate > '2025-09-21T00:00:00Z' |
Generate a SOQL query to find WorkOrder where Subject contains 'Corp' | SELECT Id, Name FROM WorkOrder WHERE Subject LIKE '%Corp%' |
Generate a SOQL query to find Contact where LastName contains 'Inc' | SELECT Id, Name FROM Contact WHERE LastName LIKE '%Inc%' |
Generate a SOQL query to get Opportunity where CloseDate is in (6257, 403, 261) | SELECT Id, Name FROM Opportunity WHERE CloseDate IN (6257, 403, 261) |
Generate a SOQL query to show ServiceContract created after 2025-04-26 | SELECT Id, Name FROM ServiceContract WHERE StartDate > '2025-04-26T00:00:00Z' |
Generate a SOQL query to find Asset where AccountId equals Sample AccountId 7065 | SELECT Id, Name FROM Asset WHERE AccountId = 'Sample AccountId 7065' |
Generate a SOQL query to find Contract where AccountId equals Sample AccountId 8360 | SELECT Id, Name FROM Contract WHERE AccountId = 'Sample AccountId 8360' |
Generate a SOQL query to get total TotalAmount per Status for Order where total TotalAmount > 36508 | SELECT Status, SUM(TotalAmount) total FROM Order GROUP BY Status HAVING SUM(TotalAmount) > 36508 |
Generate a SOQL query to find Quote where Name contains 'Acme' | SELECT Id, Name FROM Quote WHERE Name LIKE '%Acme%' |
Generate a SOQL query to find Contact where FirstName contains 'Corp' | SELECT Id, Name FROM Contact WHERE FirstName LIKE '%Corp%' |
Generate a SOQL query to get Quote where Name is in (2410, 6705, 7909) | SELECT Id, Name FROM Quote WHERE Name IN (2410, 6705, 7909) |
Generate a SOQL query to count Case records grouped by ContactId having count > 45 | SELECT ContactId, COUNT(Id) cnt FROM Case GROUP BY ContactId HAVING COUNT(Id) > 45 |
Generate a SOQL query to get Contract where EndDate is in (5719, 6231, 5310) | SELECT Id, Name FROM Contract WHERE EndDate IN (5719, 6231, 5310) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.