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.  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 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 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


Well, three people were arrested after fleeing the scene of a two vehicle crashed north of Park Rapids Thursday afternoon. It happened at the intersection of County Road 81 in Essex Road and around 3.15 p.m. on November 1st. The driver of one of the vehicles and two passengers fled the scene on foot. Hubbard County deputies, the Hubbard County canine and officers from the Park Rapids Police Department searched the area and alerted houses in the immediate area. Deputies apprehended two of the individuals, 35-year-old Shiloh Williams of Cast Lake and 28-year-old Jamie Chase of Deer River as they came out of the woods on County Road 4. They were both taken into custody for active warrants. The driver, 27-year-old Elizabeth Danielson of Deer River, was located and arrested at the Holiday Gas Station in Park Rapids. She was charged with criminal vehicular operation and leaving the scene of an accident. During the search for the individuals, a deputy stopped a vehicle that was attempting to locate and pick up one of the suspects that that driver was arrested on drug charges.


Family Theater presents Maureen O'Sullivan. From Hollywood, the mutual network in cooperation with Family Theater presents Once on a Golden Afternoon. And now here is your hostess, Maureen O'Sullivan. One of the great joys we as parents have is to see our children growing up in the knowledge and love of God. Yes, and maybe growing up with them is the way to keep young always. But certainly their faith and trust in God is always an inspiration to our own faith. You know, children have a wonderful way of knowing that God is always close to them and that he can and will hear their prayers. So often it happens that we lose much of the happiness of life because we forget the simplicity of childhood. The direct, simple way children have for love and laughter. Yes, and insight into the happiness of children, how we can add to their enjoyment and lightheartedness is a way to recapture the joy of that as adults we often lose. Love of God and daily family prayer in our homes gives lighthearted happiness and peace and harmony because praying together as a family brings God close to all of us. Tonight is a special program, Family Theater presents a story for children, for all children from six to 65. A story that happened Once on a Golden Afternoon. Maureen O'Sullivan will return after tonight's Family Theater story Once on a Golden Afternoon featuring Jean Bates as Alice. There have been through the ages many dedications and inscriptions on the fly leaves of many books, but one that stands out among the time-worn editions of literature reads. To the little girl who has been my inspiration, Alice Pleasance Liddell. I dedicate this book, signed Lewis Carroll. And this was Lewis Carroll's dedication of the absurdly delightful rollicking tale of that lovely child of fantasy, Alice in Wonderland. And so from the myriad pages of literature, from the countless writings of the English language, this unique and fanciful tale emerges and lives, not as a travesty of the times, but as the story of a child for children everywhere in the world. Lewis Carroll was a professor of mathematics at Oxford University. He was a man who authored five of the most scholarly books on mathematical determinants, but all are forgotten. Even his true name, Charles Ludwig Dodgson. For the world remembers only Lewis Carroll, creator of Alice in Wonderland, written on a Golden Afternoon 100 years ago. And so we turn back the clock of time to the year of the inspiration of Alice, Alice in Wonderland. Across the great flagstone quadrangle of Oxford University stands the Great Tower Clock. I was watching it from my window where I confess I was rather absent-minded in lecturing to the class on an algebraic problem. The square of the hypotenuse equals the sum of the squares of the other two sides. Now, if any of you students have any trouble with this theory, I suggest you consult Millen's text. And that concludes the day's session. Thank you. Alice, Alice, how are you on this, this golden afternoon? Well, aren't we on speaking terms? I'm angry. Angry? At whom? At you, Mr. Dodgson. At me, Alice, but won't you tell me why? Well, if I have to tell you why I'm angry, then I can't be angry if I speak to you, can I? No, you can't because when you speak to a person at whom you are angry, then you are no longer angry. But I am. And what is all this about? Well, didn't you forget something? Hmm, now let me see. You promised to take me on a picnic and you forgot the picnic basket. Oh, good heavens, I did forget. Now, you wait here. I'll dash up to my room and get the picnic basket. I'll have it filled up and we'll be rowing down the river in no time. I know just the spot for our picnic. So, that's the story of Fair Rosamund and over there near the old monastery is her burial place. Oh, that's a beautiful story. Tell me another before we land, Mr. Dodgson. Oh, my Alice, I've almost run out of stories. Oh, well, that bridge yonder has a little story. That bridge has been here ever since the time of the Romans. And that's how Oxford got its present name. You see, it was a ford for oxen to pass over and so long before the Christian era was called oxen ford. Oh. Well, here we are. Now, isn't this a perfect place for a picnic? Oh, I love it here. Now, I'll take the picnic basket, Alice, give you the blanket and you can shaper on the landing of the troops. Are you ready? Prima, Secunda and Tersha, forward. Well, now, what is this, Alice? Mutiny, I say forward and you don't move. But you said Prima, Secunda and Tersha. And they aren't here. Oh, well, Prima is the first contingent. Secunda is the second. And Tersha... Which is the third? Correct. Now, let's be off to that shady tree out of the sun. So, an apple for you and we've cleaned the picnic basket. Here you are. Catch. Alice, catch it. Oh, honey, it's rolling down to the river. Oh. It'll take a longer hand than yours to reach it. No. Oh, I'm afraid we've lost it. You see, it's a rabbit hole and it goes down very deep. What does the rabbit do down there? Does he live down there all the time? Oh, but he can't. Why? He has to get air. He comes out and he eats shrubs. Oh, look, there he is over in the bushes. He's a white rabbit. I'm going to catch him. You can't now. He's gone down the hole again. Why did he want to go down that dirty hole? Oh, well, that isn't a dirty hole. It's a rather wonderful place down there. You see, up here the world is sometimes filled with things that are hard and cruel. And people who are sometimes thoughtless and unkind and selfish.  That's right, yes. But down there, oh, there's a wonderland with, um... muck turtles and lorries and griffons. Oh, tell me about it. I'd like to go down there. Well, it... Well, you see, there's quite a story about this wonderland. Please tell it to me. Well, um... Is it about the white rabbit and the muck turtles? Yes. Yes, it is.  And suddenly she found herself dropping down. Down. Down. And while she was falling, she was clutching the things on the way. Such a fall as this. I'll think nothing of tumbling downstairs. I wonder how many miles I've fallen. I must be somewhere near the center of the earth, I'm sure. What's that? Oh, the Duchess. The Duchess. Oh, won't she be savage if I've kept her waiting? If you please, sir. Mr. Rabbit. Oh, my fur and whiskers. Where are my gloves and fan? I'll have to be on my way. On my way. On my way. Dear, dear. How queer everything is down here. I wonder if I've been changed. I feel so different. But if I'm not the same, the next question is... Who in the world am I? Well, if I'm really Alice Liddell, I remember my little poem. Now, let's see. How doth the little crocodile improve his shining tail and pour the waters of the Nile on every golden scale? How tiffly he seems to grin how neatly spread his claws and welcome little fishes in with gentle smiling jaws. I'm sure those are not the right words.  Hello, Mr. Mouse. Where is the cat? What? Oh, I beg your pardon. I quite forgot you wouldn't like cats. We won't talk about that any longer. As if I would talk on such a subject. Our family always hated cats. Nasty, low, vulgar things. Don't let me hear that name again. Mouse dear, do come back and we won't talk about cats anymore. Well, very well. Tell me your history. Why do you hate C-A-T-S? Oh, yes. Mine is a long and sad tale. Certainly is a long tale. But why do you call it sad? Silly girl, what are you talking about? Oh, look, look at all those funny things near the pool. Funny? What is so funny about a dodo, a lorry and a caterpillar? Oh, I know what a caterpillar is. But what is he doing over there? Smoking his pipe. That's a funny thing. He's sitting on top of a mushroom. And why not? Oh, I'm sure I don't know. But he has large lonely eyes. I know he must be very unhappy. Who can tell? Who can tell? I'll go and talk to him. Hello, Master Caterpillar. Who are you? I hardly know, sir. Explain yourself.  I don't see. I'm afraid it's very confusing. It isn't. Maybe not to you. But I'll go away if you don't want to be friendly. Come back. I've something important to say. What, sir? Keep your temper. What? Keep your temper. Is that all you have to say? No, but that's most important. So you think you've changed, do you? I'm afraid I have, sir. I keep growing and shrinking. And I'm not the same size for ten minutes. And I can't remember things. Can't remember what things. I tried to say how doth the busy be. But it came out different. Then recite, you are old, Father William. All right. I'll try. You are old, Father William, the young man said.   Do you think at your age it is right? In my youth, Father William replied to his son, I feared it might injure the brain. But now that I'm perfectly sure I have none, why I do it again and again. You are old, said the youth, as I mentioned before, and have grown most uncommonly fat. Yet you turned a back somersault in at the door. Pray, what is the reason for that? In my youth, said the sage, as he shook his gray locks, I kept all my limbs very supple. By the use of this ointment, one shilling a box, allow me to sell you a couple. You are old, said the youth, and your jaws are too weak for anything tougher than suet. Yet you finish the goose with the bones and the beak. Pray, how do you manage to do it? In my youth, said his father, I took to the law and argued each case with my wife. And the muscular strength which it gave to my jaw has lasted the rest of my life. You are old, said the youth, one would hardly suppose that your eyes were as steady as ever. Yet you balanced an eel on the end of your nose. That made you so awfully clever. I have answered three questions and that is enough, said his father. Don't give yourself airs. Do you think I can listen all day to such stuff? Be off or I'll kick you downstairs. Kick him downstairs? I'm ashamed of you. It is not said right. Not quite right, I'm afraid, sir. It's wrong from beginning to end. That's because I've become so small. You're quite big enough. Oh, but three inches is a wretched height to be. It's a very good height indeed. I am almost three inches. But I'm not used to it. You will be in time.  One side of what? Of the mushroom, of course. You mean you eat it? Of course. Oh, here he comes. Here he comes. I must be away. The ditches, the ditches.  She'll get me executed as sure as ferrets are ferrets. Oh, Mr. Rabbit.  Wait, Mr. Rabbit, where are you going? Don't leave me here alone. Oh, Mr. Rabbit. I must be lost. If I were only home again, I'd love everybody so much more, if only... Oh! If only what? Well, you're back, Mr. Rabbit. See, who is that over there? That's a Chessor cat. The Chessor cat? What is he grinning at? He's mad. Oh. And you're mad, too. We're all mad here. How do you know I'm mad? You must be. He wouldn't be here. Would you tell me, then, which way I ought to go? That depends on where you want to get. I don't much care where. Then it doesn't matter which way you go. Over that way lives the mad hatter. In the opposite way is the March Hare. They're both mad. I've seen hatters before, so why don't we go and visit the March Hare? Well, he's mad, too. But let us go. Look at the Chessor cat. He's vanishing. But he's beginning to vanish at the end of his tale. Yes, and he's now up to his grin. Oh. He's all gone. All except his grin. Goodness, I've often seen a cat without a grin. But a grin without a cat. It's the most curious thing I ever saw in my life. He's mad. Wait till you see the March Hare. He's completely mad. May I go in there, Mr. Rabbit? There's no room in there. But I can see there's plenty of room. I'll just sit down at the table with you and the door mouse and the hatter. Oh, there you are. Oh, hello, Master Caterpillar. Do you know the March Hare? He's mad. Have some milk. I don't see any milk. There isn't any. Well, then it isn't very civil of Mr. Rabbit to offer it. It wasn't very civil of you to sit down without being invited. Your hair wants cutting. Personal remarks are very rude. Then why is a raven like a rating desk? Now we shall have some fun. I love riddles. If you mean you can find out the answer. Exactly so. Then say what you mean. I do. At least I mean what I say. That's the same thing you know. You might as well say I get what I like is the same thing as I like what I get. Or I breathe when I sleep the same thing as I sleep when I breathe. Have you guessed the riddle yet? No, I give up. What's the answer? I haven't the slightest idea. No, I... You're just wasting my time, Mr. Rabbit and Master Caterpillar. Speaking of time, what time is it? It's six o'clock. And it's time to eat. I'm getting very hungry. Have you seen the Mark Turtle yet, Alice? I don't even know what a Mark Turtle is. It's the thing Mark Turtle soup is made from. Are you hungry? I don't think... Then don't talk. It's time to go. I'm sure the Mark Turtle should be somewhere on the seashore. Oh, there he is. Yes, I see him. I wonder if I can talk to him. Sit down, Alice, and don't speak a word. Not a word, but I was going to tell him a story. Nobody's asking you to... Well, sir, I don't see why it's your business if I want to talk to the Mark Turtle. You know, once he was a real turtle. That's very interesting. What's very interesting? When he was little, though he may not believe it, he went to school in the sea. Oh! He was an old turtle. We call him tortoise. Why did you call him tortoise if he wasn't one? You know, you really are very dull. We called him tortoise because he taught us to. Oh, but how many hours a day did you do your lessons? Ten the first day, nine the next, and so on. That was a curious plan. Well, that's why they're called lessons because they lesson from day to day. Oh, look! What is that? The lobster quadril. They're going to dance? Of course. Form July! Beautiful dance. Where are you going, Master Caterpillar? Everybody's mad here. Oh, my whisk isn't fair. The duchess, the duchess. She'll have me executed as sure as carrot to carrot. Why, Mr. Rabbit?  I'd like to see the duchess. She's in a stew.  Well, wait, Mr. Rabbit. I'll go with you. What is she cooking, Mr. Rabbit? Don't ask because I can't tell you. Oh, look at the duchess. I didn't know she looked so big and funny. You don't know much, and that's the fact. Careful, duchess. You'll ball a pot over and we'll all be burned. If anybody minded their own business, the world would go around a deal faster than it does. Which would not be an advantage. Why? Just think what it would do to the day and night. You see, the earth takes 24 hours to turn on its axes. The feeling of axes.   And hot tempered as well. Maybe it's the pepper that makes people hot tempered. I can't tell just now what the moral of that is, but I'll remember it in a bit. Perhaps it hasn't one. Touch, touch. Everything's got a moral if only you can find it. Everything's got a moral. Oh? There it is. Oh, it is love. It is love that makes the world go round. Somebody said that it's done by everybody minding their own business. And the moral of that is, birds of a feather flock together. How fond you are of finding morals in things. Oh, yes. And the moral of that is, be what you would seem to be or more simply said. Never imagine yourself to be otherwise than what it might appear to others that you are or appear to be. That isn't more simple. Careful of what you say.  Oh, dear. My fan and gloves. Oh, dear. I must be going. I'm going. I must... Mr. Robert. Wake up. What? I said, wake up, Alice. Why? Why? What's the matter? White rabbit is so unfriendly. Well, we'll have to give him a good talking to the next time. But you didn't finish the story. No, I couldn't very well in the middle of it. You went fast asleep. Then I must have dreamed about the mouse and the Duchess and the rabbit. Well, no, not exactly. No, I started... I started telling you a story about them and... Oh, I remember. It was a wonderful story. Is that what you were writing, Mr. Dodgson? Well, no, no, I was just writing a little poem about this golden afternoon. Please read it to me. Well, if you promise not to go up to sleep again. I promise. All in the golden afternoon, full leisurely we glide for both our oars with little skill by little arms are plied while little hands make vain pretence, our wanderings to guide. And on to sudden silence one in fancy they pursue the dream child moving through a land of wonders wild and new, in friendly chat with bird or beast and half-believe it's true. Thus grew the tale of wonderland thus slowly one by one its quaint events were hammered out and now the tale is done home we steal a merry crew beneath the setting sun.  Oh, I like that. Are you going to put it in a book, too? A book? Oh, you mean the story I just told you? Oh, yes, because no one will believe me if I told them about all those things I saw in wonderland. All right. By Joe, we will write it in a book. For you and all your little friends we'll call it once on a golden afternoon. Oh, no, I don't like that. I like Alice in Wonderland. Splendid. I like that, too. Yes, yes, we'll call it Alice in Wonderland. By Charles Lutwidge Dodgson.  Oh, then let's see. Yes, in Latin Charles Lutwidge is Carolus Ludivicus and translated back... I have it. Let's settle for Louis Carroll. I like that. Louis Carroll, creative Alice in Wonderland. It seems like a different person. And I won't tell a soul. That's good. Now, it's time we were getting you home. Still she haunts me, phantom-wise Alice moving under skies never seen by waking eyes. Children yet the tale to hear eager eye and willing ear lovingly shall nest all near.  Life, what is it but a dream? And inscribed below that lovely poem was Louis Carroll's last dedication to the little girl who has been my inspiration Alice, Pleasance, Liddell my Alice in Wonderland. You know, sometimes it's good to be able to daydream into a child's world of wonderment where life's most beautiful lessons are learned. Most of us can recall at least one golden afternoon an afternoon away from the world of reality that's often so thoughtless. If the world today needs anything it's first a renewal of faith a renewal of trust in God and in his eternal providence. If only all of us could get back to those simple truths if only all homes would get back to the daily practice of family prayer this indeed would be a better and a happier world a world where there would be true brotherhood of all men in the lasting fatherhood of God. Let us tonight make this simple dedication of our families to God. Let us dedicate a short period every day to the practice of family prayer in our homes for there is a joy and a happiness and daily family prayer and there is this lasting assurance that the family that prays together stays together.  From Hollywood family theater has brought you transcribed once on a golden afternoon. Maureen O'Sullivan was your hostess featured in our cast were Jean Bates Ben Wright Richard Beals Marvin Miller and Howard McNear the script was written for family theater by Jonathan Slott and directed by John T. Kelly with music composed and conducted by Henry Mancini. This series of family theater broadcasts is made possible by the thousands of you who feel the need for this type of program by the mutual network which has responded to this need and by the hundreds of stars have stayed screen and radio who give so unselfishly of their time and talent to appear on our family theater stage. To them and to you our humble thanks. This is Tony Lofrano expressing the wish of family theater that the blessing of God may be upon you and your home and inviting you to join us next week when family theater will present. Jeannie with a light green hair starring Marion and Jim Jordan better known to you as Fibromiggy and Molly. Stephen McNally will be your host. Join us, won't you? Family Theater is broadcast throughout the world and originates in the Hollywood studios of the world's largest network. This is Mutual, the radio network for all America.


The 2016 list features 15 new woman achievers. We congratulate them and salute all the winners. I think it's some kind of a pat on the back and it's a great recognition to be recognized for all the effort and hard work that we've put in through our careers all these years. But I also think it's a very humbling process where it brings you suddenly in the midst of these very well-established well-known leaders and it's a great list to be on because you feel privileged and you feel honored and you feel humbled at the same time.


Warren Buffett is the world's richest and most successful stock market investor. But he doesn't say that he buys stocks. He says he buys businesses. But how does he decide what businesses to buy? How does he decide what principles to follow? Ben or Benjamin Graham wrote the Bible on what has come to be known as value investing and one of its key principles about stock market investing is actually to ignore the stock markets. Okay, that's a bit of an overstatement but broadly it is true what Ben Graham and others who follow value investing tell you that stock prices go up and down, they fluctuate but the intrinsic value of a stock price actually doesn't change that offer. If you don't go by the market price of a stock, how do you calculate its intrinsic value? Well, essentially you work out what is going to be the overall future earnings from a particular business and then you discount it for inflation and bring it down to its present value divided by the total number of shares outstanding and that is the intrinsic or the fair value of a particular stock. These are complicated calculations and there are various ways to arrive at it and two people can come up with very different calculations using the same method. I'm not going to go into all of that because that's not really relevant to this video. If you're interested, you can actually watch a lot of videos on YouTube or even read many books on how to do value investing, how to value a particular stock. For the purposes of this video, all we need to know is that a value investor takes into account a lot of numbers and comes up with what he or she believes is the fair value of a stock. But just because you now know what is the fair intrinsic value of a stock does not mean you're going to buy it. That is where Mr. Market comes in. And Graham used the example of Mr. Market. Just imagine that when you buy a stock that you bought into a business where you have this obliging partner who comes around every day and offers you a price. Mr. Market gives you different prices on different days. And by the way, value investors say that Mr. Market may take years, decades to actually finally arrive at the intrinsic value or the fair value of a stock. But you shouldn't lose patience in the long run. Mr. Market or market prices will catch up with the fair value of a company's business and its stock price. Except unless in the long run something like this happens. In the long run all of us are dead. But wait a minute, aren't markets supposed to always be able to come up with a fair value of things? Identify the true value of things? Yes, economists do accept that there will be fluctuations here and there caused by temporary increases or drops in demand, temporary increases or drops in supply. But overall, within a short period of time, things will come to equilibrium and the fair value will be discovered by the market. If capitalism really works in that wonderful mythical way, then value investing should just not exist. It would be impossible to beat the market. In fact, that is what some very important economists argue. They say that you cannot beat the market because the market is an amalgamation of all the information that you can have about a particular stock at that time. So you can't beat what the market is giving. Prices reflect all available information. Investing that hypothesis turns out to be more difficult, but it's a simple hypothesis and principle. That was Eugene Farmer. He won a million dollars, not a million dollars actually. He won the Nobel Prize in 2013 but gave him a million dollars. He's a very rich economist and what he says is largely true for most people because most people will find it very difficult to make those calculations to put in a lot of time to identify stocks which might outperform the overall average of the market which is captured with the various indices, stock market indices like Nifty, Sensex, Dow Jones, Average and things like that. So he said just bet on these indices and you'll get the average return of the stock market which you really can't beat or only very few people can beat. And as I said, he got a lot of money because of these theories. He won the Nobel Prize and he's a highly paid economist. But he's not Warren Buffett. Warren Buffett who does not believe that Mr. Market has all the information is one of the richest people in the world. He understands that capitalism is inherently chaotic. That statement is actually bigger than it seems because it tells us that markets are inefficient in identifying what a society really needs. It is inefficient in identifying how people should be rewarded for things which are not just about business. And it is ruthless. It leaves people on the wayside who are unable to compete, who don't have the skills to compete. The market system is brutal and it leaves behind people who are perfectly wonderful people who don't have market related talents. That is what Warren Buffett knows about capitalism, that markets don't really work. Mr. Market is inefficient. But no one ever told you that. You were told that free markets are the best allocators of resources. And that is why Warren Buffett is Warren Buffett, one of the richest people in the world. And you are not. That's the show today. Keep watching NewsClick, like this video, share it as well.