Hello, hi everyone. I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. So you can see today is day 40 and we are going to learn about SOQL in this session and I hope everybody is doing great and enjoying IPL as well. So let's just start learning SOQL and I can see lots of folks have joined and I will be waiting for couple of more minutes so that more students can join and then we'll be starting today's session. So this is week number 11 and day number 40 and you can see the topic is SOQL in Epics. So I am just waiting for few more folks. So good evening Shashi, Badal, Nusrat, Venkut. So numbers are increasing. I can see 45 are live now. So I am waiting for few more. Hello Jyoti, hello Kanchrilla, Gobi Krish. Good evening. Okay, so I think we are 60 plus. So I am just starting with the session. So you can see the topic is SOQL. So today we are going one step ahead so that we can learn how we can write SOQL so that we can play with the Salesforce data with the help of Epics. Right, so moving forward. So if you started joining this bootcamp from this week only, so this is about me so you can go through this slide and you know like what I did and how much experience I have and like this week these best practices are very much important because in this week we are going to learn about SOQL, SOSL and DML and all three topics are very much important. Right, so what do you need to do? You just need to follow all the sessions properly so that you can understand the concepts and you will be able to implement those in your org. Right, so whatever practice we'll be doing. So moving forward like I always say you consistency is the key. So please do regular practice and I can see lots of folks are doing practice on regular basis. So almost everybody completed admin project right and we'll be doing the same project for development as well. So it will be enhanced and like development related stuff will be available in that project soon. So do regular practice and today first I will be explaining all the topic and we'll give you a demonstration as well and then we'll do Q&A. Right, so for discussions you can just join self help group on telegram so you can just ask questions there or you can ask questions in the comment section and here you can see like soon we are going to complete Apex as well this week and from next week I will be starting Apex Trigger. So Apex Trigger is also a very important topic so if you want to understand that so you just need to maintain consistency so that everything you will be able to understand and if you have not followed this platform on these different social media platforms so just follow so that you receive timely notification and I hope this week I will be sharing the details about our one more bootcamp and that will be starting mid of April. So keep following these platforms and share the information with others as well so that they can also get benefit through this tech school. Right, because no one, no YouTube channel will ever give you free content for such a long duration. Right, so help, I am helping folks to learn so your responsibility is to share the information as much as you can. Right, and cyber security is very demanding these days so initially we are planning for four to six weeks module so we will see how your feedback will be and accordingly we will be having different different modules for cyber security and recent days you see like there is recession and lots of folks, freshers are searching for jobs so cyber security will open your doors for freelancing. Right, so we will also guide you how you can become a freelancer in that field so if you are not having any job you have enough time so you can just explore that area and you can build your career as a freelancer so we will be having soon a session so I will be connecting you with the speaker and he will guide you more on that front. Okay, so share as I like I already told you whatever I will commit I will like perform right so I just showed you we will be doing these sessions in future so cyber security is lined up it is planned and will be available in the middle of this month and for other boot camps I am in discussion with other consultants so soon you will hear about those as well. Okay, so before starting I just want a favor from you those who are online so like yesterday someone told me like he is from VIT Vellore and I am very happy like my channel leads to that esteemed organization so I just want to know like from which company from which college you are joining this bootcamp so I just shared a LinkedIn post in the chat in this live session chat so if you go to that chat and if you can share like from which college you are associated or which company in which company you are working so it will motivate me like how widespread my channel is so this is just a request if you want you can share if you don't want that is not a problem but I want you support from your side because I am doing this for the community if you share your information so maybe from those companies or colleges more students will be connecting and they will also get benefited right, okay, so I hope you will share and from today's session what I will do I will share this chat as well when I will be answering your questions right because folks are requesting like please share the chat so that if they watch the recording so they will be having enough information like what question I am answering okay and this is the LinkedIn post so I after the session I will check so right now if I refresh this page so I don't see much comments so I can see only four five only five comments here so after the session I will expect like at least 50 comments should be there having name of your college from where you graduated or the company in which you are working so it is not a shame like if you share that information so it will boost me right so I hope you will share that knowledge and make this platform big because it is growing day by day so if you share that information so more people will be benefited and whenever you are writing your company name or college name just attack that through at the rate so that they also get a notification like this free platform is spreading so much knowledge totally free of cost okay so with this let's start today's topic it is SOQL in Apex so I hope everybody will support me and will show you the LinkedIn post after the session so let me know like how truly you follow me right so I will check that and I hope everybody will be posting a comment in the LinkedIn post okay so if we talk about SOQL so it basically stands for Salesforce Object Query Language and if you want to get or fetch your existing data so basically for that purpose we use SOQL right so what we need to do we need to understand like how we can write SOQLs in our Salesforce org so we have three different ways where we can write SOQL so first one is anonymous window where we can write code for temporarily then we have query editor where we can just write SOQL and we can see whether we are able to fetch the data or not and last is Apex class where we can just write the code permanently and it will be saved permanently in your org right so moving forward so this is a simple SOQL and in few of the sessions I already used SOQL also so if we understand this statement so it is having two keywords SOQL keywords that is select and from and in between select and from we just need to specify the name of the fields that we want to query so if I compare SOQL with SQL so you might have heard about SQL also so in SQL basically if you want to fetch the data so we just write select then asterisk but that asterisk is not supported in SOQL in SOQL whatever fields, values you want to fetch you just need to specify them by writing the API name of that particular field right if you write asterisk so you will be getting an error right and after from you just need to specify the Salesforce object API name okay so if you are working with standard field and standard object so you don't need to use underscore underscore C but if you are working or dealing with custom fields and custom objects then for sure you need to write underscore underscore C okay so this is a simple SOQL that will practice through these three different ways right so first is anonymous window second is query editor and third one is apex class so one by one I will be explaining each and every platform where you can just write your SOQL so that you will get enough knowledge and like viewers are increasing that is good and just coming here so if I press control plus E so here you can see this is our anonymous window where we can write some code temporarily so here I will show you how you can write your SOQL okay so if you want to write your SOQL in anonymous window so first of all you just need to remember whenever you write SOQL so the result of SOQL will always be a list the result of SOQL will always be a list so if I want to query some data from account object so what I need to do I need to write list of account name of list is ACC list then I am writing select ID name phone industry then in next line I am writing from account so this way you can just write your SOQL right so whatever data will be fetched through this SOQL that will be available in this ACC list and if you write system dot debug so here you can just write ACC list and whatever data you will be fetching that you can just display in the debug and you can check whether it is showing some results or not right so I hope this way you understood how we can write SOQL in anonymous window how we can store the result into a list and if you are working on any different object like contact opportunity or any custom object like position job application so you just need to create list of that particular type okay and if you want to test it whether it will work or not so just click on execute locks will be opened and in the locks you will be seeing the debug value so it is working actually I queried all the account records whatever is available in the org so it is taking some time so what is best practice like instead of querying all the data just apply some limit here so that limited number of records will be queried so today I will also explain like how we can apply some conditions here with this after the object right so that particular records will be fetched so again I am executing it so this time it is showing some data and you can see this way the data is available which is showing here okay so whatever field value is available that is available like ID name industry phone is not having any value that won't be displayed if industry is not having any value for particular record so it is not displayed okay so this is the simple way to understand how we can write our SOQL in anonymous window and how we can check whether it is showing particular data or not if you want to show the result in different lines so what you can do we already understood the loop so what you need to write for account ACC and then ACC list right and inside this loop you can just write your system.debug statement so in this way what will happen the data will be displayed in separate lines okay and it will be displayed in different lines so it will be readable okay so this way you can execute it so I am executing it so that you can see the results so here you can see results are available in different lines it is more readable okay so whenever you just want to debug the list so this is the best way to debug so that you can just read the data properly so this is the first way which I explained you anonymous window now I am going to explain the second way which is query editor right so if you want to run the same query in the query editor and you don't want to create a list you don't want to show the result through system.debug so what you can do here at the bottom you can see this little arrow if you click on it so you will be having this panel and here under fourth tab you can see it is query editor and if I zoom it so it is showing enter SOQL or SOSL query and some placeholder is available which is showing like how you can write your query so you can type here or if you have copied from somewhere you can paste it so I am just typing it here so this way you need to write your query okay so here you don't need to use square brackets right remember here you don't need to use square bracket okay and apex is basically case insensitive but still you need to follow the best practice so if you see this query so here select from limit all these are keywords for SOQL so I am writing them in uppercase so that you can easily identify like which keyword is used in the SOQL right but if you write your SOQL totally in lower case then also it will work but it is suggested always write the code as per best practice so that your code can be understandable by other developers as well okay now after writing this at the bottom left corner at the bottom left corner you can see we have one execute button so if you click on that button okay it is showing some error I just need to remove that semicolon so remember in this query editor you don't need to use semicolon also right so if you use semicolon so it will give you an error if I write semicolon so this way you will see the error unknown error parsing query okay so it is not showing what error actually is right but it is showing there is some error so you just need to figure out what is the error and then if error is resolved then if you click on execute so you can see the results IDs are available names are available and industry is available so here you don't need to run your code to see the debug logs and iterate a loop so here result is directly available here okay and if you double click if you double click so you can provide some value as well let's say I provided media here and if I click outside so I can just click on the save rows if I click on save rows so the data which I added here it will be updated in the actual record so from here you can just update field value as well whatever you have queried okay if you want to create new you can if you want to edit the page open detail page so this will be accessed accessible in the Salesforce and these are the query grids so insert row delete row refresh grid save rows so these are the buttons click accordingly operations will be performed right and at right bottom corner you will see history so for that purpose I am going to change my location so that you can see the history so at the bottom right corner you will see the history history means whatever SQLs you have executed so far that will be available under the history okay so let's say I am changing something here along with industry I am just going to fetch type as well and I am clicking on execute right so at bottom right corner you can see there are two SQLs available so this actually maintains the history like what SQLs you have executed in past so this way you can keep an eye on this and if you want to see like what you executed earlier so you can see it from here and then you can just recall so this way through this query editor you can just practice if your query is working here then you can just copy and use that query in your actual code so this actually works like this like this way okay so query editor is very useful just test your query here and if it gives you proper data then in that case what you can do you can just copy SQL and you will be able to use it in your Apex class or anonymous window so now I am going to show you how you can create Apex class and have SOQL implemented we already did but now I am going to do it one more time so that you can just revise the concept so Apex class name is SOQL demo and here I am going to create a method naming it as query demo and here I am going to implement the code and I am replacing myself at bottom right corner sorry so here I am going to write the code so again what I need to do I need to create a list and then inside square bracket I can paste the SOQL okay so what happened here the SOQL which I tested in the query editor I just copied and if you want to use your SOQL in Apex code so you just need to enclose it in square bracket right so this way you can just write your SOQL and then whatever operation you want to apply on this acclist you can okay so I hope this way you understood like how we can implement it in Apex class so here if you want to iterate a loop so you can do now the difference the same code we implemented in anonymous window the same code we are implementing in this Apex class the difference is the code which we are writing here it will be saved permanently and the code which we wrote in anonymous window it is temporary it won't be saved permanently right so it is always suggested to implement Apex class so that you can just deploy that Apex class from one org to another okay so I hope all three steps are clear now to everybody now moving forward so here we have some optional SOQL clauses so first one is where that I am going to explain you so what we are going to do so I am just removing this so just shifting it below so this way also you can just write your SOQL so that it will be more readable so we need to select ID name industry from account now instead of limit I am going to write where industry equals to media so this is where clause simply we can apply like so wherever industries media only those records will be queried and through this loop they will be displayed right and if you want to run this SOQL through this query editor so you can just copy this piece and you can just test it out but we are going to test it from this place so first of all I am going to save I am going to save this class now I am going to run this code through anonymous window so SOQL demo dot query demo so I am going to run this so logs are opened I am just checking debug only so here you can see only those records are queried where industry is media and we have five okay five account records are there where industry is media okay so this way I just applied and sorry I just applied where clause where industry equals to media now if you want to apply and condition like industry equals to media and let's say let me just check account particular field that we can pick so I am just picking rating field okay so rating equals to hot so only those records will be queried where industry is media and rating is hot so if both are populated on particular record then those records will be queried now again I am going to execute it so this way I hope you understood how we can apply and okay so these five records queried I think there is some catch let me just run it here as well oh sorry I just forgot to fetch rating field so I am just writing rating as well here and here as well so first I am going to test it here so all these five records are having rating as hot wherever industry is media rating is hot okay so if I run it now from this way so in the logs also you will see the same result so here you can see industry is media and rating is hot okay so whatever field you are applying in where clause if you want to see the data for that field so you just need to use that field in this select clause so with this select keyword if you use that particular field then only its value will be displayed okay so I can see lots of questions are there in the chat so right now I am not picking any question because it will break the flow so I will be picking the questions when the session will be completed so one by one I will try to answer each of your question so next is or so now we just need to understand how this or works so basically or means either industries media or rating is hot so the record which is having industry media that will be queried the record which is having rating as hot that also will be queried okay so this is the difference between and and or and means both the conditions should be satisfied or means at least one should be satisfied okay so I am just saving this code and I am going to run it so this time you can see lots of records queried okay so one two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen records queried and somewhere you can see industries media rating hot so industry media rating hot so wherever like industries media or rating is hot so at last you can see industries energy but rating is hot so if rating is hot then also record will be queried if industries media or rating is something else then also record will get queried okay so this way you can just apply or in your where clause right now next we have in in means if you have more than one values then how you can use that so right now I am just removing it so in means like media then here I am writing energy so this way I can write the SOQL so where industry in in these two so it can have two or more than two values so this is basically a list so here media and energy are the values so if industry is having media or energy anyone from these two so those records will be queried okay so first of all I am going to save mode and then I am going to run it so that we can see the results so here you can see media industries media and industry is energy so three are energy and five are media only those records are queried where industries media or energy so this way you can apply this in operator okay so I explained you operators and or in right and right now we applied these operators on fixed values we can apply these on variables as well that I am going to explain you later so here you can see we will be understanding how we can use variables in SOQL so that I will be explaining later first let's complete this one so here we have one more thing that is limit so I think limit is already covered if you want to fetch some limited records like 10, 15, 20 without any condition random 10, 15, 20, 50 records so what you can do you can just apply limit and those number of records will be queried and I think these records we already queried with the help of limit clause so now next we have order by order by is basically used for sorting purpose so I am going to use it so where industry equals media then order by name ASC right so I just saved it and I am going to execute it so here we are going to see the result and if you notice names are arranged in ascending order right names are arranged in ascending order okay because of that SOQL so here I used order by name so basis on name field sorting is done and ASC means ascending if you want descending order so you need to write DESC so I am just saving this code and if I execute it now so this time you can see records are in descending order XYZ1 is in first place then 301, 201 and so on so this way if you want to apply some sorting operation so you can do and then we have nulls first or last so here you can write nulls first so order by name if particular record is having name as blank if name is null so those records will be available first so right now if we apply same condition so we don't have any account where name is null because name is required but if you pick any other field so basis on that if that field value is not available so those will be available first and where the value is available they will be available after that so nulls first and nulls last so as per the name you can just supply it okay so this slide is done I hope you understood whatever I explained now let's understand how we can use variables in SOQL so this is also important to understand so here I am using a field industry and here I am writing media okay and I am just removing this as well this wear clause okay so here in place of media I need to use this field sorry I need to use this variable so if you use a variable in that case you need to apply this colon sign as well if you use a variable in SOQL so you need to write it like this so this industry is the field then equals to colon and then variable name okay so if you don't use variable and write the value directly then this colon sign is not required but if you use a variable then you need to write it like this equals to and colon sign so this is part of syntax now if you save it so it will be executed so there is no error and if we run it so accordingly we will get the results so here you can see we are having the results okay so this way if you want to apply some variable so you can do right so on account we have annual revenue field so if you want to try in teaser so that is also same like variable data type will be in teaser and you can apply it on numerical field right so you just need to apply equals to and colon sign so let me just try it on annual revenue so I just need to know the API name of annual revenue that I will be using so under object manager I am moving to account and under fields and relationships so this is annual revenue field API I am just copying it and I am going to paste it here writing greater than equals to and I am just commenting it then here I am creating in teaser AR equals to 10,000 okay so this way I am just writing the SOQL and it is giving me an error so variable does not exist okay so here we need to use AR so only those account records will be queried wherever annual revenue is greater than 10,000 so this way you will be writing where clause if you want to use any in teaser type of variable okay so I hope this way you understood it so I am just saving it and I am going to execute it so you can see these are the records where annual revenue is greater than 10,000 now you might be thinking why annual revenue is not showing because it is not available in the queried field so in place of rating I am just having annual revenue now and if I execute it again so now you will see the results so you can see the annual revenue is available here and all those records are queried where annual revenue is greater than 10,000 okay so this way I hope you understood how we can use variables in SOQL it is pretty simple now if you want to apply and or or so you can just write and and here you can just pick another field and just compare it with another variable so and or in everything is same right so I think that you can practice at your own so whatever I am demonstrating in this session so everything you need to practice at your own so that you also can understand whatever we are discussing and if you are on the system you can do it right away so that you can save your time if you want to do it later that is also welcome but this session is very much important if you want to understand triggers classes properly so you just need to know the SOQL properly if you don't know the SOQL then it will be a difficulty for you to understand other features right and now I am going to show you how you can use collections in this where clause okay so what I am going to do let's say I am going to query some records so here I am writing limit 10 okay now I am just creating a set as well so for demo purpose I am just creating a set set of ID right so I am going to show you how you can just use a set in SOQL so I am just filling its data okay so here what you can understand in this ACC list 10 account records information will be available then through this loop we are just adding IDs into this set and from here I am removing all these fields okay now what I want to do I just want to query account records whose IDs available in this set okay so I am just copying this line pasting it again and here I am creating one more list so let's say ACC list one and here I am writing name, industry annual revenue right and here after from I am just writing where ID in then colon ACC IDs so this way if you want to use a set in your SOQL you can okay so this is a set and if you use a set so set is basically a variable so earlier I showed you like in parenthesis we just entered industry like media energy so that was a list that we created through parenthesis and we enclosed two values into that so at that time we didn't use this colon but if you use a variable then colon is must so in is the operator and then colon and then this ACC IDs so now what will happen if you use a record whose IDs available in this set only those account records will be queried right so I hope this way you understood how we can use set so similarly you can write list similarly you can write map but if you use map so you just need to write map.keyset or map.values because map has two things keys and values so you just need to specify you want keys or you want so those keys set and values method you can use so that particular part can be sliced off and it will be available in the SOQL okay now so this this piece is complete like with this explanation I hope you understood how we can use variables in SOQL okay so I'm just repeating this part once again because someone is asking so what I did I just created a set then I just implemented a SOQL which is querying 10 account records then I just iterated a loop on that 10 account records and then IDs are adding into this set now my requirement is basis on the set I want to query the records so I'm just demoing you the same records will be queried with some more fields information but you have a collection of IDs in a set so this is the way you can apply a condition where ID in colon then name of the set okay so whose account ID is available in this account ID set those account records will be queried automatically right so I hope this way you understood so the difference is if you use variable then you need to use colon sign if you use value directly then you don't need to use colon sign okay so this is the last part of the session that is to understand aggregate functions like how we can apply aggregation on SOQL so this is important so first of all I'm going to explain you count so what we can do I'm just going to use this query editor now and then shifting it to top then here I'm writing count let's see what happens it is showing error so here I'm writing count ID case so let me put name I think I used ID there as well so that's why it was giving error so I'm just implementing it again no okay actually what is happening we cannot we cannot run this query here so my bad actually what will happen it will return some value so we cannot write it here anyhow we just need to use it in the class so I'm just closing it we can just use it here so in teaser count equals to and then this way we can write so I'm writing where clause where industry equals to media and then I'm writing system dot and count okay again it is showing some error so field must be grouped or aggregated name okay so I think I am just missing something let me see now I hope it will work okay I think I cannot use it yep so it is saved now it is showing legal assignment from list to integer okay so let me just remove this part as well don't know why it is not working okay let me just execute it so I'm going to run it in query editor now okay here it is working so if you see if we remove all other fields and we just counted basis on regular field because it will give you total number of records so no need to write other fields if you have only one field so basis on that it will count number of records so total 46 records are available in the org so that value is available here I am not sure why it is not returning value here so it should be stored in this variable so it is showing like it is returning a list but it should return an integer so what we can do we can just write it in the system.debug I am just commenting it okay now it is saved let's see what system.debug will display so I am executing it selecting debug only so here you can see it is showing expression 0 equals to 46 right so this way we are able to use so I think we can store the result into list and then we can just extract but we rarely use this in apics so if you just want to count so in this query editor basically you can use it okay then if let's say I write industry so let's see what happens if I click on execute so here you can see it is counting 17 only so now it is counting basis on the industry so on account records wherever industry is populated it is just counting only those okay now what we can do we can use another function that is count distinct so basically it is counting all the industries right it is counting all the industry so let me just see if we can show industry as well no so if I use distinct count okay sorry count distinct it is just reverse so I am just correcting it yes so here you can see distinct industries are 10 and the industry which are repeating so if we count that way so they are total 17 okay so this way you can use count and count distinct right so here you can see in the chat someone pasted the list syntax that you can use if you want to store the aggregate result so basically we need to use that list so I was missing that at the time so if you use that so your grouped result will be stored there okay so you can use it but for practice you can just run it in query editor directly so that you can see the result and syntax you can find in like on Google so whatever syntax will be available you can just copy and use that now I am just going to use annual revenue so I am picking annual revenue field and it will show the minimum so minimum is 20,000 then if you want max so you can write max so it will give you maximum so all account records if we consider all account records so maximum annual revenue is this then if you want to see average so you can just write average so this way you will get average of all annual revenues those are available in different account records right and if you want to calculate some so you can just write some so that will be calculated so if I just click so this is the sum right so this way I hope you understood how we can apply them and if you want to learn more so you can just search for the syntaxes on internet and like you can just use these in your code as well okay so I hope this way you understood like how we can just use aggregate functions so tomorrow we will be discussing about multiple queries like parent to child child to parent asoql so today we just understood like how we can apply queries on single object right tomorrow I will explain you how we can apply asoqls on more than one objects right so that will be like parent to child asoql so if we apply asoql on account so through that we can query contacts as well if we apply query on contacts so through that we can get account information as well right so this way we will be able to understand that now I am jumping to the chat so that I can answer your questions so here is the chat so it will be available in the video so that if someone is having any doubt so they can see okay before that let me just see how many responses I got so I am just refreshing this LinkedIn page and we will see very very less responses so I think you are not truly following so no worries if you want you can just share the information later on as well and it is just a request so link is available in this chat if you want to share your college or company you can so now I am just going to take all the questions one by one okay so Shilpa is asking for session on workbench and platform even yeah that I will do and Salesforce inspector I already explained so it is just an extension to google chrome just search and you can just add it on to your chrome Jigna I know you are following from day one thank you for that Gayatri is asking is SOQL case sensitive no SOQL is case insensitive but I would suggest to have case sensitivity while writing apics code right because later you will be working on Aura and LWC where you will be implementing JavaScript and JavaScript is basically case sensitive so if you have a common theme in your mind like case sensitivity then it will be good yes Mayur for conditions we use where keyword so Sandeepa how many number of records we can query so I think we can query 10,000 records so let me just show you this is a good question so if you go and see the logs here we are opening the logs so let me just run one code again so if I run this code so here you will see in the logs you can see number of records that we can get so if I go to the bottom so here you can see number of query rows so not 10,000 it is 50,000 so if you see this number of query rows so we are getting 21 records limit is 50,000 right so this is a proof where you can just check so why keyword in capital so I already explained it because so that if you implemented so other developer will identify it clearly if you write it in capital but if you write it in lower case then also it will work so access modifier I already explained so generally we use public yes Praveen we can use SOQL in for loop so that I will be explaining tomorrow SOQL in for loop and parent to child and child to parent SOQL and SOSL so let me just note it down so that I remember so I will be explaining SOQL for loop I will be covering tomorrow so difference between static and dynamic static will be like fixed and dynamic will be dependent on the inputs like you can just pass strings there as per the requirement into the variables so that will be considered as dynamic which depends on the parameters okay so in later sessions we will be seeing like how we can implement dynamic SOQL so yeah it is shift plus tab if you want to align your code yes mayur we can but if you are having lots of options like media energy and 4-5 more then in that case this in is very easy to use instead of this or operator yes first we will be covering test classes so there also we will be using these SOQLs okay so Vishal is asking if we want to query annual revenue between 1000 to 100 K so you can just apply and so how you can do that it is very simple so I am just closing okay so what you can do here we have annual revenue so you can just apply it like this where annual revenue is greater than equals to so we can just type value directly then and again you can copy it and less than equals to 100 K so this way you can apply the condition okay so moving forward can be with relationship yeah that I will be Rajesh your question will be answered tomorrow then what is the difference between equals to colon and in colon so I think this I already explained equals to when we have two parameters in we use when we have lists set and map yes such an integration we will do after the apex trigger and test classes once this apex piece will be completed then integration will come in the picture yes Shilpa we can apply a null check actually this I already explained last week so I didn't use I just focused on the SOQL part today but if you use loop you can apply null check so here you can apply null check like this if ACC list dot size greater than zero so here you can just write it so this way you can apply null check okay so archana is asking we should use group yeah so this is the syntax for aggregate so you can just use it so whatever result is returning so it will be stored in this aggregate result so you just need to study about this aggregate result so that you can understand so just go through I will figure out some examples and will mention those examples in the exercise sheet so that you can practice otherwise all examples are already explained in the session so you can just practice those once again discuss count distinct yes so basically what I did I just use count first so count what count does count basically counts number of records wherever annual revenue or other field whatever you are using is populated okay now if you use count distinct so it will count unique records if the same value is available in another record so it won't be counting that okay so for example we have five records two records are having annual revenue as thousand two are having annual revenue as two thousand and one is having as three thousand so count distinct will be counting it as three one for one thousand one for two thousand and one for three thousand and if we use count so it will be five yes yes you are right aggregate function only used in group by clauses so I will just have those example actually I have not taken those example I just took this topic so that it can be executed from query editor so for apex class I will be having few examples tomorrow for this aggregation feature no we cannot implement validation rule through SOQL when I this is good question tooling API in query editor this also I just need to figure out because I never used it it is not used frequently so tooling API is a feature but I just need to figure it out so if I get proper answer I will explain it tomorrow okay thank you Sanjith yes Ajay answer this like how we can write aggregation in apex so select count ID comma name from account group by name yeah name basis name it will be grouped by and having count ID less than equals to two so this way you can just write it so I will have few examples tomorrow and we'll explain it in detail right yes recur as synchronous apex will be added in the boot camp okay Jana is asking to explain bind variable one more time so it is very simple what we did we just created a variable here let's say AR so right now here I am using 10,000 so in place of 10,000 what I need to use I just need to write AR like this and if you use variables here so you need to use colon sign because if you write the variable so colon sign should be there so September asking no vacancy for freshers so I would suggest just try for freelancing and focus on that boot camp for cyber security it will help you have a freelancing work okay so that is all I can help it is due to recession so we cannot do we can just prepare and I am helping you in that front so you just need to search for the jobs otherwise just to freelancing whatever you can do so Praveen this this question is very good how we can count related list so this also I will try to cover because I just need to check whether we can apply a count on related objects or not okay so there is one question so someone is asking Aditya is asking I am not able to custom object in object manager I don't find create options so just check whether you are logged in as system admin or not so if you log in as system admin then I think you will be able to see that option so Bindu is asking will the data type for the result of the SQL query will always be list yes whenever we apply SQL so it always returns list so Divya I think if you want to understand for loop so you can just see the last session last week I discussed for loop in detail so if you see that so you will be able to understand it quite well okay so you can find that link here in the session tracker so here is this day number 39 so here you will be able to understand loop properly yes Jhana I will be covering SOSL for cybersecurity if you don't have Salesforce knowledge then also it will work so in Salesforce cybersecurity is one job profile but cybersecurity is associated with other ecosystems as well very good this nested list maybe we will see tomorrow okay so to retrieve data from minmax we need to create list aggregate so this I will explain tomorrow in detail don't think much about aggregation function I will have some examples for you Aditya I don't think this could be the reason if you have this issue so just find someone who can connect online and help you out so you can just ping in telegram group if someone is available to join on a call with you so that way you can take help so SIDA is asking SOQ limitation so that I will be covering in the best practices so we will be having one session on epics best practices where all the limitations we will be covering so one like if you want to see the limitations here directly so we have this log so here here are the some governor limits so these are the limitations that you need to apply so in one transaction you can have you can have only 100 SOQL so you just need to write SOQL properly carefully don't write too much SOQL then how many number of rows we can query so this is the limit so all these limits are available here so you can just go through and whenever logs open so if you go to the bottom then you will find these information so Babu is asking in two weeks you want four years of experience so this is not a good question just first learn then try to think about the experience so it is for six months if you learn for six months then only you will be able to understand things then decide like how much experience you have I don't think you can just write four years it is a lot ok thank you Vishal so Raghav is asking will you explain how to get parent ID from object permission I didn't get your question so Sigharan I didn't understand your question as well can you please elaborate so Raghav CPU time limit exceeded means you have implemented such a complex logic which is taking more time to execute let's say you have implemented lots of nested loops so in that case CPU time limit hit so Raghav I just need to check this whether we can use aggregate functions in parent to child or not so tomorrow I will be showing you more examples on aggregate functions so I am just adding it here also so that I remember yes mayur we can use like keyword as well so this is also not covered today so let me just note it down so that I can cover it tomorrow so in map how will use SOQL queries so we use map in SOQL so how to use map in SOQL that I can explain right now so what I need to do so here let's say if we have a map created if we have a map created map of ID comma count ACC map okay so what you can do so here you can just write ACC map dot key set so this way you can write so all the keys will be available and it will be compared with this ID and if you want to use so that also you can have okay Ganesh is asking can we use visual studio ID for apex programming yes you can so Raghav I didn't get your question properly like data loader so get parent ID for objects to give permission no I didn't get this question properly maybe you can just reach out to LinkedIn or telegram then we can discuss yes Shilpa we can workbench so after apex just remind me so I will be having one session on workbench as well okay so I think I answered all the questions related to today's topic and tomorrow I will be covering whatever is left so we'll be seeing aggregation function again and today I didn't updated the exercise sheet so I will be updating that as well and till the time whatever I explained in the session so just practice that properly okay and whatever we will be discussing is available in the excel sheet and just share this information with everybody so that they can also learn the things and let me see how many responses I get yep now I think people are responding so that is good okay thank you so much for this and I hope I explained everything and thank you so much we'll see you tomorrow yes Shilpa platform events also just remind me after apex completion so that I remember a platform event and workbench both will be covered thank you so much everybody see you tomorrow same time thank you for joining the session