 Hello, hi everyone. I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. Sorry for the delay and thank you for waiting. Actually, there were some issues. So session got delayed. So I am available with you and you can see this is day 44, 41 for this bootcamp. So today we are going to discuss about SOQL and SOSL. So first I will be completing the remaining topics of SOQL and then we'll move forward to SOSL, right? So before start like those who joined this session for the first time, this bootcamp for the first time, if you want to know about me, so you can just go through this slide. Everything about me, my professional journey is mentioned here. I hope you are following all the virtual learning best practices doing lots of practice. So for yesterday's session, I provided a few practice questions. So just go through that. And what I planned for this apex part, I will be having one scenario based session so that I think I will be having on Thursday. Okay, so that we can cover lots of scenarios there. And like, I hope everybody now are familiar with this world consistency. I hope you already know this. But through this bootcamp, you are getting a chance to do consistent learning. So please do regular practice so that you can learn things easily. And today's session might be lengthy because I have lots of topics to complete. So I will be completing them. And you can see, like in yesterday's session, I just showed you chat as well because few folks were wanted like what questions people are asking. So if I can share, so I'm just recording that in this stream. So whenever I will be answering those questions, so you will just go through the question and you can listen to answer. Okay, so soon this week 12 will be completing and apex will be done. So long three weeks, it took to complete the apex. And from next week, we'll be starting a big trigger. Okay, so do follow Sanjay Gupta Tech School on all social media platforms and maybe tomorrow I will announce one more bootcamp that is related to cybersecurity. So we are in finalization. So tomorrow maybe you will hear something about that from my side. Okay, so share this channel with everybody. I'm happy like channel is growing day by day and lots of folks are subscribing and learning as well. So yesterday we discussed about SOQL and we were discussing about aggregate functions, right? So I just demoed you all the aggregate functions through query editor. Okay, so through query editor, we were able to see like how they works. So I just collected few more examples for you. Those are some advanced examples like if you so if you use aggregate functions, so you need to keep this in mind where you are applying that SOQL. So if you are applying that SOQL in a query editor, right, so you will receive the result directly. So here you can see few examples are available. So first example says we need to select records from account and I'm just using count without any field. So it will be counting total number of records which are available under account object. Right. So what I'm going to do I'm going to show you this case. Let me just log in. So here we need to implement this SOQL. So I'm just closing few tabs. Okay, so here I'm writing SOQL. So just see it carefully. So we need to write select count from account. So what will happen whatever account records are available. All those account records will be counted. So here you can see total number of records are 46. Okay, now if I provide particular field, let's say rating. If I fill rating here, so basis on rating field will be down. Sorry, records will be counted. So here you can see total 24 records are there where rating is populated. Okay, so this way if you provide any field, so basis on that records will be counted. If you don't provide any field, so total number of records will be counted. Okay, so here you can see a second example says like if you want to count, so it will be done. And if we use count distinct, so I'm just explaining that again. So if I use count distinct, so only three records are there. So distinct means like rating is a pick list. So that pick list is having three values, warm, hot and cold. Right. So these three are counted as distinct values and they are repeatedly using in different records. So if you use count distinct, so all unique values will be counted and they will be available here. Okay, so next, if you want to like group your record, so how we can do those grouping. So you can see the third example. In third example, we are applying SOQL on opportunity. Right. In third example, we are applying SOQL on opportunity. So what we are doing, we are querying amount and amount some will be calculated account name will be received. So this is like child to parent SOQL. So today we are going to discuss about child to parent in detail as well. So here you can see account name will be queried and group by we are doing basis on account name. So what will happen if more than one opportunities are related to one account. So those opportunities some will be grouped. Okay, so basis on the account opportunities amount will be summed up. Right. So I'm going to apply this SOQL here. So select then some of amount. Then here I need to write account dot name then from opportunity. Right. Now later. So what we need to do we need to apply group by account dot name. So here I'm writing group by then account dot name. So if I run this SOQL, so let's see the results. So here you can see the results. All the account names are queried and few accounts are not having any sum because they are not having any related opportunity. Wherever there is related opportunity. So all those opportunities amount is summed up and that is available here as a total. Right. So this way you can just apply aggregate functions on particular object and you can apply group by so that you can just have summary of particular data. And if you want to apply some conditions here, so if you see this example, so here we have added having as well. Right. So having means the sum of amount is greater if it is greater than equals to 50 K. So here we have lots of records which are greater than 50 K. So total number of rows are 22. 22 records are queried. If I apply having some of amount greater than equals to 50 K. So right now total 22 records are there. If I click on execute, so you will see less number of records. So right now total eight records are there where opportunities some is more than 50 K. So this way you can apply having close as well. Okay. So I'm just going to explain it once again. So what we did. Okay. Let's come here. So this third query is basically expanded in fourth one. So I'm just explaining fourth one so that you can understand everything. So we are selecting amount amount is actually a field on opportunity. We want to sum those amount and we are querying account name as well. Those are populated on opportunity and we are grouping grouping basis on the name. So what will happen if one account is having lots of opportunities. So all those related opportunities some will sorry amount will be summed up and that will be available as a total in front of account name. Okay. And here we are having a clause like if some of amount is greater than equals to 50 K then only those records will be filtered. Right. So this way it is working. Right now if you implement your aggregate query in a big class then how it will work. So yesterday someone posted this in the chat. So I was not planned this year in yesterday's session. So today I have a couple of examples that I'm going to explain you. I will be executing them as well. So if you want to have your aggregate SOQL in apex class. So how you will be writing that. So in that case that SOQL will be returning you the result in form of aggregate result. So this aggregate result is basically a list. Right. And group the results is basically a variable name that we are using here. So in this variable all the data will be available. So what we are trying to do we are trying to select account ID sum of amount from opportunity. And we are going to group by basis on account ID. Right. So on opportunity record we have account ID populated in the account name field. So basis on that it will be grouped. And for checking whether we are receiving some data or not we are using this grouped result in system dot debug. So first I will show you the result of this. Then we have applied a loop here. So let me just show it in the apex. So I'm just putting here. So what I can do here I'm going to implement it. So here I'm pasting this code. Okay. So let me create a separate method. So I'm going to show you aggregate demo. So this way I just pasted it here. Okay. So this is our SOQL which is aggregate which is using an aggregate function. That is some it is applied on opportunity. Now the result will be available here. And it is showing some error. Okay. Let me just see why it is breaking. Okay. Let me just check it here. So I'm just executing it through anonymous window. Let me check because I tested it on anonymous window. It was working. So here I am just using account ID. Okay. So first of all what I'm going to do I'm selecting these statements and I'm clicking on execute. Sorry. I'm just clicking on execute highlighted. Okay. Here also it is not working. Something is wrong. I think I just copied it from somewhere. So that's why let me just undo it. Okay. I'm just copying it from here and pasting it. So actually I copied it from notepad. So sometimes if you copy your code from notepad. So it actually didn't copy properly. So I think now it will save. Yeah. So when I copied some spatial character added somewhere in the code. So that's why it was breaking. Right. So you can see code is same. So here we have this query. So I'm just shifting it above. Okay. So just forget what I did in last two, three minutes. So just focus on this. So here we have this SOQL right in this SOQL what we are doing. We are querying account name and some of amount from opportunity and we are grouping basis on the account name. Right. Result will be available in this group results that we are going to show. Right. And that result will be containing like two different datas. So first time going to show you the result like how it will look like. So I'm going to execute this code first. So I'm going to run it. So I'm going to call it here. SOQL demo dot aggregate demo execute highlighted. Okay. It is saying invalid. Okay. Here it should be. Okay. Now it is executing and here you will see the result. So just focus on this result. So basically what is happening? It is receiving two things. One is name account name and second is some. So here this account is having no opportunity related. That's why that some is null and some is representing through expression zero. Right. So if I go right. So here somewhere you will see the data. So here you can see for this one name is available as well as some of amount is also available. That is expression of zero. Okay. So now if you want to get the data so it is kind of map. So it is kind of map like this is the key and this is the value then this is the key and this is the value. Right. So what we did in our code if I take you to the code. So here you can see we are iterating here. So this this is a spatial list which is having data in a map format. So what we are doing we are getting name and we are getting EXP are zero value. So get basically we use to get the value associated with particular key. Right. So this way if you use aggregate SOQL in apex class. So the data will be available in form of a list and you can iterate on that list and through this way you can just get the data. So basically aggregate result itself is a data type. Right. So I hope you understood this. Now I have one more example. So maybe later on through this recording you can also practice this. So right now I have one more example. So here what I did for this sum of amount like in previous example what we were using we were using EXP are zero. Now if you want to use some specific name for this purpose so what you can do you can write some of amount and then some name you can add here. That is AMT. So the sum will be represented with this AMT like identifier and that you can use here to get the value. Okay. So this way like you can use it. So here you can write and here you can write AMT. Okay. If I run this code again. So you won't be seeing that EXP are zero. You will see AMT in place of that. So if I show you debug results so you can see name is account name and then AMT we are not having EXP are zero. So this way you can replace that text if you want. Right. So if you if you do practice of this so surely you will be able to understand. So we are just iterating and we are getting name and amount. So whatever fields you will be using basis on that you can just apply those fields in the get method. Right. Now someone asked me like how we can use like. So like is also useful in SOQL that you need to understand. So suppose you want to search some text in particular field and you don't know exact text exact string. So here you can see the example what we are trying to do. We are trying to query account records where name is like s percent. So it means what will happen the account records where name starts with s and after s whatever text is available in that name. So all those names will be queried but the name should start with s alphabet. Right. And only that name will be queried. Okay. So this way you can apply like and here is one more example like string s is having test then we are concatenating percent before s and after s. So what will happen if you use this. So now this s is a variable. So yesterday I told you if you use variable we need to use colon sign. Okay. So if you use s here so it is a variable. So you will be writing colon sign here and what will happen in particular account record name wherever test is available in the name in between anywhere. So those account records will be queried because we are using percent in the beginning in the end as well. Right. So in account name wherever name is containing test text. Right. So only those account records will be queried. Okay. So I'm leaving these examples up to you. So you can just try these examples and you can execute and see the results. So these are straightforward. You just need to write it in query editor and results will be available. But the second one you you can implement on anonymous window. Right. And if you write this in anonymous window so data will be available in a CC list. So what you will do you will write system dot debug and that a CC list data will be available in the logs. Okay. So I hope this way you understood how we can use like in SOQL. Okay. Now next is how we can use SOQL in for loop. So this is also interesting and very easy. So here you can see this is the example. So generally we implement for loop and we apply we apply some collection. Right. So we can just apply SOQL query as well. Okay. So you can just write SOQL in square bracket after the colon sign. So whatever data will be returned through this SOQL one by one that will be available into this variable. Okay. And another way is this second one. So here what will happen whatever SOQL you apply so the data will be available in form of list. So for example if you are querying some data and total one thousand records are returned. So in the above case what will happen those one thousand records will be processed one by one with this loop. I'm repeating those one thousand records will be processed one by one through this loop because here we are using just a variable but in the below example we are using variable list. So what will happen if you query one thousand records. So it will process 200 records at a time. Right. So records will be processed in a batches. Right. So implementation will be complex here but in above case implementation will be easy but if we talk about execution so it will be faster. Second one. So here is the difference that you can understand. Both variable and variable list must be of same type as the S object that are returned by the SOQL query. So if you are applying your SOQL query on account or contact or opportunity or case or any other object. So your variable or variable list should be of same data type. Okay. So I hope this you can relate because the object which we are using in SOQL query so the variable and variable list should be of same data type. And if you go through the second point it says SOQL for loops can process records one at a time using a single S object variable. This I already explained you and or in batches of 200 S objects at a time using S object list. So if you use the second syntax in that case 200 records will be processed together. Right. So generally we prefer the first thing if I go back so we generally prefer the first thing and if you have large amount of data so you can go with the second loop as well. Okay. So these are the examples how you will be writing it. So just go through here in the first example you can see account ACC. So this ACC is a variable and after colon sign I am just using this SOQL. So basis on this SOQL whatever data will be returned that will be processed one by one through this ACC variable. Okay. And one more thing here you don't need to apply null check as well. If this SOQL is returning nothing so loop won't be processing. So you don't need to worry about the null check. And in second case you can see here we are using list of account. So whatever data you are querying from here so 200 records will be available in this list and that will be processed once 200 records are processed then next 200 records batch will be processed. So Sachin is asking as per best practice we don't we cannot write or we should not write like SOQL inside the loop. So for clarification this is inline SOQL. We are not writing SOQL inside the loop. So this SOQL will run once and it will query all the data and then that data will be processed one by one. So query won't be executing more than one time query will be executing one time. So this is as per best practice. So again I'm saying we are not writing query inside the loop. We are writing query in the first line of the loop. So query will run only once and rest of the code will be repeating again and again. So if you want a proof I can show you that. Okay. So what I'm going to do. Okay. So here I'm going to comment this out. I am removing this removing this and here I was using ACC list. So in place of ACC list what I'm going to do I'm just copying and pasting this SOQL here. Okay. So I just pasted that SOQL here. So it is in the first line not inside the loop. So this is as per best practice. So I'm just commenting this commenting this. So this is our example which we are discussing. So once this loop will be executed. So SOQL count will be one only. So I'm going to show you this by executing this method. It is query demo. So I'm just going to call it execute highlighted. So we'll see the governor limits. I'm going to show you the governor limits here. So here you can see number of SOQL query is three. If I go above. So here we have the select count name it executed. Then this one executed to and one more SOQL should be there. Here it is. So you can see it is executing once. So in this transaction total three SOQLs are available. One is this which we used with the loop. Second is available below. It is different SOQL and this is different SOQL. That's why total number of SOQL query is three. Okay. So I hope this way you get the answer of the question. Like if we write query in the first line of the loop. So it means we are not writing this SOQL inside the loop. We are writing it as an inline SOQL for loop. So this is in the first line. Loop starts from here. Loop is actually starting from this curly base. So if you write any SOQL inside this curly base, then that will be an error. Okay. And if you want to have that example as well, so I can give you. So if I implement a loop for integer i equals to one i less than equals to 150 i plus plus. So what I'm going to do. I'm going to write one SOQL inside this loop. So I'm creating. Let's say I'm getting account record only account ACC equals to select ID from account limit one. I'm just fetching only one account and I'm going to debug it. Right. If I run this code so it will execute 150 times. Right. And your code will break. So I'm going to execute this. So I just clicked on execute highlighted and here you can see the error message limit exception. And it is showing too many SOQL queries 101. So limit is 100. The moment you cross that 100 limit, you will encounter an error. Okay. So I hope this way you understood how governor limits are have are implemented in Salesforce. If you don't respect governor limits, your code will break. So that's why if you write SOQL this way inside loop, this is wrong. This is not suggested. Right. This is wrong way to write code. Okay. We don't write SOQL inside the loop. Right. But if you write it like this way, your code won't break. Okay. Because this SOQL is executing once and whatever data we are querying that will be processed one by one through this variable. Okay. So I hope this makes sense and you understood lots of things and also one thing you need to remember, like through SOQL, we can query 50,000 records. This is the limit. If you want to go beyond this limit, you can use batch epics. So limit for SOQL rows is 50,000. Okay. And other limits I will be discussing tomorrow when we'll be discussing about DML statements and SO, SO SL limit is 20. So in one transaction, you can have maximum 20 S O S L. Right. So these, these are very much important. If you talk about interviews in interviews, interviewer generally ask about the governor limit. So you should remember all the governor limits handy, right? Because these are important. Okay. Now moving forward, and this is very, very, very important topic of SOQL and lots of developers fresher gets confused in understanding relationship queries. Right. So I will try to explain it in detail so that you will be able to understand how relationship queries works. Right. So what I'm going to do, I'm going to explain these queries with an example. So I just divided them in two parts. So first we'll be discussing about how we can query parent to child records. So query, we will be applying on the parent record. But along with parent, we will be querying the child records as well. Okay. Along with parent, we will be querying the child records as well. So this is very much important and you need to understand and whatever questions you will be having just post that those questions in the chat. So after explanation, I will take, I will take all the questions. Right. So we have two types of relationship field one standard and one is custom. So we need to understand the difference carefully. So if you talk about standard relationship field, so it means that relationship field is provided by Salesforce. You have not created that relationship field. Okay. So if you have not created any relationship field, so that will be known as standard relationship field. Okay. So right now I'm taking example of account and contact. So account is on parent side. Contact is on child side. I hope everybody knows like relationship field means lookup or master detail. So lookup or master detail always are available on child object. If you want to search your lookup or master detail field, so you just need to go to the child object. Right. On child object, you will find like if lookup or master detail is available, then you can apply parent to child as so cool. Okay. So here you can see we are having select then ID comma name. So these two fields are related to account. Then after comma we have parenthesis and inside parenthesis. I have one more select. So ID first name last name from contacts. So noted here it is contacts not contact. Right. So it is something different that I'm going to explain you. And after that we are writing from account limit five. So main as so cool. We are applying on account. And this is inner as so cool. This is inner as so cool. So what will happen? We are querying account, but account will be queried along with the related contacts. Account will be queried with the related contacts that I am going to show you. So first of all, I'm going to run it through query editor. So this is my SOQL that is written here. So I'm just selecting ID name then select ID first name last name from contacts and from account. Okay. If I click on execute, so you will see the results. So here you can see in the first column ID is available. This is account ID. Then name is available. This is account name. So you can see the sequence as well ID we queried then we queried name and then we queried contacts. So here you can see label is contacts and it is having ID name and last name. If particular account is having more than one contact. So here you can see this one is having for ID first name last name, then one more ID first name and last name. So this way multiple records will also be there. Okay. Now you might be thinking what this context is via contacts instead of contact. Right. So this is basically child relationship name. Whenever you apply parent to child SOQL, so you just need to check what lookup or master detail field you have. So if I take you here under setup, so we need to jump to contact object. So I am searching for contact on contact. You will find lookup or master details. So here we have lookup. So first field is lookup to account. I'm just opening it and here you will find that child relationship name. Here it is child relationship name that is contacts that I'm using here. Okay. So if you see this help text just read it. It says this field defines a relationship between this object type and a parent object type. Right. The child relationship child relationship name is used in SOQL queries on the parent object type to refer to this object type. For example, contact has a lookup field for account. The child relationship name for the lookup field on contact is contacts. Therefore, you would use contacts in account queries to refer to contact records whose account field references a given account. Accepting the default value is safe. If necessary, the name can be changed later. Right. So this you need to understand. Right. So Ashok, I will be explaining how we can separate out context. So I will be implementing the whole code in front of you so that you can understand. So first understand whenever we apply parent to child SOQL. So in place of child object API name, we use child relationship name and from where you can find child relationship name. So it is available under the lookup field and lookup field is available under your child object. Okay. So if I take you to developer console. So here you can see that's why we are using this contacts. Okay. Now if I go and implement it with the help of class. So I'm just closing these and here I'm going to implement it. So I'm implementing one more method. So it is parent to child demo and here I'm going to receive the results. So I'm creating list of account ACC list equals to new list of account. Now ACC list equals to then I can write select ID name then select ID first name last name from contacts then from account. Right. We are waiting equals to hot. So this way data will be available into this ACC list. Now if I want to show the data. So what I can write account ACC colon ACC list. So I'm iterating on account. Right. Now I just want to show the name of account. So I can write ACC dot name. Okay. Now if you want to process the related contacts. So I already told you there may be chances like one account is having more than one related contacts. So in that case you will be implementing loops here. So contact con and then you need to write ACC dot contacts. So this is very important to understand whenever you apply parent to child SOQL. So this SOQL result will be available into this child relationship name. So this child relationship name will work as a field. So here if I write ACC dot contacts. So it means the account which I am processing that account all the related contacts will be available into this contacts variable. Right. So this system dot debug will display one account name and that account contacts will be processed through this loop. Now here I can write system dot debug. So I'm writing is sorry con dot first name and con dot last name. Right. So this way I concatenated first name and last name. So through this loop individual contacts will be displayed. Right. So this way this method is implemented. Now I'm going to execute it so that you can see the results. So I am going to run this. So here you can see the results carefully. See the results carefully. So first of all we are having account name. Then we have one contact. Then we have account which is having no contact same account but no contact. No it is having contact but it is having first name as null but last name is having some value. Then account then account then this account is having two contacts. So both are available just after the account. Right. So this way you can see the results are available wherever we have lots of accounts. So like this is account and here we have three contacts. So they are listed together here also three contacts. So this way you can process the data. Okay. So if you apply parent to child s oql. So I think this way you can process the data and this is child relationship name that is very much important. Right. Now I'm jumping to parent to child on custom relationship field. So for example if you have created lookup or master detail field in that case how you will be writing that child relationship name. So if you remember our project so in our project we have two objects one is position and one is job application. So job application object is having lookup to position. Let me show you if I search for job application. So under job application you will find a lookup to position here it is. Right. So here we have this lookup to position I'm opening it. Here you can see the details. Right. And here we have this child relationship name. Here is the child relationship name. Right. So I just need to use it. Okay. So I'm going to modify this query and I'm pasting it here. Right. So here I need to write position underscore underscore C. Okay. Let's see what happens. It will give you an error. It will give you an error. Right. So we need to understand this error now. So if I scroll this error. So here you can see a note is written. Didn't understand relationship job applications. Right. Didn't understand relationship job application. So let me just shift myself so that you can just read it properly. Okay. So I'm reading it again. So didn't understand relationship job applications in from part of query call further. It says if you are attempting to use a custom relationship. Be sure to append the underscore underscore are after the custom relationship name. This is important. Right. So what we need to do we need to write underscore underscore are here. We need to write underscore underscore are here with the child relationship name. Okay. So if you write it like this then only your query will work. So if I click on execute now it will run. Right. No issues will be there. It will run properly. And if I show you all the data so here you can see. We have ID. We have name. So ID and name are for position. This ID and name is for position. And here you can see we have the data for related job applications. So if one job application is there then ID and name will be there if more than one is there. So those are processed like this. Multiple are there. Okay. So I hope this way you understood how we can apply parent to child suql on custom relationship field. Right. So one more thing you need to understand. I'm talking about custom relationship field or standard relationship field not object. Object can be anything. It can be standard. It can be custom. Right. So you can have custom relationship field like custom lookup or master detail on standard relationship field lookup or master detail on standard objects as well. Then also you need to write underscore underscore are because your custom because your field is custom relationship field is custom. That's why. Okay. So that way you can also try but generally we create custom field on custom objects. So in that case anyhow you need to use this underscore underscore R. Okay. So I hope this way you understood this and if you implement it in apex so it is very simple. So I'm just copying and pasting it. So parent to child custom demo and here we need to use position underscore underscore C then position list. Now here I'm just copying it pasting it name ID here name then I'm just removing this last name. And it should be job application. So I'm just copying it and pasting it here then from position and I'm just removing where close so that I can receive all the position then here also I just need to paste this position POS POS list. Then here we can write position name POS dot name then here we need to write job application underscore underscore C. So this is basically custom field. Sorry. This is basically custom object. That's why I'm using underscore underscore C. This is child relationship name. That's why we are using underscore underscore R. And here also you need to paste it. Sorry. Yeah. Right. So we will be writing POS dot job applications underscore underscore R. And here I can write J A dot name. So this way you can implement the code. So you just need to take care about this child relationship name. Rest of the things are same. Right. So now I'm going to run this. So I'm pasting it here. I am executing highlighted and logs are opening and I'm just checking debug. So here you can see the results. Position name. Then position name and it is having two job application. Then few positions are not having any job application. Few are having one. So this way data is available. Okay. And we will be doing some apex scenarios as well. There I will try to explain these things in detail. So right now I'm just explaining how we can apply these SQLs and this brief loop. If you want to understand it more clearly. So we will be having some scenario based examples. Then we'll be implementing these parent to child. Okay. Now moving forward next is child to parent relationship query. So it is very easy. So here you will be applying your SQL on child object. And if you want to fetch parent information so you will be applying field like this account dot name. And here you will be writing position underscore underscore R dot name. So if you are using custom then underscore underscore R you need to use if it is standard then you can use it directly. Okay. So this I'm leaving on you. So just write this SQL and query editor and you will see the data. And similarly this custom one. Right. You will see the data. Right. So I think I covered everything. Now this SOSL is very simple and we rarely use SOSL in real time projects. We generally use SOQL. So in my professional journey I never used SOSL in any of the project. Right. But there are some projects where you will be using SOSL as well because in SOSL if we understand it so you can apply it on multiple objects. So SOSL you can apply on one object at a time but if you want to apply query on more than one objects on different fields so you can just apply SOSL. So it is basically used to perform text search and records. So you can use SOSL to search fields across multiple object records and use SOSL to retrieve records from a single object whereas use SOSL to search fields across multiple objects. Right. So this is the requirement basically that if you have that requirement you can go through and this is the syntax. You need to write find then search query then in search group then returning objects and fields. Right. So let's understand this syntax one by one. So search query you can write single word or phrase. If you have multiple words you need to enclose them in double quotes. If it is single word you can enclose it in single quotes. So it is about the search query then we will discuss about the search group. So group means actually it is optional by default it is all fields like your data will be searched in all fields but if you want all name email phone or site bar fields. So accordingly you can just provide this then we have objects and fields. So it is also optional. It is the information to return in the search result a list of one or more as object and within each as object list of one or more fields with optional values to filter against. So you can have one object more than one objects one field more than one fields for particular object. Right. If not specified the search result contains the idea of all objects found. Okay. So these are the examples. So you can just go through the below one which you can write in query editor you need to find. So if you write this query in query editor. So instead of using single quotes you need to use curly braces. This is also a difference. So we need to find cloud in all fields returning account name contact first name last name email. Right. So wherever under account and contact in any of the field cloud word is available. So those account along with name those contacts along with first name last name and email will be queried. So this way you can apply SOS and if you write it in your apex class so this you can store in a variable and this is basically list of list of S object nested list. Right. So this will be having account list this will be having contact list. So two lists will be available there. Okay. So just practice these and if you will be having doubts so maybe in tomorrow's session first I will be explaining these SOS like implementing in developer console and we'll show you. So right now I leave these up to you like how you will be understanding it. So this is it for today's session. So if you face any difficulty so let me know in telegram group like if you want to cover any particular topic. So tomorrow and day after tomorrow also we will be discussing about this SOQL or we will be having DMLs as well. So tomorrow I will be completing DML and day after tomorrow I will be completing this like SOQL scenarios. Right. I think this query data part basically didn't showed properly so let me just shift myself above and let me show you it again so that it will be recorded properly and those who will be practicing through this slide they will be able to understand. So like the below query which is available in the slide so it is having context then first name, last name and email so just focus on the complete syntax so that whenever you will be implementing so you don't miss anything. Okay so this is all about the session and if you have questions you want to ask some questions so you can wait otherwise you can leave and I will provide some practice questions tomorrow. So right now you can just go through the recording whatever I explained just try and implement those in your system so that you can understand them properly. Okay. So now I am just moving to the questions so that I can answer them. So I can see lots of questions are there. So Lakshay is asking we visual force page and epics last we are already covering visual force I will be including. Yeah. Then okay let me just shift it. Okay so next is yeah asset cybersecurity is used in Salesforce so we will give you all the insight related to that so no need to worry. Yes Sachin so you are asking does it mean wherever rating is filled only those records will be counting so your question is related to aggregate query and if we use rating inside count so all the records will be counted where rating is populated so Jenna actually that data type fixed data type is fixed so you can use just that data type only you cannot change it because because it is not object specific it is containing aggregate result as well so I think these loop related question like why I wrote that SQL in the first line of the loop I already answered it is not wrong if you write inside the curly basis then it is wrong let me just refresh so Praveen for your question it is not lookup or master detail it is basically spatial relationship which is having some feature from lookup and some from master detail yes winner we can use where clause for inner query like if you write your query in a loop so you can just write where clause as well so Sachin is asking what is the limit to execute system dot debug inside for loop you can write any number of system dot debug and it will repeat the times your loop is repeating can we fetch ACC dot context dot first name no it is incorrect because context can have multiple contacts so it will be difficult to identify which contact name we are getting no if you are using curly basis you don't need to use single quotes speaker no I don't have enough time to help so you can just ask this helping telegram group if someone is free maybe they can help you out so image Khan you are asking as a girl query returns records on the list yes it doesn't read returns records in form of set or map only list yes actually I will be having one session on real-time scenarios so maybe tomorrow not tomorrow day after tomorrow so we'll be having some real-time scenarios through that we'll be implementing some apex codes yes on a single transaction you can use 20 s o s l yes when a inner query means on child query when we use parent to child right you are right so that child one will be known as inner query and if you use your s oql in for loop so it is basically known as inline s oql ok province so I take your suggestion but I think there is no need to draw anything whatever I am explaining it is just you need to understand that I cannot draw something that's why I am not using that but I will try if I will be able to as soon as no we cannot fetch two master objects through s oql it is always parent to child or child to parent yes puja I will share apex trigger related scenarios in the telegram group so next week we are starting apex trigger so then I will be sharing those scenarios with you so shriveli maybe this s o s l we can discuss more tomorrow so just do practice whatever I explained today go through the recording and implement all the examples yourself and tomorrow maybe we can do more practice on this yes these all the sessions are recorded and they are available for you so right now it is available for lifetime so you can access anytime no worries so whenever you have any interview so you can just revise particular topic through the session and on daily basis if you want to practice so you can just go through okay so I think everybody understood whatever I explained and please practice because s oql is very much important so yesterday whatever I explained today whatever I explained just implement it in developer console and only you will be able to understand don't just watch the recording do practice as well and soon I will share some scenarios as well so tomorrow we will be discussing about dml and day after tomorrow we will do lots of hands-on okay so this way I hope your s oql and dml will be strengthened okay thank you everybody for attending this session and share the information with everybody and by the end of this week like you will be hearing about cybersecurity bootcamp as well it will be for five to six weeks long so do join if you are interested if not if your friends anybody junior senior colleague students relatives anybody who are associated with cybersecurity so please share the word so that they can be benefited okay thank you so much for joining today's session see you tomorrow on the same time