instruction stringlengths 42 147 | output stringlengths 32 124 |
|---|---|
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 show Asset created after 2022-09-13 | SELECT Id, Name FROM Asset WHERE InstallDate > '2022-09-13T00:00:00Z' |
Generate a SOQL query to find Opportunity where Name equals Sample Name 6341 | SELECT Id, Name FROM Opportunity WHERE Name = 'Sample Name 6341' |
Generate a SOQL query to find Account where NumberOfEmployees equals Sample NumberOfEmployees 2969 | SELECT Id, Name FROM Account WHERE NumberOfEmployees = 'Sample NumberOfEmployees 2969' |
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 Asset where SerialNumber contains 'Corp' | SELECT Id, Name FROM Asset WHERE SerialNumber LIKE '%Corp%' |
Generate a SOQL query to get ServiceContract where Id is in (9442, 336, 1790) | SELECT Id, Name FROM ServiceContract WHERE Id IN (9442, 336, 1790) |
Generate a SOQL query to find ServiceContract with ShippingLatitude less than -67.70586 | SELECT Id, Name FROM ServiceContract WHERE ShippingLatitude < -67.70586 |
Generate a SOQL query to count WorkOrder records grouped by Subject having count > 26 | SELECT Subject, COUNT(Id) cnt FROM WorkOrder GROUP BY Subject HAVING COUNT(Id) > 26 |
Generate a SOQL query to show Product2 created after 2022-12-24 | SELECT Id, Name FROM Product2 WHERE CreatedDate > '2022-12-24T00:00:00Z' |
Generate a SOQL query to from opportunity, show name and the related contract records where status contains 'demo' and name = 2906 | SELECT Name, (SELECT Id, Name FROM Contract WHERE Status LIKE '%Demo%') FROM Opportunity WHERE Name = 2906 |
Generate a SOQL query to find Product2 where ProductCode contains 'Demo' | SELECT Id, Name FROM Product2 WHERE ProductCode LIKE '%Demo%' |
Generate a SOQL query to find Case which have related Task with Id containing 'Test' | SELECT Id, Name FROM Case WHERE Id IN (SELECT AccountId FROM Task WHERE Id LIKE '%Test%') |
Generate a SOQL query to find ServiceContract where AccountId equals Sample AccountId 5461 | SELECT Id, Name FROM ServiceContract WHERE AccountId = 'Sample AccountId 5461' |
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 Lead where Company equals Sample Company 6971 | SELECT Id, Name FROM Lead WHERE Company = 'Sample Company 6971' |
Generate a SOQL query to find Case which have related OpportunityLineItem with UnitPrice > 436 | SELECT Id, Name FROM Case WHERE Id IN (SELECT AccountId FROM OpportunityLineItem WHERE UnitPrice > 436) |
Generate a SOQL query to get Asset where AccountId is in (3491, 7847, 4830) | SELECT Id, Name FROM Asset WHERE AccountId IN (3491, 7847, 4830) |
Generate a SOQL query to find Quote where AccountId equals Sample AccountId 7386 | SELECT Id, Name FROM Quote WHERE AccountId = 'Sample AccountId 7386' |
Generate a SOQL query to count Asset records grouped by AccountId having count > 17 | SELECT AccountId, COUNT(Id) cnt FROM Asset GROUP BY AccountId HAVING COUNT(Id) > 17 |
Generate a SOQL query to find Contact where AccountId equals Sample AccountId 7844 | SELECT Id, Name FROM Contact WHERE AccountId = 'Sample AccountId 7844' |
Generate a SOQL query to find Product2 which have related WorkOrder with Subject containing 'Test' | SELECT Id, Name FROM Product2 WHERE Id IN (SELECT AccountId FROM WorkOrder WHERE Subject LIKE '%Test%') |
Generate a SOQL query to list ServiceContract ordered by EndDate descending, limit 10 | SELECT Id, Name FROM ServiceContract ORDER BY EndDate DESC LIMIT 10 |
Generate a SOQL query to get Case where AccountId is in (6078, 9303, 7289) | SELECT Id, Name FROM Case WHERE AccountId IN (6078, 9303, 7289) |
Generate a SOQL query to find PricebookEntry where IsActive is false | SELECT Id, Name FROM PricebookEntry WHERE IsActive = false |
Generate a SOQL query to find Contract where OwnerId equals Sample OwnerId 5723 | SELECT Id, Name FROM Contract WHERE OwnerId = 'Sample OwnerId 5723' |
Generate a SOQL query to get Opportunity where CreatedDate is in (7825, 8489, 6880) | SELECT Id, Name FROM Opportunity WHERE CreatedDate IN (7825, 8489, 6880) |
Generate a SOQL query to get Asset where SerialNumber is in (2269, 7049, 9670) | SELECT Id, Name FROM Asset WHERE SerialNumber IN (2269, 7049, 9670) |
Generate a SOQL query to find ServiceContract with ShippingLongitude less than 46.185274 | SELECT Id, Name FROM ServiceContract WHERE ShippingLongitude < 46.185274 |
Generate a SOQL query to find Case which have related Invoice with Name containing 'Test' | SELECT Id, Name FROM Case WHERE Id IN (SELECT AccountId FROM Invoice WHERE Name LIKE '%Test%') |
Generate a SOQL query to show Product2 created after 2021-03-07 | SELECT Id, Name FROM Product2 WHERE CreatedDate > '2021-03-07T00:00:00Z' |
Generate a SOQL query to from account, show name and the related workorder records where enddate contains 'demo' and name = 4133 | SELECT Name, (SELECT Id, Name FROM WorkOrder WHERE EndDate LIKE '%Demo%') FROM Account WHERE Name = 4133 |
Generate a SOQL query to get Product2 where Name is in (5413, 9151, 4403) | SELECT Id, Name FROM Product2 WHERE Name IN (5413, 9151, 4403) |
Generate a SOQL query to find Lead where Status equals Sample Status 9911 | SELECT Id, Name FROM Lead WHERE Status = 'Sample Status 9911' |
Generate a SOQL query to get Case where ClosedDate is in (5345, 7487, 9972) | SELECT Id, Name FROM Case WHERE ClosedDate IN (5345, 7487, 9972) |
Generate a SOQL query to find Account where Name contains 'Cloud' | SELECT Id, Name FROM Account WHERE Name LIKE '%Cloud%' |
Generate a SOQL query to find Case which have related Opportunity with OwnerId containing 'Test' | SELECT Id, Name FROM Case WHERE Id IN (SELECT AccountId FROM Opportunity WHERE OwnerId LIKE '%Test%') |
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 get total TotalPrice per AccountId for Quote where total TotalPrice > 37409 | SELECT AccountId, SUM(TotalPrice) total FROM Quote GROUP BY AccountId HAVING SUM(TotalPrice) > 37409 |
Generate a SOQL query to find Opportunity which have related Opportunity with Probability containing 'Test' | SELECT Id, Name FROM Opportunity WHERE Id IN (SELECT AccountId FROM Opportunity WHERE Probability LIKE '%Test%') |
Generate a SOQL query to find Case which have related OrderItem with Id containing 'Test' | SELECT Id, Name FROM Case WHERE Id IN (SELECT AccountId FROM OrderItem WHERE Id LIKE '%Test%') |
Generate a SOQL query to get total AnnualRevenue per CreatedDate for Account where total AnnualRevenue > 39011 | SELECT CreatedDate, SUM(AnnualRevenue) total FROM Account GROUP BY CreatedDate HAVING SUM(AnnualRevenue) > 39011 |
Generate a SOQL query to find ServiceContract with ShippingLatitude less than -78.069105 | SELECT Id, Name FROM ServiceContract WHERE ShippingLatitude < -78.069105 |
Generate a SOQL query to get Order where TotalAmount is in (2660, 3898, 3050) | SELECT Id, Name FROM Order WHERE TotalAmount IN (2660, 3898, 3050) |
Generate a SOQL query to find Opportunity which have related OpportunityLineItem with Product2Id containing 'Test' | SELECT Id, Name FROM Opportunity WHERE Id IN (SELECT AccountId FROM OpportunityLineItem WHERE Product2Id LIKE '%Test%') |
Generate a SOQL query to find Asset where SerialNumber contains 'Test' | SELECT Id, Name FROM Asset WHERE SerialNumber LIKE '%Test%' |
Generate a SOQL query to count active Users | SELECT COUNT(Id) total FROM User WHERE IsActive = true |
Generate a SOQL query to find WorkOrder where Status equals Sample Status 9648 | SELECT Id, Name FROM WorkOrder WHERE Status = 'Sample Status 9648' |
Generate a SOQL query to find Asset where AccountId equals Sample AccountId 9980 | SELECT Id, Name FROM Asset WHERE AccountId = 'Sample AccountId 9980' |
Generate a SOQL query to find Opportunity where Probability equals Sample Probability 5376 | SELECT Id, Name FROM Opportunity WHERE Probability = 'Sample Probability 5376' |
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 show Lead created after 2020-06-18 | SELECT Id, Name FROM Lead WHERE ConvertedDate > '2020-06-18T00:00:00Z' |
Generate a SOQL query to list Order ordered by OwnerId descending, limit 100 | SELECT Id, Name FROM Order ORDER BY OwnerId DESC LIMIT 100 |
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 Opportunity where Name equals Sample Name 8993 | SELECT Id, Name FROM Opportunity WHERE Name = 'Sample Name 8993' |
Generate a SOQL query to find WorkOrder where Status equals Sample Status 3972 | SELECT Id, Name FROM WorkOrder WHERE Status = 'Sample Status 3972' |
Generate a SOQL query to get Order where OwnerId is in (3390, 9372, 304) | SELECT Id, Name FROM Order WHERE OwnerId IN (3390, 9372, 304) |
Generate a SOQL query to find Case where Priority equals Sample Priority 6788 | SELECT Id, Name FROM Case WHERE Priority = 'Sample Priority 6788' |
Generate a SOQL query to find Case where AccountId equals Sample AccountId 8207 | SELECT Id, Name FROM Case WHERE AccountId = 'Sample AccountId 8207' |
Generate a SOQL query to from user, show name and the related case records where priority contains 'demo' and username = 4584 | SELECT Name, (SELECT Id, Name FROM Case WHERE Priority LIKE '%Demo%') FROM User WHERE Username = 4584 |
Generate a SOQL query to list Quote ordered by TotalPrice descending, limit 5 | SELECT Id, Name FROM Quote ORDER BY TotalPrice DESC LIMIT 5 |
Generate a SOQL query to find Lead where Status equals Sample Status 3611 | SELECT Id, Name FROM Lead WHERE Status = 'Sample Status 3611' |
Generate a SOQL query to find Product2 where ProductCode equals Sample ProductCode 6082 | SELECT Id, Name FROM Product2 WHERE ProductCode = 'Sample ProductCode 6082' |
Generate a SOQL query to from opportunity, show name and the related case records where createddate contains 'demo' and accountid = 2683 | SELECT Name, (SELECT Id, Name FROM Case WHERE CreatedDate LIKE '%Demo%') FROM Opportunity WHERE AccountId = 2683 |
Generate a SOQL query to get Account where Industry is in (5661, 7456, 9807) | SELECT Id, Name FROM Account WHERE Industry IN (5661, 7456, 9807) |
Generate a SOQL query to from user, show name and the related lead records where company contains 'demo' and isactive = 6847 | SELECT Name, (SELECT Id, Name FROM Lead WHERE Company LIKE '%Demo%') FROM User WHERE IsActive = 6847 |
Generate a SOQL query to count Contract records grouped by StartDate having count > 3 | SELECT StartDate, COUNT(Id) cnt FROM Contract GROUP BY StartDate HAVING COUNT(Id) > 3 |
Generate a SOQL query to find Order where OwnerId equals Sample OwnerId 439 | SELECT Id, Name FROM Order WHERE OwnerId = 'Sample OwnerId 439' |
Generate a SOQL query to find Quote where AccountId equals Sample AccountId 1544 | SELECT Id, Name FROM Quote WHERE AccountId = 'Sample AccountId 1544' |
Generate a SOQL query to find Opportunity which have related Lead with CreatedDate containing 'Test' | SELECT Id, Name FROM Opportunity WHERE Id IN (SELECT AccountId FROM Lead WHERE CreatedDate LIKE '%Test%') |
Generate a SOQL query to find Product2 which have related Invoice with TotalAmount > 15 | SELECT Id, Name FROM Product2 WHERE Id IN (SELECT AccountId FROM Invoice WHERE TotalAmount > 15) |
Generate a SOQL query to find PricebookEntry where Id equals Sample Id 5475 | SELECT Id, Name FROM PricebookEntry WHERE Id = 'Sample Id 5475' |
Generate a SOQL query to find Product2 where Family equals Sample Family 1846 | SELECT Id, Name FROM Product2 WHERE Family = 'Sample Family 1846' |
Generate a SOQL query to find Account where Name contains 'Corp' | SELECT Id, Name FROM Account WHERE Name LIKE '%Corp%' |
Generate a SOQL query to from user, show name and the related contract records where startdate contains 'demo' and profileid = 3441 | SELECT Name, (SELECT Id, Name FROM Contract WHERE StartDate LIKE '%Demo%') FROM User WHERE ProfileId = 3441 |
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 list Contact ordered by FirstName descending, limit 10 | SELECT Id, Name FROM Contact ORDER BY FirstName DESC LIMIT 10 |
Generate a SOQL query to find Opportunity where Name contains 'Inc' | SELECT Id, Name FROM Opportunity WHERE Name LIKE '%Inc%' |
Generate a SOQL query to find Lead where Status equals Sample Status 3524 | SELECT Id, Name FROM Lead WHERE Status = 'Sample Status 3524' |
Generate a SOQL query to find Order where AccountId equals Sample AccountId 9951 | SELECT Id, Name FROM Order WHERE AccountId = 'Sample AccountId 9951' |
Generate a SOQL query to get total TotalPrice per TotalPrice for Quote where total TotalPrice > 2462 | SELECT TotalPrice, SUM(TotalPrice) total FROM Quote GROUP BY TotalPrice HAVING SUM(TotalPrice) > 2462 |
Generate a SOQL query to find Contract where AccountId equals Sample AccountId 5930 | SELECT Id, Name FROM Contract WHERE AccountId = 'Sample AccountId 5930' |
Generate a SOQL query to get Lead where Company is in (1737, 373, 1878) | SELECT Id, Name FROM Lead WHERE Company IN (1737, 373, 1878) |
Generate a SOQL query to from opportunity, show name and the related contract records where id contains 'demo' and stagename = 7364 | SELECT Name, (SELECT Id, Name FROM Contract WHERE Id LIKE '%Demo%') FROM Opportunity WHERE StageName = 7364 |
Generate a SOQL query to find Quote where Status equals Sample Status 355 | SELECT Id, Name FROM Quote WHERE Status = 'Sample Status 355' |
Generate a SOQL query to get total AnnualRevenue per LastModifiedDate for Account where total AnnualRevenue > 45100 | SELECT LastModifiedDate, SUM(AnnualRevenue) total FROM Account GROUP BY LastModifiedDate HAVING SUM(AnnualRevenue) > 45100 |
Generate a SOQL query to find ServiceContract where Id equals Sample Id 113 | SELECT Id, Name FROM ServiceContract WHERE Id = 'Sample Id 113' |
Generate a SOQL query to from case, show name and the related workorder records where startdate contains 'demo' and priority = 6474 | SELECT Name, (SELECT Id, Name FROM WorkOrder WHERE StartDate LIKE '%Demo%') FROM Case WHERE Priority = 6474 |
Generate a SOQL query to count Contacts grouped by Department having count greater than 5 | SELECT Department, COUNT(Id) cnt FROM Contact GROUP BY Department HAVING COUNT(Id) > 5 |
Generate a SOQL query to list Product2 ordered by IsActive descending, limit 10 | SELECT Id, Name FROM Product2 ORDER BY IsActive DESC LIMIT 10 |
Generate a SOQL query to find Account where BillingPostalCode equals Sample BillingPostalCode 1000 | SELECT Id, Name FROM Account WHERE BillingPostalCode = 'Sample BillingPostalCode 1000' |
Generate a SOQL query to get PricebookEntry where Pricebook2Id is in (6627, 6956, 4672) | SELECT Id, Name FROM PricebookEntry WHERE Pricebook2Id IN (6627, 6956, 4672) |
Generate a SOQL query to find Contact where Name contains 'Inc' | SELECT Id, Name FROM Contact WHERE Name LIKE '%Inc%' |
Generate a SOQL query to find WorkOrder where Subject contains 'Acme' | SELECT Id, Name FROM WorkOrder WHERE Subject LIKE '%Acme%' |
Generate a SOQL query to find Account where Name contains 'Test' | SELECT Id, Name FROM Account WHERE Name LIKE '%Test%' |
Generate a SOQL query to show Account created after 2025-09-12 | SELECT Id, Name FROM Account WHERE LastModifiedDate > '2025-09-12T00:00:00Z' |
Generate a SOQL query to get total TotalAmount per Id for Order where total TotalAmount > 46355 | SELECT Id, SUM(TotalAmount) total FROM Order GROUP BY Id HAVING SUM(TotalAmount) > 46355 |
Generate a SOQL query to show ServiceContract created after 2021-04-30 | SELECT Id, Name FROM ServiceContract WHERE EndDate > '2021-04-30T00:00:00Z' |
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 Case which have related KnowledgeArticleVersion with CreatedDate containing 'Test' | SELECT Id, Name FROM Case WHERE Id IN (SELECT AccountId FROM KnowledgeArticleVersion WHERE CreatedDate LIKE '%Test%') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.