Dear students, today we are in the lecture number 31 of the database management system course. The course code is CS403. In the previous lecture, we were discussing the different forms of select statement. And mainly the main thing was that we were accessing the data from the same table. And at the end of the previous lecture, we entered into that part of the SQL where we can access data from multiple tables. And that is important. Why? Because I told you most of the time you will not find your required data in the same table. Rather due to the design reasons, to the design purpose, we have divided the data into different tables to include to produce efficiency in our design. So the user requirements, most of the time they cannot be fulfilled from the data of the same table. So it means most of the time you have to access data from multiple tables. And to access data from multiple tables, we have got different forms of joints. We have started access from the multiple tables by studying the Cartesian product. We discussed it in the previous lecture. Today we see what are the different forms of joints and how do we perform them and in what situation we select a particular form of joint. So let us start today's lecture. Inner join. Well this is something that we did not discuss too much in detail when we were studying the relational algebra. We studied there the equi-joint and the natural joint. Well inner join is a form of equi-joint. So you can consider inner join as a SQL format of the equi-joint. Well you saw in the Cartesian product that each row of one table is merged with each row of the other table. And we discussed it even in the discussion of relational algebra that in real life situation you won't find it very useful. This is not very frequent that we take the Cartesian product rather the logic is that if we combine those rows of two tables that have something in common and when we have something in common and we merge those rows then definitely there is some logic behind why we are combining these two rows. We will discuss in detail later. In inner join only those rows from both tables are merged that have same value for the common attribute. That is a equi-joint method implemented by different methods. We will see what different methods are. Common attributes need not to have same name but they must have same domain applied generally between tables having a referential integrity between them. The tables between which we have defined we have implemented the referential integrity constraint through the form key definition normally rather most of the time we apply the inner join on such tables. But this is not compulsory that is not necessary because you can apply the inner join on the tables that do not have the referential integrity constraint between them. But I am showing you this diagram once again. We have already seen it why I am showing you this diagram now. The reason is that I will try to explain the logic of applying different form of join between different tables for example if you see here. As I told you that we apply different types of joins when the tables have got a referential integrity constraint between them and generally we apply the referential integrity constraint between two entry types that have one to many relationship. In this diagram you see we have a one to many relationship between program and student. In the real life terminology we say that one student is enrolled only in one program and many students are enrolled in one program. So when we store the data about the students we store data about the students different attributes of the students plus representation of this relationship how is that implemented? This is implemented by including the primary key of the program that is program name into the student as the foreign key or we also define the referential integrity constraint so that only legal values are entered into the foreign key. Now the thing is what is the logic of joining different roles from program and student? Definitely we know the relationship between the program and the student that students are enrolled in a particular program. Now the thing is that if we access the student's data we want the enrolled program to have the data. Now obviously against one student we need to access the same program that the student is enrolled in. For example if a student is enrolled in MCS then there is no logic if we along with the data of this student we also see the data of the BCS program, the BIT program or the MBA program. So the real world with the logic is that you match those things, you merge them so that there is a link between them and in the terminology of the database or relational database or relational data model how is the link established based on the values of the primary foreign keys? So now when we talk about the inner join and the other form of join it is that the common attribute is between the two roles, it should be there because the join will be there only when you have got a common attribute between the two tables. Now the common attribute of the two tables is the value, it is linking the two tables and the referential integrity constraint is controlling the validity of the two tables. So these two tables will only meet the same roles in which the value of the common attribute is the same. Now if you see there is another beauty that if you see the primary key, the primary key in the table, see the reference in the reference of the foreign key table, so what will happen is that the primary key of the table can get a row of the foreign key side for a long time. But if you look at it from the foreign key side, because the foreign key is the primary key in the home relation, it cannot be that you get more than one row in which the primary key is the value. So if you look at it from many sides, like the foreign key, the row of the primary key side will get only one row. So you see that you will get that row in which the primary key is the common value. So the logic is that the link is related and how is the relationship going to be based on the value of that common attribute. Same is the case in our example database between the program and the course. What is going on there? What is going on there is that there are a lot of courses in your program and one course relates to another program. Now if you look at the Cartesian product between the program and the course, like we had seen in the examples, then every day of the program table, every day of the course, there is the logic in general. But the logic of this is that in this program, for example, BIT, which courses are included in the BIT program? So the record representing the BIT program, it should be merged with the BIT program in which the courses are included in the BIT program. So this is the logic, right? So it is obvious that from the system point of view, from the real system point of view, you will say that we will mix BIT with those courses which are BIT courses. And if we try to convey the same thing in the terminology of the database, then we will say that we will merge those rows in which the value of the common attribute is the same. Similarly, if you look at our example, we said that our course offered, which basically was our relationship, but we expressed it as an associative entity type, as a gerund. Now between this, your course offered and your student. The relationship between these is man to man. Now to implement that relationship, we made another relationship. When we transformed it into a relationship model, then we have an enrol relation. Now again, if we look at the enrol, if we look at the course offered and the student reference, then there is a man to man. But if we look at the reference of the enrol, then the enrol will be on the student's side as well. Similarly, if you look at the course offered, then it will be man to man from there. So again, how this will be done? Your one student will be linked with many instances of enrol. Because many of your enrolments of one student. There are many enrol courses, of course. So all of them will be recorded. And how this will be done? Based on the primary key of the student table. And all of your enrol records, in which this will exist, will merge with each other. Same is the case with the course offered. Even there, the primary key of the course offered is one to many linked with the enrol. So the primary key and the same value of the forum will merge with each other. So the purpose of all these explanations is to understand what is the logic of the join. And you try to understand this logic from the perspective of both the words. The real world in which we are implementing and the database world in which we are working right now. So in terms of real world terminology, we say that the things that are related to each other, which have a logic connection, they are linked to each other. Like I said, program, course. Student, program. Enrol, student. Enrol, course offered. And if we describe this in the database terminology, then we will say that the common attribute which has the same value on the places, will merge with each other. Not like a Cartesian product, but with each other. So this is a basic logic behind the join. And the different forms of joins have the same logic applied, but with some variations. We will discuss those variations, but it is necessary that you should understand the basic logic of the join. So some examples are also included in our slides. And when you get lecture notes, there will be different examples like exercises. The more you practice, the more clear you will be. And without practice, you will not be clear. Let us go ahead. For example, if you look at the screen right now, you have got two tables here. One table is the program table, where you have different programs that are being offered in the institute. There are five rows. And on the other side, we have the course table, where all the courses are listed. Again, the reason I have shown you these tables is that I want to explain to you what is the logic behind the merging of the rows. For example, if you look, we have the first row in the course, which is CS105 Intro to Programming, four credits, and the second row is B6 Programming. On the other side, the first row in the program is BBA, 8 and 130. Now if you look, if we merge these two rows, what is happening is that on one side, the row that is coming from the course represents some data about a particular course. And on the other side, what is coming from the program is saying something about a particular program. But the course is BCS. The program that is coming in detail, whether it is 8 semesters or 130 credits, 130 credits are from BBA. Now think about the logic behind it. If you merge a BCS course with BBA and look at the data, in general terms, there is no logic. So, it will not join with the reference of the join. The same is the case, if you merge this first row with BIT, with MBA or MCS, then it does not make any logic. It does not see its utility. From both the database point of view and from the real world point of view. So, if we look at the first row of the course table, the second row of the program table, if we merge it with that, then there is a logic. What is the course? It has its own data. Along with it, a piece of data is that this course belongs to, this course is a part of the program BCS. On the other side, if we merge it with the table of BCS, you will see that it gives you a more meaningful thing. Is this course a code? Is this the name of the course? Is this the credits? Is this the offer of the program? And the offer of the program is that much in total semesters and that is that much in total credits. The logic is that you have given further information about a course, which you have obtained from another table. But as I said before, if you merge this course with the BBS or the BIT, then that information or that data is not meaningful because there is no link between them and it is not related to them. So, this is the logic behind the joint. I hope this example is clear to you. Now we come again towards the inner joint. How do we do it? Set star. And again, rather than giving the star, you can give the attribute list as well. Any particular attribute, you can take it from both the tables. From course or this format is again of the SQL server. You said set star from course and then you said inner joint program. In Cartesian product, you said course, program. Here you said from course, inner joint, program. And the inner joint is written in capital. It means that it is required there as such. And then, how do you give the condition with on? On course. Program name is equal to program. Program name. Because the name of the common attribute is same in both the tables. So, you cannot write that program name is equal to program name. Dbms gets confused. What is this different program name written? Because program name is there in two tables. That is why you said you gave a qualified attribute name. Table name. Program name. Overall, if you see, these names become two different names. Dbms can specifically address a particular attribute. Because it knows that program name is in the program table. So, this is how you perform the inner joint in the SQL server. Another way to do this, which is commonly used, is that you said, select star from course C. Now, the course C is written here. You have alias. Because when you used the program name in both the conditions, you have to type more characters. You have to type a lengthier text. You can do this with alias. And then in the condition rather than giving the table name, you can give the alias. In this case, you have course C. Now, C is the alias for the course in this statement. Inner joint. And what you have given the condition on again, rather than giving the table name, you said C dot program name and P dot program name. And mind it, it is not necessary to alias the course with C. It is not necessary to alias the P with such a program. It is just a chance. And you can do anything with it. Now, look here. Here is the output. You can see the program name twice. And one thing you can see is that the program name is the same in all the rows. Because the program name is coming from the course table. And the second one is coming from the program table. You can see that rows are the same in which this common attribute is the same. And that gives you a meaningful result in this program. In this program, there are 30 semesters and there are so many candidates. So in this way, the data that you combined from different rows and merged it with a meaningful method. I hope you have cleared it. If we have used the inner joint command, how can we do it as you can see here? Select star from course, program. We have not used the inner joint phrase. We have not used the words. We have simply said course, program. But when we say where, now we are creating the inner joint using the where clause or by giving a condition. So what will happen? The condition is course.programname is equal to program.programname. The name of the attribute is called PRName. If it was different, one was called PRName, one was called PRR, one was called PR1. In that case, you do not need to qualify the attribute names. You simply call it attribute name. There are different names. Dbms will refer to the appropriate table to access the value. In this case, we need to obviously, we have the option to use alias here. Next form of joint that we are going to study is the outer joint. Now you have seen that the special thing about the inner joint is that both of your tables will merge with the tables in which you have the same value of the common attribute. Those tables will miss the inner joint. Because they do not have the same value of the common attribute. So, the outer joint gives you the option that the inner joint will also come and the outer joint will also come. So, the inner joint will also come and the outer joint will also come. Now, there are different forms of outer joint. Inner joint plus the missing rows from one or more tables. Left, right and full outer joints. These are different types of outer joints that are available. Right outer joint is inner joint plus rows from the non-matching rows from right table. What is the concept of right or left? When you write the direct statement, what you will write is the word outer joint. The left one is the table and the right one means that there is no need for distinction. The only thing is how you write your statement. The tables you write first, then write later, it doesn't matter. But this thing will definitely matter that which table you want non-matching rows. The first thing we have is course and program. First, between the course and program, you will get the matching rows but you also want to see the non-matching rows of the course. In this case, you want the non-matching rows of the course. Now you have to use the inner left outer joint or right outer joint. It depends on where you write the course table. If you write the course, then you write the course and then you write the program. You need to write the course because if you write the course before, then you write the course and then you write the left outer joint. Because now you want now you need or now you will get the non-matching rows of the table on the left of the command. But if you write the program first, then you need to write The course will come later. So the words of this command are coming on the right. Then you will write for the same thing that this program and right outer join course. This way you can do one command from the right side and keep one more thing here, K. What I am telling you repeatedly, this is the approach of the SQL server. If you use any other tool, then maybe there is another approach. But again, the meaning of the concept, they won't change. Meaning when you have an outer join, it is an outer join on every place. This is what it means. The left outer join is an outer join on every place. Because this is the part of the theory of the relational mathematics. So when you have a right outer join, it will remain on every place. It won't change. But how will that implement? This is the DBMS specific. It can change the way a DBMS implements it and the other DBMS implements it in a different way. Left outer join performs the same thing but missing rows of the left side table. I have told you the same thing. A left outer join B will give you the same effect as B right outer join A. On the left side, you said that A was first written and you said left outer join. So inner join plus A's missing rows. And on the other side, you said right outer join and one on the right side. So that will be the same effect. Missing values are replaced with nulls. Meaning if you are non-matching, then only one value will come. What will be the other one? It won't come. Now where you don't get confused we say that primary key can't come. So how will this null come? Because the output that came in here as primary key function is not working. I will explain this in an example. Full outer join is the inner join plus the non-matching rows from both tables. Full outer join will be in every case. In any form of outer join. Now the one on the left side will be left. The one on the right side will be right. And the full outer join will be in both tables. For example, you said that select star from course C C is the areas. Left outer join program P is the areas. On C dot program name is equal to P dot program name. Or you can do this in other ways. Select star from program P, right outer join. What we have done here is we have written the course program first. Because the course went to the right. Now it will be right outer join. And both the effects will be exactly the same. And your condition is now this is the output. If you look at this. So we have row number 8. In which is MG103 intro to management. Now this course was like that was not linked with any program. Because all the other courses that were recorded. They were linked with some program. Because their program name is foreign attribute. There is some value in it. There was null in it. Null means that it does not match with anyone. When it does not match. So obviously the gains that you will get from the attribute. From the program table. All of them are null. Now there is a problem. The program name of the program table. That is the primary key. And we have said about the primary key. That it cannot have null. So here the program name attribute. The program table. There is a null in it. The answer to that is as I told you before. That the program name here. It is not functioning as primary key. Because you have the output. The join is coming. That is why we can have null in it. In another course. Select star from program P. Left auto join course C on program A. And you can also see this. Select star from C. Right auto join program P on C. Dot program name. And see what is happening in it. That you have done the same thing. That you have reversed the order. That is exactly the same. But what is happening in it. That you have the program table. That you are getting the missing row. That you are getting the null matching rows. Now we have in the program table. How was the MIT program. Which we have not defined any course yet. What is happening in it. If you see that we have the last row. MIT is coming in it. MIT we have a program. It has 4 total semesters. And it has 62 credits. But. Because we have not done any course. So that attribute. Which has come from the course. In this inner join. So in this way you can see. How can we take any non-matching table. How can we take any non-matching table. How can we take any non-matching table. Outer join. The last form is the full outer join. And that is the select star from program P. Full outer join. Course C. And the condition is on. P dot program name is equal to C dot program name. And the output of it. Is this. If you look at it. Row number one. In this you can see. We have the course. MG103. Intro to management. It is not linked to any program yet. So we have those. Those programs are three. Similarly. Which we have the last row. In which we have MIT program. Which we have not done any course. In the course table. Which is also merged. So all your attributes are merged. From course. So this is the example of. Full outer join. Again. Tool specific. Semi join. First inner join. And then projected on the attributes of one table. Advantage. Tells the rows involved in join. All the examples we have seen. Until now. We had two different tables. We had a relationship. And we joined it. So in that. Certain rows from both the tables. Are merged with each other. So in that. Which rows match. Which common attributes are the same. Now. The semi-join. Does that. And after that. Will be. On one table. But it. Projects the result. This is what it means. See. Your rows are merged. Which were common attributes. Its value was same. When we. From that inner join. Only those. Attributes. Which belong to one table. What is its advantage. Its advantage is. From one table. Which of the rows. Which of the records. Were involved in this. Or. Which were linked. This had description from the database point of view. If you see this. From the real-world system point of view. So if we see. The program. And the course. If we take the semi-join. Let's say on course. It will be the inner join. Of course. Of course. Which are linked. With the program. It will be merged. After that you will remove. Those rows. Which are of course. Its advantage is. Which courses. Whose programs are defined. Or. Which courses. Which are being offered. In some programs. In the same way. If you take the opposite. That we said. Program. We took the course. We took the inner join. And we projected on the program. This will be. Which of the programs. Which are involved in this. Or. Which of the programs. Between the programs. So. If we take the semi-join. On the student. Which students who are enrolled. Or if we take the semi-join. On the program. Which programs. Which students enrolled. So. You get the information. That. The inner join. Will be. No operator available as such but can be implemented by select list as we have done before. Look at this example, like here we said that select distinct p.program name total semester or program credits from program p inner joint course C. Now, look at the first thing in X, we have written the district so that if there is a duplicate then it is not there, after that you can see that the program name attribute we have qualified with it, we have added the name of the table from it, the reason is that the program name attribute is also in the program and in the course so if we only write the program name then there is a confusion. But the total semester is program credits, we know that it is in a single table that is why we do not need to give a table name to it. And look here we have done that we have given the inner joint as the second part is telling and we have taken that attribute from it which belongs to the project table. So we can say that this is the program semi-join course. And here is the final part of this statement, here it says on p.program name is equal to C.program name. So the later part it performs the inner joint and the initial part it performs the projection. So both together they give the impression of the semi-join. And look at this output. Now look at this screen you are seeing five records. This means that these are the five records of your program table that are involved in the relationship with the course. Or you can say that we have defined the course table of these programs. You will remember that in this program table you have got another row, another record that is of MIT program. And because we have not introduced any course of the MIT program that is why we are not seeing MIT record here. Because it was not the inner joint part and we took this projection from the inner joint. So you will not get MIT record. This is the last form of time that we are going to study. And as the name suggests in this form of joint, table is joined with itself. And idea is the same that the primary foreign concept will be used in this. And the difference is that first we had primary in one table and foreign in the other. Now you will see that one table's own attribute that would be working as a foreign key. As we had studied earlier in the unary relationship. You will implement the self-joiners in the place where we have implemented the unary relationship. Or recursive relationship. Now it will be that you will define the foreign first. And you will link it with your table. And then when you implement it, the first thing you do when you declare it as foreign key. So the attribute of that table that you declared as foreign key. When you enter the value in it, then DBMS will also ensure that you enter the same value there. Which is already entered in the primary key. Now there can be many examples of this. For example, if you see that we have an employee table. In the employee table, we have the record of all the employees. One of them is the manager. So a particular employee of different employees is the manager. First we have different departments. First we have 15 departments. So every department has a manager. So if we have 1000 records, 1000 employees. So among the 15 people are the manager. Now the one who has declared as a manager is the foreign key. And the one who is referring to this table is the primary key. So what will happen in these 15 foreign keys? It can be null, it can be anything. But the rest of the records will be in the foreign key. One of these will be the primary key as the manager. So this is how you can view it. If you look at the student like this. For example, we will add another attribute in it. We call it CR. We have different students. And different classes as you know are class representative. So one student will be declared as CR. So we will associate who is the CR of this class. So we will add a attribute in it which we will declare as a foreign key. And then we will join it with it. Let's see how we will do it. Applied on the same table having reference directory constraint implemented onto itself. Here I have given the alter table statement as a surface layer. Because till now we have not added a attribute in it which I have also called CR. So to add that table and to join the reference directory constraint I give the alter statement here. So we said alter table student and add CR. It is a attribute name and its type is character 5. And obviously I had told you that the primary key and foreign key domain should be the same. Because we have the student ID. Its data type is character 5. So the type of CR we have declared is character 5. And also we have given references student and student ID. So we have added it. And also we have declared it as foreign key. And the home relation of foreign key is the same table in which it is contained. Now let's see what we have done here. What we have done here is that we have entered the data. If you see that the first row we have here is S0123. Its name is Amjad. It is enrolled in MCS. The CR itself is CR. So there is no CR here. But if you look at the second row which is MCS then its CR is S0123. Now S0123 is the ID of the Amjad which was on the first row. Similarly if you look at the third row there is a record on the third row. And its ID is S1015. Because again, TAHRA is enrolled in MCS. And the CR of MCS that we have declared is Amjad whose ID is S0123. So here it will be S0123. Similarly we have the fifth record of Sweldar. This is also MCS. So its CR attribute is the same value here as S0123. Or like that. So if you look at the same table you have added an attribute to it. And you have also imposed a Referential Integrity Constraint. This will give you the same values which are already present in its primary key. So this is how you include a Referential Integrity Constraint or you include a foreign key into the same table. That reference is the same table. Now how to take a self-journ? Let's take a self-journ. We have said here that selectA.studentId. If you look at the select list here all the attributes are qualified. The reason for that is because we are taking the self-journ. So whatever attribute name we take it will be present in both. What does it mean by both? Since we are taking a self-journ. A table of our own. So logically you have to understand that whatever table we have as a student in this case you have to understand that a student is living twice. Logically, theoretically, not practically. Practically it is the same. But you have to suppose that you have to make a house in your mind or you have to think that the same data we have, the same table is living twice. This is exactly this. You can call it A or B. So at the time you want to write your select list or you are mentioning the condition in any case, at the time you refer to a particular attribute then in your mind what should happen right now at this particular moment at which instance I am referring to an attribute at which instance of the table came from this or from this or from the one I called A or from the one I called B So if you understand two instances of the same table in your mind then it will be easier to write a query. You can visualize both of them as to separate tables whereas practically it is the same table. Now see what we have done here that the select list we have we have used all the names we have used which are qualified that is we have given the alias name and basically the objective of this query is that we need all the students' ID and we also need the name of CR so what we have done is select A.studentID A.studentName B.studentID B.studentName Now think about this that we have one table from there we are taking the student's data and from there we are taking CR again we have two instances of the same table we will pick the student's data from one instance and from the other instance we will pick the CR data so what we have done here we have said from student A and from the same table student but the other alias B where A.CR is equal to B.studentID Now this means that the one instance which we have taken the CR attribute the value in it you hold it and match it and go to the other instance and match the student ID attribute of that instance again pick the CR attribute of one instance and match this value with the student attribute of the other instance so from here you are picking CR's value and looking for the student based on that so this is the output and see what is happening here because we have four enrolled people in MCS their data is present here and we have CR which we have declared as MCS class so the first thing is that we can only see four recorders here which are all students of MCS and after that we see for all these four they are different students but if you look at the other part where we talked about the CR because CR is the same there are five records and one of them is CR and the other four are students so there is no CR that is why it was not kept there but if you look at the other records then we have the same student record in which its ID is and the name is less so the two columns on the left are telling you the student's name and the two columns on the right are their CR's ID so because we only have CR defined students of MCS so here you are getting only students of MCS if the other programs are defined then we will get them so far we have discussed different forms of joins and we have seen that we can access from multiple tables we have seen Cartesian product inner join, outer join, semi join and even self join and as I told you before practice it and I will also give you the different queries that you will get when you practice then you will get clear one more important topic of SQL we are going to read and the basic idea of sub query is that you use another query in one query sub query query within a query now the question is what is the query on which stage can we give another query in one query where we have read different syntax, different formats there is an expression on which expression can come you can write a sub query there but generally what we write sub query we write where clause where we apply the condition normally we use the sub query and one more thing is that there are multiple options for example in one place you can do sub query that you can join and vice versa you can do sub query it is totally up to you your convenience is also involved and secondly when you study some depth the efficient approach you will get when you read this you should know that you can do the same activity with different options you can do what suits you at some particular time we are going to read all the queries and as I told you this means that there is another query in one query a query within a query useful when condition has to be applied against an unknown value yes this is the hint this is the tip so you normally know that what is the value of the condition what is your required condition for example you said program name is equal to mcs department is equal to this you said name in this when you know what is the condition what are the values in that case you use where clause but when you are not clear what is the condition then in that case you use sub query for example you get the names of two students who have more cga than that of maximum of bcs student now the students of bcs whose maximum cga is more than those of cga now you do not know that the students of these students what is the maximum cga this is something unknown so in the query you will first apply a query that will take you to the maximum cga of bcs and you will make this query as sub query and you will apply another query which will compare with this so you use a sub query like this can be used anywhere where an expression is allowed you can use where clause and can be nested like that careful about operators yes depends whether sub query returns single or multiple values till now you have read inco or like or between and where your operator is equal less than greater than so when you are using a sub query you have to see how many results we will get whether it will be single or multiple values if you are sure that the result will be single in that case you can use operators like equal less than greater than equal to you can do this but in the case where you know that you can not use equal to in that case we have operator in any inco or all in any all in that case when the sub query returns multiple values for example select star from student where cgpa greater than greater than symbol it is necessary because cgpa has a single value that you can compare only with a single value if your sub query is giving multiple values then the greater than symbol becomes useless so when you have used greater than operator then you have to make sure that the result we are getting is single value here we have given sub query in parenthesis we have said select max cgpa from student where program name is equal to bcs now what will happen as I told you before where will restrict that will pass toward the aggregate function now that will come out where your program name is bcs that will apply your maximum aggregate function and it will return you a single value that value will be compared with cgpa and your result will be structured so this is an example of the sub query here you have an example of this you can see one more here although we have used aggregate function we have also used the group by clause in your sub query you have your row is a group and in every row you will get a value so any show that your cgpa if any of the multiple values are there then it will be selected so this is again when you get multiple values this is output that is it that we have to recover about dml in this course and the golden rule practice makes even the students perfect you can go from practice without practice you cannot be perfect after this we have dcl data control language and this is very easy because diy means do it yourself dear students in today's lecture we have concluded the dml part of the sql and we studied right from the select statement we studied different forms of select statement right from accessing data from a single table we studied data access from the multiple tables then different forms of joints and finally we have read about the sub query here our sql discussion is finished your dcl I have left the stage because there are few statements revoke and grant you can do it yourself and it is not that important after this we will end our sql discussion and we will go to the next topic till the next lecture Allah Hafiz


Brothers and sisters, Assalamu alaikum warahmatullahi wabarakatuh.  Over the past few years, we have built a daycare center, repaved our parking lot, upgraded our lobby, bathrooms, masjid carpets, and proudly extended our women's prayer area. From educational programs to niggas, we are gratified to say that we have come a long way and we couldn't have done it without your contributions. May Allah reward each of you and multiply your rewards in this dunya and akhira. Amin. We are now in the month of Ramadan and have some major milestones we need to complete with your support, inshallah. There is no better time than now to help build the House of Allah for your family and community during this blessed month.  So let us come together and take advantage of this time we have right now to multiply our rewards, inshallah. We currently have two phases of renovations we're planning to accomplish, inshallah. In the first phase, we're working on our new banquet hall, a cafe, and an industrial-grade kitchen to help serve the community. For the second phase, our plans are to focus this stage on our future, the youth.  The community understands the importance of making our youth have an outlet accessible for them. So we're making this a major priority to have these services available. Also, we will be renovating the grand entryway to MCC, as well as raising our ceilings in the Masjid prayer area and conference room, which then permits us to add a mihrab and mimbar, inshallah. It is our goal to have these renovations completed in the next two years, but our hope is to beat our timeline with your aid. We're aiming to achieve completion as early as 2020, which would mark our 10-year anniversary as the MCC, inshallah. Our community is growing, mashallah, and we'd like to maintain its growth. We would not ask you for this investment unless we felt it was important for the community. Please continue to support us with your generosity as we position the MCC to be the thriving regional hub for the Muslim community in the East Bay.


Oh Hey guys, welcome to another episode of watching a barn film with my girlfriend here We're back for episode number three already So like we promised last time this time we're gonna be watching golden eye There are a lot of gold in all the movies. Yeah, the first one was gold finger and now gold Yes golden eye and there's also the man with the golden gun, which we didn't watch so there is a lot of gold indeed Yeah, but a lot of die.  There's a lot Yes, yes, it's it's postponed again, but that's a subject for another time So golden eye this time we're gonna be watching a movie from the 90s So we were actually born around this time this time this movie come out three years old. Yes 1995. I was five So a movie from our era Last time we watched license to kill which I think was a movie. You really enjoyed. Yeah, I joined it enjoyed it a lot except The ends what was what was wrong with the ending again? Well, they put the one with the short hair They put her in a bad light, so Yeah, you did not that good. You didn't think she you know see she kind of you know just a second choice Yeah, and she walked into bonds arms willingly and she shouldn't have done that in your opinion Maybe because she kissed with another woman in front of her So Can I conclude from that? That's my mind in this Days they were like that Just floating around You were dead. I know neither was I but so can I conclude from that that you're you're hoping for You know the women are portrayed differently in this film. Yes, okay Okay, well, I think all I definitely has strong women. You said funky answer. She's a Dutch Yes, funky answers in this. Yes Yes, there are two women in this film. I won't spoil too much funky answer and cease the bad chick completely crazy and the other one No, she's the bad one which is even cooler. I think I think There's also the good one and I hope at least for my but but I'm a man, you know, maybe my opinions there I think she's very capable and strong in this film the bottom. I'm very We're gonna see what you think But there's also a new guy who's playing James Bond. That's right. I see and all Other one. Yeah, this is the first bond film of Pierce Brosnan. No one so confusing Yeah, there were six James Bond's in total this was James Bond number five and Do you have any expectations from him maybe compared to Dalton or I hope he's just like the first one What's his name Sean Connery Sean Connery more like the charm of James Bond myself Yeah, so the the other one was too realistic Yeah, I hope he has like that glow of James Bond himself. Yeah, I Like the thing throughout the other one. He played it.  Oh, so he's like Yeah, so he really was inspired by Connery when Goldfinger came out Pierce Brosnan was 11 So he was always talking about being such a fan of Connery and really wanted to portray that just your initial Opinion from seeing him on posters. Do you think he's a handsome man? Then the one we're gonna see today Pierce Brosnan So we're off to a good start. Hopefully we'll see how Lear it is gonna enjoy GoldenEye in this episode and we'll get back to you to hear her thoughts Yeah, see you later We've just finished watching GoldenEye. We're back. So once again, what are your initial thoughts after watching this one? Well, I Like the better than license to kill The action was more in this time. Yeah more modern More modern more real and The storyline was very good. Okay, so you like this good film Well, I noticed from the beginning the gun barrel and the one with James Bond was walking and then he does like this It was more more than than the other ones. Yeah. Yeah, you see it's digitally moving along with the gun barrel Looks it looks more of this. Yeah these times. Yeah, that's right. Good observation. I saw the car The DB5 return. Yeah, that's true. Yeah Yeah, it's only in the opening the DB5. Yeah, and the rest he does drive BMW and W. Yeah But that's my concern that also doesn't feature much because the CIA agent just drives off with it We don't see the rockets that it has, you know There's a lot of promises from Q that it has rockets and all that stuff in this movie. It's not showing That's true Okay, um, but just let's just start from the start. It has an opening with a bunch of young from the dam Yes, I'm afraid of heights, so I felt the height Well, he jumped down and then further in the scene he was on top of the mountain Yeah, so that was something I pointed out to in my review. Yeah, good observation because he jumps down a dam Then in the facility he goes down some stairs and down some hatches and then he ends up on top of a mountain Yeah, but it's still a good opening to you the rest the bungee jump and There's also the plane jump There were some scenes and it was very fake Jump with the airplane and the one with the tank It was quite awesome to see but it was quite James Bond scenery. Yeah, but yeah the one with the tank When he ran on the side, I said, oh my god, she's kidnapped by the bad guy La-la and she's taken and then I said to you. Oh, I think he's going to take a tank Yeah, it was predictable. Yeah, predictable just normal normal James Bond thing Just take a tank. Just steal a tank and just drive through Russia with the tank Normal day for James, but did you like that? Is it exciting to see him drive a tank or it was different He drove a tank he drove two cars What else? He flew an airplane Also a helicopter He was captured in a helicopter. He was captured in a helicopter He blew up a train, but he was also in the train. So every vehicle was in the movie All the vehicles he gets in are blown up. That's what the model pulls out every time. Yeah So, let's just take a step back This was the first Bond movie of Pierce Brosnan your first time seeing him as James Bond You've now seen three James Bond's out of the six. What did you think of Pierce Brosnan's portrayal of Bond? Well, just like the first one Sean Connery, that's what you were hoping for right? Okay, so Hmm. Yeah, you know, he looks good in this film and I think do you think he's more good-looking than Dalton was maybe or Use my kind of time I see I can see that I'm close. I was described as the son of Brosnan in one of our comments, but Yeah, Pierce Brosnan Did you think he brought back that spark that you were talking about if you were missing with Dalton in some scenes? Was he believable that that woman would fall for him for his charms? It was too easy for him. Yeah But can you imagine that woman would fall that easily for him or is that not convincing or for me? It was not that convincing. Okay Okay So it was still not to the level of Connery or Well Connery made it like He's the original. Like flowing And this one was like in your face. Okay So there was still a difference between Brosnan and Connery in your opinion on that front Yeah But you enjoyed him overall as a Bond like with the humor and the stunts the fighting that that type of stuff Yeah Okay Speaking of the fighting, I remember Lysus the Kill you said there was a lot of phew phew Yeah, cause that one out like the pew pew Yeah It was all real now Yeah, so it was a lot better this time. There was a really good, I think at least the fight in the end on Dish is with Oh with the 006 Yeah Speaking of 006, that's the main villain this time round Hello James Do you know who he is? No 006 Longer just than I'm on the start and the more you're bored than I am So what did you think of that idea of 007 going up against another 00 agent this time? Weird cause they were friends right? But was it an original idea or not your taste or how did you like the idea? It was an original idea but I Well You thought it was a shame because they were friends or something? No, no, no, he was like all the way into the Russian things 006, so he was a double agent or how do you call it? Yeah, double agent basically Pretty much Secret agent, something like that He has to interfere into, I don't know the English word It filtrate the Russian government things right out there So I think that's why he just Woke to the other side Yeah Yeah, but it was I don't know if it's just an 18 year old Not here I knew But it was over James He was sitting on the ground on his knees So that's probably when he wasn't on the screen I thought the bad guy was The guy who was the commander The Russian commander Oh yeah, General Uramov Yeah, I thought he was the bad guy He was one of the bad guys Until 006 came You were surprised that he was the Yeah Yeah, Uramov had different motivations to take on bond And he wanted to use the satellite and that kind of stuff But in the end it turned out 006 was the ultimate So he was like the runner for 006 And the girl, Panky Ansel, was just his right hand Yeah, just a henchman basically Like Ajah to Goldfingo or Dario to Sanchez basically Yeah, and Uramov is like A lot of the times in Bond films that there's a secondary villain And Uramov was the secondary villain basically to 006 Okay, also featuring in this movie were again two women Is it always two women? A lot of the times, definitely in the more recent Bond films There are Bond films where there's basically just one leading lady There's usually one leading lady and another Bond girl who's often a bad guy or... There's always a girl that is bad and always a girl that's... No, not always, sometimes both of them are good Like Inlicious to Kill, the other one wasn't really a bad girl But she was in the team of the bad ones Yeah, but she was still helping Bond in her own way Inlicious to Kill, she was not like this particular bad girl Played by our Dutch fanke Jonsen What did you think of her as Xenia Onnetop? Pretty good, yeah I know her from another movie Okay, do you remember which one? Maybe Taken, I think, she's the mom in Taken No, no, not that one Oh, with Wolverine X-Men, yes, he's in X-Men too I only know her from that one, so this was quite a new for me Yes, he's a bit younger here still But she played it well Only the killing thing with her thighs That was quite weird Yeah, in what way? Too much or...? I really didn't like that part It's quite weird But I would rather die... I'll kill you with my thighs I would rather die from her thighs than with Ajax's head If I had to choose a way to go, I'd pick her thighs No, I will take his head But you liked her as Xenia Onnetop Pretty badass, I think She's Dutch, but she can play a Russian girl Pretty good Yeah, very convincing I cannot play a Russian girl with that Russian accent She's really good There's also another Dutch actor in a movie we didn't watch Jeroen Kravij, who also played a Russian general in the first Bond film with Timothy Dawson, the one we skipped But he's not, in my opinion, as convincing But Van Cleanser really nails the accent, I think You really believe it's a Russian woman There's also the other Bond girl, who also plays a Russian woman even though she's originally Polish, I think, or Swedish, or both But Natalia Szymjanova, what did you think of her?  Yes, with the boss of James Bond Good Because I think you're a sexist, misogynistic dinosaur a relic of Google War whose boyish charms they wasted on me obviously appealed to that young woman I sent out to evaluate, you know Point to it She put him on this place Definitely Yeah, Judy Dancers, Em She's got those balls of Rado right there Out of the gate You nearly made her point Did you like her, so you really liked her as Em? Do you think it fits that 007 now has to take orders from a woman? James Bond franchise is going with the time being I think James Bond needs to be a guy because now he said to me that they want to be a woman Some people want him to become a woman some feminists believe it's offensive because he's white and because he's a man But I think it's fair to let him be like a man I agree And then the other people, persons around him can be women Yeah, they can evolve with the times Because the franchise is doing that right now Yeah, they always are evolving with the times Now you notice too Yeah, you notice in this film that they do that with the women What they say to him and how they represent themselves as a woman Okay, now I agree I think in GoldenEye they made a huge step forward in the emancipation of women Empowering them more In the comments people were also asking for me to ask you what you think of the title songs because I didn't do that with Goldfinger and Lices to Kill But now we saw the title song of GoldenEye by Tina Turner Tina Turner What did you think of her song? You said to me, do you recognize the singer who's singing this? I said, no You didn't recognize Tina Turner immediately I'm so sorry You know Tina Turner, right? Yes, yes, I do know her But honestly, sorry guys I don't listen to these songs Too much Too much So I just skip to the movie Usually when we, so far when we went to the titles she kind of looks at it and then the images come on and she grabs her phone for a bit until the movie begins But did you notice during the time that you did watch the titles that that was a lot more modern now the opening titles compared to Well, I saw with the opening that it was with the song then there were like the sickle and the thing from the Russian Yes, the Soviet Union Soviet Union Yeah That was falling apart Yeah to symbolize I saw that but then But I heard like the melody It was good but I just waited until She just wants to see the movie But it's normal for me I did it with all the films So don't like bash me in comments No, of course What else? The setting this time This was taking place for the most part in Russia Well, it began in Monaco and beautiful and then it changed to Russia and then it changed to Cuba Yeah, Cuba So pretty good Yeah, okay Did you like the Russian setting a large portion of the film had? Very cool But that's Russia, right? Yeah, a lot of Russia I've never been to Russia but and she's been to a lot of countries It's on my list, right? Yeah, that's true Is it Petersburg? Yeah But a lot of the people in Russia were complaining because this was their first Bond film they saw because of the end of the Cold War that they thought St. Petersburg was generally destroyed because of the tank That's how convincing it was Oh, really? Yeah, they really thought the statue Oh, yeah, that was on the tank They really thought it was destroyed I recognized the statue You did, yeah But of course that was all in studios It wasn't a studio? Yeah, a lot of it were props They don't go out and destroy the real square just for movies Whoa, it wasn't a studio A studio lot, a lot of it A lot of it was on location and a lot of it was taking place on the studio lot Okay But in Monaco it was very beautiful But James Bond he was also in a casino with Tham Kianza Yeah He said he always played poker Was it poker? This was Bakara That's a different game Yeah, Shaman the Fam or Bakara, that's usually that's a more traditional casino game But it's definitely a Bond's table to have him featured in casinos in his tuxedo or what Oh, and I remember that you said The director? Yeah, the director was also in the movie and also the other one The producer The producer Yeah, they made cameras Do they always do that? The producer Michael G. Wilson he has a cameo in every Bond film Really? From the mid-80s to now So he always appears in one scene because there's fans to remember He always wants to be in his own movie Yeah, there are fans who are looking for Michael G. Wilson it's become a game spot, make a G they call it But now he was like on the bike That was the director Oh, that was the director That's just the one that directed this film but the producer is the one that produces the Bond films Oh, he was like on the big table Yeah, in the Russian building and he was really easy to spot in this one but in some movies he's very hard to spot but he features in a lot of the Bond films So we finished off your third Bond movie and I'm going to ask you again to rate this film you've rated Goldfinger with a 6 and licensed to kill with a 7.5 Now we're into GoldenEye How did you like this one? 8.5 8.5 So we're getting better each week basically or each time Yeah, it was pretty good This was your best one yet for you? Yes Okay Good to hear Now comes the question We've watched one with Pierce Brosnan What are we going to do next time if we're going to watch another one Are we going to do another Pierce Brosnan Are we going to move back into the past or are we going to move on to Daniel Craig What would you prefer to do next? Just watch the other ones of Pierce Brosnan and then go to Daniel Craig Okay, so now you want to stick with this period move on Okay So we'll pop in another Pierce Brosnan feel next time and we'll just continue on this path and we'll see how Liret is going to enjoy those in the next episode Hope you enjoyed it again Take care Oh, just one moment You saw me watching the movie with my glasses They're not my real glasses These are just blue light glasses because I get a headache My eyes hurt when I watch television or watch my phone so that's why I wear glasses So just a little disclaimer in the end here that she wanted to get off her chest but no glasses, no bad eyes just for the blue light Anyway guys, we'll see each other and again next time with another Pierce Brosnan movie Take care, bye bye for now So that's why I'm always looking for support and set up this community on Patreon for the biggest diehard fans of my work I am a believer that those who support me should be rewarded with a ton of perks like getting 2 weeks early access to all my latest videos receiving a personal thank you video from me I will also send you my custom made blu-ray covers that you can print out and put in empty blu-ray boxes and you get exclusive access to the supporters discord server where you can chat with me and fellow baron fans whenever you like and everybody that supports me also builds towards new goals for the channel's future All these perks come for a little $3 a month All support is appreciated immensely Thanks a lot guys


Hi friends, welcome back to my channel and a very special welcome if you're new here. My name is Jen, I'm a certified weight loss and nutrition coach and I'm on WW personal points. Happy Friday friends, it is Friday so it is time to recap my week, set some goals for next week, talk about the WW workshop and of course this week's weigh-in. So if you're excited to give this video a big huge thumbs up, make sure you're subscribed and ring your bell so you never miss a future upload. Unfortunately, YouTube has been turning off bell notifications so make sure yours is turned on and set to all so you never miss when I upload because I do upload new videos five days a week and every Friday is weigh-in day. Check out the description box down below for nutrition coaching where I offer personalized to you macros and calories as well as one-on-one coaching if you would like to chat with me directly. Links and discounts to my favorite things and of course come on over, join our Facebook group, we would love to have you. So let's jump into my week, the workshop topic and this week's weigh-in. Friday once again, I hope you had an amazing, amazing week. I had a good week overall but I also had a frustrating week. I've been mentioning in my last couple weeks of weigh-ins that if you didn't know, I started a fitness routine with a fitness coach a little over three weeks ago, actually almost four weeks ago to today and it's been really good. I've been walking, I've been strength training at the gym. I'm now incorporating two days a week of structured cardio which means that I'm on some type of piece of cardio equipment at the gym getting my heart rate 125 or higher. I don't think my heart rate was getting high enough for her on my walk so I think she decided to implement some structured cardio into my routine. I'm still walking the remaining five days of the week and I'm strength training three days a week which all of that's been great. I'm loving my walks. You guys know I really, really look forward to my morning walk. I never thought that I would wake up excited about exercise but I really, really enjoy my morning walk. I'm starting to like the strength training a little bit more. I'm feeling like my body is toning up and I can see a little bit of muscle definition for me which of course is huge motivation and the structured cardio, nah, this is my first week doing that. I will tell you that 30 minutes on the elliptical feels like four hours where I can walk 30 minutes outside and it flies by. So that's one thing that I don't love but I also understand her reasoning for implementing the structured cardio. What's been frustrating for me is my weight. Now I always tell you guys that I don't live or die by the scale but I have goals. We know I have goals that I wanna hit my goal weight by the end of the year so the number on the scale does matter to me. It's just not the only thing that matters to me but I've been a little bit frustrated because this entire week my weight has been exactly the same. Actually starting from last Friday so for almost an entire week my weight didn't budge. I mean not even an ounce and I'll tell you that even the week prior it did the exact same thing. I even mentioned that in my weigh-in video. So I was just wondering what was happening? Why was my weight basically stalling out and staying exactly the same? Now I'm not complaining that my weight stayed the same and that I maintained my weight but with all the added movement and exercise and strength training I was really hoping that it would keep propelling my weight loss forward. But I'm happy to say that as the week progressed as we got closer to today, way in day things started to change a little bit but it's been very frustrating. I've actually reached out to my coach a couple of times and said, should I be panicking? Should I be worried that my weight is staying the same? And she said I should be worried when she's worried and she's not worried. So I just listened to her and trust her advice just like you guys, my coaching clients trust my advice and I just kept doing what I've been doing. Eating good, drinking my water, doing my exercise and I trusted her and I trusted the process. But that doesn't mean that there wasn't some frustration along the way because there was absolutely frustration along the way. On a positive note, I had a couple firsts this week. I actually went out with my neighbor, my next door neighbor there in their mid 30s. Her name is Ash and she's really sweet. I went out with her and some other girls in my community to a little wine bar this week. I didn't have any wine. I drove three other girls and myself to the restaurant but I had a little cheese meat cracker tray with some fresh fruit that I split with one of the girls and we just had really good conversation. I got to know some other girls in my community which means they're relatively within walking distance of me and now I have multiple friends not just my next door neighbor Ashlyn but other friends in my community and we're planning on more girl get-togethers and going to some fitness classes at the gym and it was just really nice to network and make some new friends here in Arizona. And I also stayed on track all week with my food. I had one kind of relaxed splurge meal but the rest of my week was literally on point and I think that led to some of the weight loss frustration as well but overall I feel really good about my week with my activity, my water, my food and meeting new friends. But before we jump into this week's weigh-in let's talk about this week's WW workshop topic and that is how to establish a morning routine. I get asked a lot what my morning routine is. I've actually been asked to film videos on my morning and nighttime routine. So let me know down in the comments if you wanna see what I do in the morning to set my day up and what I do at night to round out my day to keep it healthy and to keep moving towards my goals. I would definitely be interested in filming this video if it's something that you wanna see. So let me know down in the comments. So what is the perfect morning routine? Honestly, I don't think that exists. The perfect morning routine is what's perfect for you and that's going to vary from person to person. Maybe it's waking up on a yacht with a hot fresh cup of coffee. Maybe it's indulging in a beautiful morning breakfast or maybe it's having absolutely nothing to do in the morning. But until this dream becomes a reality think about what you actually need to accomplish in the morning and how to set yourself up for success. So we have some tips from WW. Tip number one is make a list of the things that you do in the morning and how long it takes you to do these things. So these are things that you automatically do without thinking every single morning. Pay special attention to anything on this list that maybe you want to stop doing. I'll go ahead and pop up a graphic here from WW. So one thing that we do every morning is brush our teeth. That takes approximately two minutes. We brew our coffee taking approximately five minutes. Maybe we hit the snooze alarm and that can add nine extra minutes of sleep but nine less minutes that we have to get ready in the morning. Or maybe we scroll social media for 15 minutes. We wanna keep brushing our teeth and having our coffee but maybe we wanna stop scrolling social media and hitting that snooze button. That's kind of how this is laid out. Think about things that you want to continue doing and things that you want to stop doing. Next, think about some small but mighty actions that you can add to your morning routine. These actions should help build healthy habits and then guesstimate how long each of these actions is going to take. So for example, maybe you track your sleep in the WW app and that takes about a minute. Maybe you drink an extra glass of water and that takes two minutes. You meditate for three minutes or maybe you stretch for five minutes. You prep and pack your lunch and that could take an extra six minutes. You may sit down and write in a gratitude journal for seven minutes. Make the bed and tidy up for 10 minutes and you might even take a little stroll or walk around the block for about 15 minutes. These are all great healthy habits to add to your morning routine and once you start doing these consistently, they'll just be things you don't even have to think about like brushing your teeth and making your coffee. And number three is to pick one or two of the things that we just mentioned and think about how you can add them into your morning routine. Maybe you'll wake up earlier and swap that out for something you want to stop doing. Maybe you no longer hit your snooze alarm but you take a 15 minute walk in the morning instead or pair that with a habit you already have locked in. This is called habit stacking and is one of the easiest ways to keep going and build new and healthy habits. So an example maybe instead of scrolling through Instagram when you first wake up, how about you get up and start your routine with that 15 minute walk? In my opinion, that's a much better use of 15 minutes. What do you think? We know that mornings can be hectic.  And that chaos can really lead to a domino effect for the rest of our day. That's why getting into a routine that's healthy that prioritizes your health and your goals and your overall wellness can really start our day off on a less chaotic foot and really a more relaxed, even foot which can again lead to a domino effect throughout the rest of our day. Post your new routine on your fridge, on your computer, on your mirror, in the Notes app on your phone, wherever you're going to see it, wherever it will be a constant reminder, post your morning routine. That way it becomes, that way it's a constant reminder, always in front of you until it becomes a healthy habit routine. And once you find a routine that works for you, stick with it. Again, eliminate the things that aren't working and add things that are working. This is the best way to set yourself up for a successful morning routine that helps you live a healthier, happier lifestyle and of course helps you with your weight loss goals. I really like this topic. I know for me, I'm a very routine person. I have a very, very specific morning routine. I have a very specific nighttime routine and I honestly think that these two routines actually help contribute to my success. If you didn't know, I've lost well over 110 pounds. I'm continuing to lose weight. I've maintained that weight loss and I think being a structured maybe type A routine type person is definitely beneficial. So now let's go ahead and jump into this week's weigh-in. Like I mentioned, it was frustrating to be the exact same weight to the ounce, literally the entire week. But today, when I stepped on the scale, the way scale gods were in my favor and I'm actually down 0.8. That is almost an entire pound. I'll take it. I'll take being down 0.8 after being the exact same weight for well over a week. I'll go ahead and put here on the screen my total amount of weight loss and I'm moving into the next week, feeling good, feeling confident and hopeful that the scale continues doing this instead of doing this. But like I said, I'm never upset about maintaining my weight. I would much rather maintain than gain and I know that what I'm doing to maintain my weight is really good for my body and really good for my health overall. So stop complaining, Jen. Stop being frustrated and be happy about where you are in your healthy lifestyle. So now I wanna hear from you guys. Let me know how your week was. Did you gain? Was your weight what you expected? And let me know what's your morning routine? Do you struggle with establishing a healthy morning routine? Or are you more like me where you're pretty structured and you have a really good routine in place? And lastly, let me know down in the comments if you would like to see a video on my morning and nighttime routine.  Make sure you're subscribed and your bell notification is turned on because I upload a WAN every Friday and I upload five videos per week. Check out that description box down below for nutrition coaching, which I highly recommend. Links and discounts to my favorite things. Follow me on Instagram and join my Facebook group. We would love to have you. Thank you so much for watching. Happy Friday friends and I'll see you in tomorrow's grocery haul. Bye.


Let us now look at two very simple ways of measuring lifetime in a solar cell. The first is the open circuit voltage decay and the second is the reverse recovery transient. Let us first look at open circuit voltage decay. What does it mean? Think of a solar cell. You know that when light is shining on the solar cell, it will generate some voltage. What would happen if the light is suddenly turned off? Well, what would happen is that the carriers which have been generated due to the light eventually will die out and as they die out, the open circuit voltage will decay. How do these carriers die out? They die out by recombination and therefore, if we can measure how the open circuit voltage decays with time after the light is shut off, we will be able to tell what the lifetime is or we will be able to calculate what the lifetime is. So, that is the basis of the open circuit voltage decay measurement. The question is now how can we devise an experiment in which the light is turned off very quickly. For example, could I have a mechanical shutter, the light is shining on my solar cell and then I quickly close the shutter and the light goes off? Will that work? The answer is no, it would not work because the lifetime of the carriers in a solar cell are typically of the order of microseconds and the time taken to close a mechanical shutter will definitely be of the order of fractions of a second. So, it will not be able to capture that very fast turn off or the very fast decay of the carriers if I were to do a mechanical shutter. So, what is the way we can do this? Well, there are various ways and of course, in that setup which I had showed you some time ago, people use very expensive ways of doing it, but actually you can do it in a very simple way. That is to use a light emitting diode to turn off the light very quickly. Fortunately, a light emitting diode turns on and off very fast. So, if I have a light emitting diode shining light on a solar cell, I can turn it off very quickly and thereby capture the open circuit voltage transient. So, that is the first thing which we will do and that is the open circuit voltage decay experiment. The second experiment will be the reverse recovery transient. This is actually a well known experiment for all diodes and what here we would do is to really look at how a diode when it is forward biased and then switch to reverse bias, how long it takes to turn off? I will draw a very simple circuit here which shows the kind of circuit we will be using in the experiment. I will apply a square voltage positive voltage V f negative voltage V r, put it into the diode which is the solar cell and simply put a resistor and I will measure the voltage across the resistor as my output voltage. The voltage across the resistor is really proportional to the current flowing through the circuit. What happens in a case like this? Well, when the positive, when the voltage is positive at plus V f, a positive current will flow through the diode, current will flow through the resistor and I will get some current which I will call I f flowing. Now, plotting the current versus time, here is the current flowing through the solar cell as a function of time. What happens when the voltage goes to a negative voltage V r? Well, initially what happens is that because of the diode really acts like a capacitance, this change of voltage is transmitted through to the resistor out the current goes negative to some value of approximately of value minus I r and now what happens is until, until the diode is turned off, the current stays negative and then only gradually decays to 0. So, here is a reverse recovery transient and how long does it take to recover back to 0 or how long does the current remain at this value minus I r? Well, that is the time we will call the storage time. What is the storage time dependent on? Well, again in this case also the storage time does depend upon the life time because the larger the life time, the more time it will take for the diode to switch off for all of those excess carriers to be removed. So, the larger will be the storage time T s, but in this case there is another thing also and that is the values of I f and I r also determine how quickly the diode turns off. The reason is that this reverse current I r actually pulls out the charge. In other words, there is now two ways of removing the charge firstly by recombination and secondly by the reverse current which pulls out the charge and takes it away. So, both of these things, the life time of the excess carriers as well as the reverse current and for that matter the forward current all contribute to the storage time T s and in fact, you can derive this equation. The storage time T s is tau 0 which is the life time ln of 1 plus I f by I r. So, this is a nice experiment to perform by varying I f and I r and measuring storage time we can actually plot T s versus ln 1 plus I f by I r the slope will give us tau 0. You can see that the kind of experiments we are now looking at the open circuit voltage decay and the reverse recovery transient are really very simple experiments. You just need a simple pulse generator and a very simple oscilloscope to capture this transient and you could actually set up these two experiments total cost of a few hundred rupees really for the solar cell and the LED and probably a few thousand rupees when you include the equipment that is a pulse generator and the oscilloscope which is required. So, these two very simple methods allow us to at least estimate the life time very quickly and very easily. Also because there are two methods we will be able to compare the two results of the life time which we get and that will tell us what the and that will tell us whether the experiments are working and the two values of tau 0 should be approximately the same. So, let us now go and have a look at the experimental setup and see what is happening. So, here is the solar cell. So, solar cell made by Bharat electronics limited and here is the LED it is a small LED bank. You can see that it is being the LEDs are flashing on and off as controlled by the pulse generator. If I change the frequency of the pulse generator I can increase the frequency of the flashing. What I am going to do really for my open circuit voltage decay now is to adjust the frequency to what I need put the LED bank in close proximity to the solar cell and then try and measure the open circuit voltage decay. The solar cell is just open circuited and I can measure the open circuit voltage decay. What we have done now is put the solar cell and the LED in here. The LED is being driven by this simple function generator at about 2 kilo hertz. The solar cell is just open circuited. I am taking the output voltage here and feeding it into the scope. Here is the input voltage which is driving the solar cell. It is just a square voltage going from about 0 volts to about 10 volts or so. Of course, at the input of the circuit I do have a resistor here about a 100 ohm resistor which limits the current, but it drives the LEDs and the LEDs are flashing on and off as we had seen some time ago. I am measuring now the output voltage. Here is the output voltage. You can see that the output voltage is decaying with time slowly as the carriers which are generated finally disappear. You can see incidentally that when the light turns on, here is the light turning on when the voltage goes positive. When the light turns on, the transient is really very fast because the carriers get generated very rapidly. Lifetime really does not come into the picture there, but now when the light goes off which happens on this transient, you can see that the output voltage which is the open circuit voltage decays rather slowly and that is the open circuit voltage decay which we have to capture. So, by looking at this output voltage, we can estimate what the slope of this open circuit voltage decays and from that we can measure the lifetime. If I look at this, I should measure the slope in the initial part of the characteristic and it is approximately if I look at this, it is at about 0.2 volts per division. So, it is about 0.2 volts just trying to measure the time. It is 0.2 volts and this is about, it is about 100.1 millisecond per division or 100 microseconds per division. So, this is about 90 microseconds. So, the initial slope is about 200 millivolts upon divided by 90 microseconds and we will use this data to calculate the lifetime. We know that the lifetime is given by this equation. You can try to derive it, not very difficult to do. Tau 0 is kT by Q, that is a thermal voltage into 1 upon dV OC by dt, which is dV OC by dt is the slope of the transient which we have just measured. So, in our case kT by Q of course is 25 millivolts, 1 upon dV OC by dt we have just measured, it turned out to be 200 millivolts in 90 microseconds. So, I would write it down like this, so that this becomes 25 millivolts into 90 microseconds upon 200 millivolts. I can cancel this out, this goes 8 times. So, you can see I get about 11.2 microseconds. So, according to this measurement the lifetime of the carriers in this solar cell is about 11.2 microseconds. Let us now compare this measurement with the value of tau 0 which we will get from the reverse recovery transient. Here is the simple reverse recovery transient set up, basically I have a function generator which is feeding a square wave which is captured here to the circuit which is the solar cell and the resistor. It is driving that circuit and the output voltage which is the voltage across a resistor and therefore, the current flowing through the solar cell is captured here. You can see that when the input is positive, there is some positive current I f which is flowing when the input goes negative, the output current goes negative goes through the transient and then comes to 0. It is not very easy to find out where is exactly the storage time, but we will try to estimate this the best as we can. For that let me do this, I will just change the oscilloscope settings a little bit. Let me make sure first of all where is the 0 of this? Here is the 0, let me put the 0 at this point. Let us put the 0 here, here is the 0, put the 0 here that will make it convenient. So, in this case you can see that here was the 0, here is a pretty large forward current, here is a large reverse current. The value of the resistor is 100 ohms, I am measuring the voltage on 2 volts per division. So, you can see that this is about 2 for about 4.8 volts divided by 100 ohms. So, that gives me about 48 milliamps is the forward current. So, let me write that down in this case reverse is about 1.6 volts divided by 1.6 volts. So, this divided by 100 that is 16 milliamps. What I can now do is to change IF and IR and try to see how the storage time changes. For this particular case how much is the storage time? Well, I estimated to be approximately half a division here and half a division because this is at 50 micro seconds per division, half a division gives me about 25 micro seconds. So, I am writing down 25 micro seconds. Now, I can change IF and IR, easiest way to do that is to change the DC offset of the function generator. So, for example, I can put it at about 4 volts which gives me 40 milliamps in the forward direction. The reverse is about 2.4 volts that is 24 2.3 volts. So, say 23 milliamps. So, this is about 40 milliamps and the storage time you can see has reduced a little bit. My estimate is that it has gone down to about 20 micro seconds. I admit that it is not very easy, but you will have to do the best as you can. Change the offset voltage even more. The forward current is now 24 milliamps. The reverse current is now about 40 milliamps and the storage time has now become I would say about 15 micro seconds or so. And then reduce, change the IF and IR even further. In this case, now the forward current is, I have to adjust the level to trigger it. The forward current is about 12 milliamps. The reverse current is about 54 milliamps and the storage time now has become very small at about 10 micro seconds. So, these are the data which we have got. Now, we can just try to see what results we get from this data. So, here is the data we have got. IF and IR we have taken from the oscilloscope and of course, the storage time TS also we have taken from the oscilloscope. I have now calculated IF by IR and ln of 1 plus IF by IR. So, this completes our data and the best thing now to do is to plot TS the storage time versus ln 1 plus IF by IR and the slope of this plot should give us tau 0. Let us do that. Here is the plot of the storage time TS versus ln of 1 plus IF by IR from the table. I have plotted the points here. You can see that it is a reasonable straight line as expected from the theory. I have got the straight line here and here is the slope I am calculating and the slope turns out to be 13 micro seconds divided by 1 and that turns out to be about 13 micro seconds. So, from this I get the value of tau 0 to be about 13 micro seconds. Compare that with the value which we got for the from the open circuit voltage decay which was 11.2 micro seconds. You can see that these two are comparing quite well with each other. Given the simplicity of these two experiments, it is really very good that the values of tau we get by the two methods are within about 10 to 20 percent of each other and that gives us confidence at the value of lifetime that we are measuring is quite correct. It should be noted that these are typical values about some tens of micro seconds, typical values which we would see for a solar cell. So, that also actually confirms that our measurements are probably correct. So, this completes our experiment now. This experiment has to do with the measurement of lifetime in a solar cell. The lifetime is one of the most important parameters for a solar cell and basically it tells us how rapidly the excess carriers, the electrons and holes generated by the shining light, how rapidly they can recombine. Why is this important? Well even a simple qualitative understanding of the operation of a solar cell tells us why lifetime is important. For example, just imagine I have a solar cell, light is shining on it. What is the effect of the light shining on the solar cell? Well first of all of course, light shining on the solar cell what it does is generates electron and hole pairs. As light continues to keep shining of course, the holes and electrons keep getting generated, but this process cannot go on indefinitely otherwise the number of electrons and holes in the solar cell will become infinitely large. What happens obviously is that the generation of electrons and holes is actually reduced by the recombination which takes place. So, as the carriers are getting generated they are also recombining, the recombination annihilates the electrons and holes and eventually causes them to reach a steady state where the generation and the recombination just match with each other. In a solar cell would I like the lifetime of the carriers, the lifetime by lifetime I mean how long does it take for the electrons and holes to recombine. Would I like this lifetime to be large or small? The answer is I would like it to be as large as possible because if the lifetime is large then the recombination does not take place very easily. In other words when the carriers are generated they stay alive for a long time and this gives a chance for many more carriers to be generated. If more carriers exist in the solar cell I will get larger current short circuit currents, larger open circuit voltages. So, I would like to have as large a lifetime as possible in a solar cell. Of course there are some other types of devices for example think of a switching transistor where I want the lifetime to be very small because I want things to switch back and forth rapidly and that could only happen if the lifetime is small. But anyway coming back to the solar cell you can see that the lifetime is important and I must try to increase the lifetime in the solar cell to get better and better performance of the solar cell. So, measurement of lifetime becomes very important whenever I am fabricating a solar cell and of course one of the key parameters which the manufacturer of the solar cell will keep monitoring is indeed the lifetime in the solar cell. So, lifetime measurement is important and this experiment really will tell us how to measure the lifetime in an existing solar cell. There are actually many fairly expensive and complex equipments available to measure the lifetime I will show you some of them two of them here. Here are two lifetime measurement setups can either use if you look see this is basically the photo conductance lifetime tester and it has an optional suns VOC stage and I can measure the lifetime in a wafer or in a fabricated solar cell using this fairly sophisticated setup. Unfortunately the problem with this is that it is sophisticated but also it is quite expensive this costs about 20 lakhs or so and therefore it is really not very easy to replicate when I want to get some simple estimate of the lifetime.


A state that is capable of doing this is a psychopath. A state that is capable of doing this is a criminal. It is a barbarian. It is a mass murderer. And to talk of peace, you can only make peace with human beings, with people who have some humanity. You cannot make peace with a psychopath, with a mass murderer, with a savage. And that is what the state of Israel is. Israel is the United States. Israel is the monster created by the United States and Britain before them. The only thing you can do with a state like this is resist this and bring it down. And South African people resisted. They were right to resist. They were justifying that resistance. And eventually the world woke up and rose with the people of South Africa and dismantled that filthy racist regime.  We have to do what they did in South Africa. We have to do what they did in Vietnam. We have to do what they did in Algeria. We have to do what we had to do here in Ireland. Resist them. So this is a fight for humanity. This is a fight for humanity. This is a fight for a civilized world against barbarians and psychopaths who care only about power and money and are willing to sacrifice their humanity for those things. So we've got to rise up. The only answer to this is Intifada. I also just want to say a word about comments made by the tarnished relation to myself, which I just think is really shameful comments where he tried to suggest that somehow because I was being very strongly critical of the Israeli massacre in Gaza and described the behavior of the Israeli state as being psychopathic that somehow I was spreading bile or hatred or is it really shameful comment? Richard, you also used the term filthy in relation to Israel and some people have described that remark as anti-Semitic. Do you think in the current environment perhaps you should withdraw that remark and in fact it is undermined some of what people might regard as legitimate criticism to bitter? Absolutely. I abhor every form of racism and anti-Semitism and it is precisely because I oppose all forms of racism and have a long record of opposing racism and anti-Semitism that I think the regime of apartheid that Israel is defending is an absolutely disgusting, murderous, racist system.


Roger, completely vlogged, Roger. Roger, I have to go again. Roger, bringing in the deck form and then they may be able to push him out a little bit. Roger, bringing in the deck, preparing to take the load. Roger, we'll see you again. Yep, I'll send you real quick. Yeah, good. I think we can pick up everybody right now. Yeah, just wait for the hull, we'll see. Yeah, that's great, that's a great idea. All right, Steve. From the 2 1 if you guys can all come, top deck, it'll make it easier for the Hoyt. 3 1, if you can come up to the top deck for the Hoyt. What'd you say? I don't know. Rescue Summoner from the 3-1, if you can all come, top jack for all hoist. Roger, good copy, that's what we need.