wish that everything was solid gold so if I get a Fitbit it's not going to be solid gold wearing on my wrist but I would say that about any watch in the entire world. You say that about any TV show that isn't solid gold. Do you guys remember the theme song solid gold? What's the name of the Gallagher duo the brothers that hate each other? Gallagher and Gallagher too. No. Oh, you mean Oasis? Oasis. Yeah. You know what Gallagher is. The other Gallagher. You think you're the British pop fan. Your magic roots showed with that answer. L-M-F-A-O the the American Oasis. Hello is it me you're looking for it's like there's a lot of things we're like that is an interesting detail to make into that song almost becomes insulting right? Hello, is it me?  Lytle I'm blind not deaf. How Sarah Lane just ate a three foot long sandwich? They had in you know their defense whatever I mean they gave me a sandwich that is you know should kill a person but they cut it into four pieces. Oh so it's magic. And the fans were kind of the short pieces and then the middle was you know the two like they were two large sandwiches. Yeah so I ate one to the ends and I was like dang this is good. I'll eat the other end. And then I was like right halfway there but I might as well get three quarters of the way. And then the last the last portion wasn't pretty. But it still tasted so good. I was like you know I'm committed I'm doing this.  Tune in and find out. Don't watch it alone. Can children reduce? It will terrify you. Can children raise your stress levels? Find out.  Softly. Have they already done it?  Are you dead and don't know it? Are you watching this from beyond the grave? The answer may surprise you. But that's what I'm saying like if you're on the moon your visible heavens would be earth above your head. And maybe that would work if we were on the moon which we are not Roger. We are not pirates on the moon. How earth centrips are? Oh Michael Sarah. Oh yeah C-E-R-A. Yeah. Does that count? It almost counts. Yeah different though. Sarah Sarah. I never really thought about the fact that that's my name just spelled super differently. I think you should you should look at Michael Sarah up and see what he's up to these days.  Let's have this conversation the other day with my coworkers. Hear me out. I don't know. I feel like bears yes they're large. They get a bad rap. They seem pretty cool to me. I would like a pet bear. No you wouldn't. I don't know. Oh my god. I was going down that road with you Sarah till you said pet bearer.  Well they're just bears. Don't hire a grizzly bear to guard your solar array in Alaska for goodness sake. When I was a kid they made me think that all rhubarb was going to kill me if I ate it. So it is. Oh that's a tragedy. I know. Well don't you have to just cook it so it doesn't point at you? No wait no Scott who hurt you? Who said this? Well yeah we're waiting time. I am your father. Oh lord. Wow that's a lot. No that's not it thank goodness. Scientifically not possible but okay. In my case big upgrade. Tom merits my dad. I love grapes. Grapes are amazing. I don't know why they turn them into wine just let me eat them. Well I mean it's that's why they make water. Sarah I'll let you take this one. Well Roger when you reach a certain age and you need to relax a little bit. You want grapes and you also want to forget. I think that wraps it up.


We've learned some new accounts related to the sale of inventory. Let's recap those and add a couple new ones. Sales revenue is the amount earned from selling goods. It's a revenue account. Sales returns and allowances is the amount of buyer returns or allowed deductions from invoice price. It is a contra revenue account, which means it has a normal debit balance. Sales discount is the reduction in the amount of cash received from a customer for early payment. It is a contra revenue account, and it also has a normal debit balance. Net sales revenue is a new term. It is the amount a company has earned on sales of goods after returns, allowances, and discounts have been deducted. It is not an account, but rather a subtotal. More on this in a minute. Cost of goods sold is the cost of inventory sold to the customers. It's an expense account. Gross profit is a new term as well. It is the dollar amount goods are sold for greater than the cost of the goods. It is not an account, but rather a subtotal. Again more on that in a minute. Since net sales revenue and gross profit are subtotals, we need to learn how to calculate both. Let's look at the data we used earlier from the sale of records from RCA records to championship vinyl. Recall that RCA records sells $3,800 of vinyl records on account to championship vinyl. Let's assume that those records cost $2,400. RCA receives a $500 return of the Taylor Swift records. Let's assume that the cost of those records were $200. RCA records receive payment of $3,234 from championship vinyl, which was the $3,300 owed less the $66 sales discount. The T accounts looks like this for the revenue and contra revenue accounts. Sales revenue had a credit balance of $3,800. Sales returns and allowance has a debit balance of $500 and sales discount has a debit balance of $66. If you're wondering where those numbers came from, I encourage you to watch the video entitled Perpetual Seller. Otherwise the calculations are the same regardless of the source of the data. Net sales revenue is calculated as sales revenue minus sales returns and allowances minus sales discount. It is the most important revenue figure because it is the most meaningful to investors and creditors. Here's an example. A few years ago I sold my Audi S4. It was a sweet car and as you can see from the photo pretty awesome looking. So I figured I'd sell it for a million dollars. I mean look at it, it's cool. Unfortunately no one else thought it was as cool as I did. So I offered a $990,000 discount and sold it right away. So which amount of revenue provides better information? The million dollars of sales revenue or the $10,000 of net sales revenue? I think you can figure that out. In fact I like that car so much I replaced it with these two but that's another story. Now that we know how to calculate net sales revenue let's calculate gross profit. In order to calculate gross profit we need to first figure out the amount of costs of goods sold. In RCA records made the initial sale costs of goods sold was debited for $2,400 the cost of the records. When the Taylor Swift records were returned costs of goods sold was reduced by the cost of that inventory of $200. So the balance in costs of goods sold is $2,200 debit balance. Gross profit is the difference between net sales revenue and costs of goods sold. It represents the amount of goods the goods were sold for greater than their cost. So RCA sold those vinyl records to championship vinyl for $1,034 more than they cost RCA records. Gross margin which is sometimes called the gross profit percentage is a ratio that shows how much of every sales dollars is going to gross profit. This is very helpful for investors and creditors when they compare companies of different sizes. Gross margin is calculated by taking the gross profit in dollars and dividing it by the net sales revenue in dollars. Gross margin is one of the most carefully watched measures of profitability by internal and external users of financial data. A small increase may signal an important rise in income. Conversely a small decrease may signal trouble. For RCA records the gross margin is 32% meaning that 32 cents out of every sales dollar is going to gross margin. You'll learn more about how gross margin impacts net income in an upcoming video entitled Multi-Step Income Statement.


Apologio, porque nós temos unha problema con Linux, então algo que não funcionaremos. O maior problema? Sim. Eu sou unha mecánica e engenheira, então eu apresento a vocês unhas systems na app que nós temos discutido no Task on Blender. Então esta é a página aplicada para Blender e não é no Master, e talvez unha vez, eu espero, será incluida. Sim. Eu sou unha mecánica e engenheira para visualizaciones arquitecturales e eu quero desenvolver unhas asas e fazer a Blender mágica para usar para o mais técnico, claro, não para o artístico, mas para quebuat es mágo para o artístico e engenheiros para oaintedar. Analbene con a aposta. Eu não entendo nada. 5 Fox, Kita are trying to display some of the format inside 5 Fox. Então talvez a entitled can press to add to the cover for palette. Ok? Ok, this one. Ah, ah no, this is the scape Non, eu necesito o Firefox, o que é que funciona? O Firefox é already here, ok? Oh, ok. Nice. So, non so good. So, maybe this one. So, Firefox is also right there on the second button as well. Ok, this is better. Ok. So, as I said, this is manual target and pick up points. So, ok. Excuse me. So, the project I'm presenting here is part of, I hope, a biggest project trying to give Blender more utilities to technical people, not only artists, because I think that most of things can be done easily than in Blender nowadays. So, the first part of this project will be is specifying base points or referring points to allow user to set exact references to an object. So, we add what's called manual snap targets that allow this. Try to start the Blender application. I don't know if we will possibly hope. So, it's not working, so because I cannot run Blender as itself because it's applied to Blender. It was working on my laptop but as what compile it for my system it was working here. So, sorry about this. Yeah, but it is no internet, so. The video of this working patch is in the presentation sector in Blender conference. You can go in our presentation description and there is video of showing how this patch works. So, you select the manual setting, so you first select a point on the object, point references, and then you can place on the other objects or some objects. It is done over the wall manipulator transforming code so it should work in all areas of Blender. In rotations, scales and also a graph. I can demonstrate to you. Now in Blender you have an object and you press G, graph, move, and you move all objects. Usually what the engineer wants to move objects precisely. So, what we've done is that you select objects, you press the exact point on edge and move that point exact to another point in the area. So, and it's done with our patch very easily. It is possible to do in Blender now but it takes like 5 or more steps to do. You can also set references on an edge or on a face, not only vertices. Also works with edit mode. The next part is our manual view points that are similar to the center of transformation. This means that when you go and rotate an object, you can select the center of the rotation. This allows you to select the centers and also in the scalars the same. You can select the center of the scale. This can be combined with the reference points already shown. Because you can first select the center of rotation and just use a point for a reference. So move from one point to another point. And this is only with... it's easy to do. Now in Blender it's really hard to make things well aligned. Another feature that has been included here is repeating operators but not as Blender does because the repeat operator on Blender is to be exactly the same thing you have done. So the idea of this is that it works and you do an operation and then for example a duplicate operation. You can duplicate one object and you can repeat with only placing the object, placing more objects as the element of object you want. And also this can be used to rotate an object. So these features are focused to make things more easy and more fast because in Blender nowadays it's really tedious to do some of these kinds of operations. No, it's not an array because you create a new object each time. So you make an operation and then the same operation you create a new object in another place and you can use with the other, with a snap and center to place, let's say, one object in this bar, in the other, in the other, in the other and really fast because it's just placing. Yeah, but no, it's not the same because it does not give input to the user. You do the same another time. So the idea is use the reference to just clicking, place, place, place, place. It's not the same. Yeah, so this project was for the Blender itself, modification of Blender itself. Also we preparing another addon. So it's addon. Yeah, all feature is not working now because our developer decided to go to vacation and joined Lithuanian army. So he will return in some months and finish it. But also there is a link on the Blender addon, in the Blender wiki page where all addons is. You can try these features but not everything is finished. But I can show what this addon should do. So basically it is an arrangement of custom properties. For instance, when a architect has some object, for instance, we have table. And we want to do not many tables, but one due to one table, then add parameters like height, width. And by changing these parameters, transform that table. But precisely, for instance, we have different types of table. Like one smaller, one bigger, one with four legs or with five legs or something. So we created the addon for making these assemblies. So we made this assembly editor and assembly selector. So how it works.  And then select that object and create the assembly from that object. And then the assembly is created. And then we add our custom parameters. So it's basically like custom properties but managed in more also in a more different way. So we add our custom parameters like width of chair, depth and height. And then we can assign these our custom parameters to the objects in a Blender. For instance, for the seat or for the height. And then while having one model, one chair model, we can change these parameters and have multiple types of the chair. Or it could be a window, for instance. We have one model of a window. But by changing parameters, we can have multiple varieties of windows. For instance, bigger smaller with one tile or more tiles. So basically we will create some more smarter objects. And without needing to remodel things. So basically we create these types. And then we can select these types and then change, for instance. Now we have this smaller chair and we change the type and we have bigger chair. So basically that's it. And who is interested in that, of course. After this talk you can go and finally we can show you on our working laptop how it works and without these technical difficulties. So thanks.


So, this chapter deals with more SQL features and the very first topic we are going to cover here are join expressions and outer join which a few of you had questions about. And then we will move on to views which we will do very quickly and then transactions, integrity constraints, little bit more on data types and at the end a bit on authorization. So, what are these join relations? So, as you have seen earlier one of the fundamental operations in databases is taking joints. So, in the original SQL the only way to do a join is to list all the relations in the from clause and then specify the join conditions in the where clause. This worked fine for inner joints, but how do you specify an outer join using this syntax? What is an outer join? Next we will see an example coming up right next to this. So, these are the two relations one is course and one is prerequisites. Now, what I have done here is I have made some changes in the original relations such that I have a course here 315 which does not appear here. In contrast I have a course here CS 101 which does not appear here, there is also CS 347 which does not appear here. So, if I just take course ID forget the 101 just take this one 347 is here, but not here 315 is here, but not here. Now, if I took the join of these two relations on course ID this tuple will match this one the second tuple would match the second tuple. The third tuple here would not match anything and the third tuple here would not match anything. So, the result would be just two tuples. In contrast if I say I want the natural left outer join what this is stating is that I want all courses to appear in the result even if there is no matching prerequisite. So, it is possible that a course does not have a prerequisite. So, this is not an unreasonable situation. So, if it has a prerequisite I want it to be shown with each of its prerequisites. If it has no prerequisites I still want it to be shown, but what value do I give for values from the prerequisite relation since there is no prerequisite they are going to be null. So, that is the meaning of the left outer join. So, see what has happened here this is the natural join version you are familiar with natural join. So, whatever attributes are common are equated. In addition now whenever they are common there are two copies of attribute one from this relation one from that relation. So, what natural join does is it removes the duplicate attribute and keeps just one copy of the attribute. In the case of outer join this is actually a little tricky. So, if you see course ID title department name credits come from the course relation the prerequisite relation has course ID and prerec ID. So, now we had 315 which did not have a prerequisite. So, it is coming as is the attribute from the prerec the prerec ID is going to be null. It turns out that the prerec relation also had a course ID attribute. Now, there was no matching tuple. So, if I took course dot course ID it is here prerec dot course ID will be null because there is no matching tuple, but since I did a natural join the two copies course dot course ID and prerec dot course ID are actually combined into one. In this case one of them is 315 the other one is null, but still it is combined and the non null value is kept here that is how natural left outer join is defined. If I use the other versions of left outer join which we will come to in a little bit it is going to look a little different, but before that the natural right outer join is similar except the right input in this case prerec is preserved. So, what are the attributes of prerec course ID and prerec ID those are preserved. So, CS 347 101 appears in the result what about the other attributes from course which are title, department name, credits well they all have to be null over here. The first two tuples again are the same as in the regular join and then there is the full outer join which is a combination of the two. So, it has the inner join the normal join results here then this one is the left outer join extra tuples these are the extra tuples from the right outer join. So, full outer join preserves both inputs. So, that is conceptually what is a natural outer join outer joins can also be defined using join conditions I will show you the syntax and then we will see some examples. So, in SQL the syntax is as follows you can specify a join type and a join condition. The join type could be inner join which is a normal join left outer right outer or full outer the join condition could be natural which means equate all attributes whose names are the same in both sides. It could be on predicate. So, you can give any predicate on whatever condition you want and then there is a last form using which lists a set of attributes and what it requires is that these attributes have to be in both sides and they have to be equal. If there are some more attributes which are there in both sides they are not equated they are left alone whereas, natural join will equate every attribute which is common. So, using is a restriction of a natural. So, now let us see some examples course inner join prereq on course course id equal to prereq dot course id. So, this is the inner join just the first two tuples. The second one is course left outer join prereq on course dot course id equal to prereq dot course id. Now, note here that course id appears twice because it is there in both relations. So, this one is course dot course id this one is actually prereq dot course id. Now, if you look at this last tuple the course tuple is there in full and all the fields from the prereq both the fields are null. So, that is a case of left outer join on a condition the natural one just removes the duplicate columns. Here is course natural right we have already seen this and this one is full outer join the table here corresponds to full. So, since the only common attribute is course id this is exactly equivalent to the natural full outer join which we saw earlier. So, that is it for outer joins if you have doubts please ask me otherwise I will move on. The next topic is view definition we have already seen the width clause. So, what we have is a query whose result is given a name and in the width clause that is available only in that query. In contrast when you create a view that definition is stored in the database and it can be used by any query which is running on the database. So, the syntax is create view v as query expression. Note that when you create a view v v is a relation it looks like any other relation, but it is not actually stored in the database at least by default there are ways of asking for it to be stored we will come to that later, but by default it is not stored whenever you use v it is going to be computed as required. In fact, it would not even be fully computed what happens in reality is if you have a query using v the use of v is replaced by the definition it is called view expansion we will come to that. So, a view now is basically a virtual relation which is not necessarily stored defined by the view expression. So, here is an example create view faculty as select id name, department name from instructor. Now, what is this view doing it is giving you instructor, but minus the salve maybe salve is sensitive piece of information which should not be revealed because for all of us from government institutions a salve is not a secret it is supposed to be published on the website. However, in other places the salve is usually closely held secret. So, maybe you want to make these fields available to everyone, but not the salve salve is only made available to authorized people. So, that is an example of a view. So, now somebody can write a query using faculty select name from faculty where department name equal to biology what is the database system do it will actually replace this by this expression and then evaluate the query. You can also do other stuff in a view. So, that was that view was for hiding information this view is computing something complex and allowing you to use it without recompute well without rewriting the expression. So, what is it doing for each department it is computing the total salve and making the view available. So, this is a function definition. So, we are creating a library of functions in effect and we can use that function whenever we want without worrying about how it is defined that is the use of this view over here. So, this is a function of authorization if you are authorized to use instructor you could do that. I will be seeing authorization, but it is a possible that you are not authorized to see salary. So, you do not have any authorization on instructor, but you may be given authorization on the faculty view in which case you can write this if you write that it will be rejected even though the result is the same in this case that will be rejected. Now, you can cascade views just like in the with clause we had one thing used in the next definition and so on. So, this is a very simple and do not bother reading the whole thing it is not worth it, but I will just point out that this is creating a view physics fault 2009. This is creating another view using this view in the from class. So, that is all I want to say here conceptually what the query engine does is wherever a view was used it is going to replace it by the definition of the view. So, here this view was used here the view defined here is used here. So, what is going to do is actually replace this by this whole expression from here down to here as a sub query. So, that is actually what the database does. So, this whole thing was put in place. So, that is basically the semantics of a view in SQN. So, view expansion is basically formalizing that idea of replacing you may have to do this multiple times. So, you replace one view by its definition, but that itself may use another view. So, that is replaced if you keep doing this eventually you will run out of views to replace and you will have a regular SQL big expression, but one which is not using any views and then that is evaluated. And once you have a relation in the database you may be tempted to update it. What prevents you from writing? Insert into faculty values 3075 green music. You can write it in SQL nothing prevents you. The question is what does the database do if you try to do such an update? There are several options. One option is the database can say look this is a view you are not allowed to update it you can only read it and that is what the initial implementations did. Later people said look why cannot I allow this person to insert a faculty with the salary set to null. Now, this person does not have access to salary. So, they cannot give a value for salary. So, the if you use the faculty view it does not have access to the salary. Now, I cannot actually put a tuple into this relation because it is not a real relation. I have to insert something into instructor. And if I insert into instructor what value do I give for salary? I can say well let me make it null. This is not a good example. You probably do not want to create an instructor with null salary. But there are other examples where it makes sense to use a null value or a default value. So, some many databases do allow you to do simple updates on a view insertion deletion and updates with certain restriction. Deletion is actually a problem.  Well insertion does not have that problem. Update is a little easier. So, if I updated the department here that is probably not a problem. But again it depends on the authorization you are given. So, by default most people would be given read authorization on a view. But if you allow update authorization on the view then maybe you will be allowed to do this. But again general thing is do not do this. This is really for database implementers who worry about what if somebody does this, what should we do? Let us define it clearly. But as a user you probably do not want to use these features. It is just going to get you confused. Excuse me. So, if you do not have the primary key contained in that view for that relation then you cannot. Yes, there are many issues like that. If you cannot identify a specific tuple then there are some view updates which cannot even be translated. So, there are there is some information on these slides. But in the interest of time I am going to skip this. If you are interested it is there. There is in fact a detailed set of rules in SQL which define when you are allowed to update views. But my advice is do not even try to update views. It is not worth it. We can have read-only views also. There are some syntax for creating read-only views. That is database. There is no SQL syntax for creating a read-only view. And then you can grant somebody select access on that view instead of granting update access. So, then they can only read that view. So, that is the function of the authorization maker which we will see later in this chapter. Sir, one more. Sir, normally when we say when we speak about views only the definition is stored in the memory. What do you mean by that? Is it the structure? So, let me rephrase that. When we create a view the view definition that is the SQL syntax is stored in the database. It is stored in a special relation. The actual content of that view which you see when you say select star from faculty that is not stored by default. All that is stored is the actual view definition that text SQL query is stored. When we try to refer to the view it has to scan the table and get the. So, what it does is there is no table for the view. No, no, the view has to be made on top of the table something. Yeah, the view is defined on a existing table. So, will it be slow when we try to work with views compared to tables? No, it depends on the query, but bottom line what happens is if you use a view it actually replaces the use of the view by the definition. We just saw an example. You had a query which use the view. Now, that view relation is replaced by a sub query and that is the query which is evaluated. So, the view actually vanishes from the query once you have replaced it. Now, is this going to be inefficient or efficient? Well, that depends on the actual view and the query optimizer and so on. But the fact that you are using a view does not make it inefficient. That is involved in view because this was we have experienced in practical when some project was been developed. So, using views and the content which has been accessed to the particular view. If it is smaller, then no problem. If it is larger, then there was. Yeah, like it depends on the query. So, supposing you had a view like, take the simplest view, take this view, view faculty. Now, maybe there are a lot of instructors. But if I have this particular view, said department name equal to biology. Now, if the original relation has only a few tuples in biology and it has an index on department name, we can actually use the index to find just those instructors quickly. Or if this query instead of saying department name equal to biology, said id equal to 10101. Now, the instructor relation actually would have an index on id because id is the primary key. So, pretty much any database would automatically create an index on the primary key. So, those queries will run very efficiently. Now, it is not computing all of faculty. If you compute all of faculty and then select, it is going to be slow. But that is not what the query engine will do. It will only pick the subset of it which is actually useful, which in this case will be the instructor with department name biology or id equal to 10101. So, the actual plan does not necessarily compute the view, full view. View can be huge, your query may only access a part of it and the query engine will take care of it. But anyway query needs to be executed, whether it is stored query or it is executed directly. So, the efficiency, issue of the efficiency, I do not think comes in the picture.  Whether you directly enter the query or you use the query to view. Yes, exactly. That is how I think. I disagree. Okay. Medina's view I have not covered yet. I think the query is going to be executed only once. But when you use a view, every time whenever you use it is like a macro substitution. So, this is a macro substitution. This is the part I have covered so far. Now, there are situations where, you know, the view has to do a lot of computation. So, supposing I have a very large relation, sales relation. And I want to find the total sales of each type of item, each product that is there in the database. And I have millions of tuples even more. And the query says, the view says the group by item and count maybe, how many items were sold. So, this is a view which whether you write a query on the view or write a query directly. Either way, it has to access millions of tuples when you run the query. Now, this is where the query can be inefficient. So, an alternative to having a plain view is to actually materialize the view. So, what we were just discussing is called materialized. So, what is a materialized view? It is a view definition whose content is computed and actually stored in the database. So, supposing I had a query like this. I have a sales relation item and maybe transaction ID, let us say number of those things which are sold. That is a given relation. So, I create a view total sales as select item sum on number group by, this may have other information also. But let us ignore that. So, what I want here is this query result. Now, the sales table is usually very large. It may have millions of rows, but the number of items is usually much smaller. If you go to a supermarket, yes, they have a lot of items, but it is probably of the order of 10, 20,000. Whereas, their sales are probably millions. So, this result is going to be much smaller than that. So, if I materialize this view, if I actually create, I compute this query result and store it. Then, if I write a query on using this total sales view, it can just look it up quickly without reading the whole table. So, that is where a materialized view is useful. Now, there are a few issues with materialized views. And the first is, once I materialize this result, what if somebody goes and adds a few more rows to the sales table? Now, this materialized result here is not going to be consistent with that. The moment an insertion happens here, this is out of date. So, what do I have to do? I have to update this. This is called view maintenance. So, every time this is updated, I have to update this also. But, who is I? So, there are two answers to this. Generally, it should be the database system itself. So, if I tell it to create a materialized view. Now, the exact syntax, I cannot just say create materialized view. Unfortunately, that syntax is not standardized in SQL. Each database has its own variant of this syntax. So, whatever it is, if I specify that, when the database supports materialized views, the database will do the following. It will create this result and store it. Moreover, when this is updated, this will be also updated. Again, there are different policies. So, there is immediate and then there is deferred. Immediate means the moment you update this, this will also get updated as part of the same transaction. And that is the default behavior, for example, on SQL server. An oracle, on the other hand, if you do not say anything, it will not update immediately. It will update when you use this view. So, it is some form of deferred maintenance is the default. Also, in oracle also, you can say do it immediately. So, these things are not standardized unfortunately. SQL does not have a standard for this. But you can use this on most of the major databases. So, oracle supports it. SQL server, IBM, DB2, I believe Sybase, all the commercial ones support it. But PostgreSQL does not. It does not support materialized views as of now. It may get added at some point. So, then if you want to do it, what do you do? You could still create a relation like this. And then you could create a trigger to update this. Every time something is inserted here, the trigger can update this. So, now the view maintenance is done by a trigger which you have written, as opposed to the database system automatically doing it. Any questions? I want to briefly mention transactions. All of you are familiar with transactions. Anyone here who is not familiar with transactions, raise your hand. Otherwise, I will skip the details. So, you are all familiar with it. And now on every database today, by default, every SQL statement runs as a single transaction. So, if you just run an SQL statement, it immediately commits. So, if you want a piece of work which covers multiple SQL statements, you need to tell the database specifically that all of these statements together are one transaction. Now, how do you do that? That is something in the SQL standard, but that is not implemented uniformly. So, there are basically, in SQL, the syntax is supposed to be, you say begin atomic and then give any number of statements and then say end. If you do this, it is supposed to execute all of them. And if you roll back at any point in between, all the updates done up to that point are supposed to be rolled back. The only problem is nobody supports exactly this syntax. But in PostgreSQL, you can say begin. Do not use atomic. Just say begin, semicolon will begin a transaction. Then we can give any number of statements. In the end, we cannot say end. We have to say commit or roll back, one of the two. Commit to commit it, roll back to undo the effect of all the updates which have happened from the corresponding begin. Or the other option, if you are not directly using SQL, if you are using JDBC or ODBC, for example, you can turn off auto commit for a session. How many of you have done turning off auto commit using JDBC or ODBC or any other API? Any of you have done it? No. How many of you knew that you all know what is the transaction? You know that you can do multiple updates and then commit them all together or roll them back? How many of you knew that the default is every SQL statement is a transaction? Few of you. So when you are using JDBC, the default is every SQL statement you give is immediately executed and committed as a separate transaction. If you want this effect that multiple SQL statements are treated as one transaction, there is a way to turn off auto commit. We will see that syntax later when we come to JDBC. It's like connection.set auto commit false. Now once you do that, then the effect is exactly the same as this begin. Subsequently, all the statements which you submit, one after another, will all run as part of the single transaction. And only when you say connection.commit or connection.rollback, will the transaction be finalized? So if you say commit, all the updates are committed. If you say rollback, all the updates are undone. So that's outside of the scope of SQL. In SQL, this is the way to do it. And we will actually be playing around with this on the last day in PostgreSQL. So that is it for transactions in SQL. Now let's look a little bit at the data definition language. We have seen data manipulation in detail. We saw a little bit of data definition at the beginning. Now we will look at a little bit more on data definition. In particular, integrity constraints. Now I hope most of you are familiar with the basic integrity constraints. Not null, primary key. There is also a unique. And finally, the check predicate, which I will cover in a little bit. Not null, you are all familiar. I am going to skip this. Unique is basically similar to declaring something to be a primary key. But primary key has some other implications. Unique simply says it's unique. And one of the other differences for a primary key, you are not allowed to have any value being null. In unique, it's okay if some values are null. This is not very widely used. Not null is used. It's required in many, many cases. Now check is any arbitrary predicate. So for example, in our schema, university schema, we had semester, which is wire care six. Now you could put any value you want in there. We don't want that. We want only a few valid semesters. So there are just four possible values for semester. So one way of enforcing that is by having a check. Semester in and then list the values. So whenever you insert or update a tuple, if semester is not one of these values, the check fails. And that update or insertion will be rejected. That's the idea. So a check clause can be useful this way. Now is there a way to do this without using a check clause? No, not that. Well, you could, but that's not what I was looking for. The goal is that to enforce that semester must be only one of these four values. It will require a schema change. You are familiar with foreign keys? So how will I use foreign keys to enforce this? Yeah. We'll create a separate relation, which we can call for example, semester master, which has all the possible semester values. In this case, just these four values. And now what should you insist that the semester value here must appear in that table? Now how do you specify that? It's coming up in just a bit. If you already know it, it's fine. If not, I'll get to it in a little bit. So that's the other way of enforcing this. So how do you create a foreign key constraint or it's also called referential integrity constraint? Let's forget the details of the slide. Now here is an example of referential integrity. We have created a table course where course ID is primary key and then there's title and department name. Now note this last fellow here. Department name references department. So this insists that the department name in course must exist in the department table, in which attribute of the department table is the primary key because we have not specified anything more here. We just say references department. It means the primary key. In fact, foreign key constraints have to be on primary or unique keys in SQL. So that ensures that I cannot throw junk values for department into course. Similarly, if I had a semester master table, we'll come to that. Now here is another example. Course. It's the same one, but there's a little bit more. This one just says department name references. This is an alternative syntax. I can say foreign key department name references department. This is the same thing. It's just another syntax. But in addition, I can add these two things. On delete cascade, on update cascade. Now what is this doing? So if that department name is deleted, what this is going to do is delete all the courses from that department. Is this a good idea? Probably not. This is just a toy example. If you delete a department, you don't want to wipe out all courses from that department. Then if somebody had registered for that course, you're going to lose that information about what that course was. But this is just a toy example. The other part is useful. On update cascade. Supposing you decided to change the department name for some reason. Then if you update the department name, then the department name in course will also get updated. So this is actually useful in certain situations where the primary key value itself is updated. Then it makes sense to cascade the update. Now for example in IIT Bombay at one point, student roll numbers were updated sometimes in certain situations. That is a bad idea. But assuming we have to update it and we have a relation which says this student takes this course, we better update the roll number tuple in the takes relation and in other places also. Wherever it occurs, we better update it. So then on update cascade would have made sense. Coming back to the check semester, this one, if I wanted to create a foreign key for this, what would I do? In this table, I will say semester, where care six, references, whatever that table is, semester, master, table, etc. And in that table, I will have to insert four values, fall, winter, spring and summer. Now here is some interesting issues with the referential integrity constraints. So here I have a person table with a name, mother, father and an ID. Now what I would like is to say that, father is a foreign key referencing person and mother is a foreign key referencing person. So if I store the father and mother values, they have to be there in this table. That is the idea. Now what if I do not store father and mother values? I can set the value to null. Both of these can be null because I have not said not null. So a foreign key reference here can be null. That is okay. But if it is not null, then that thing had better be present in this table. So both of these should be IDs. If they are not null, there should be a valid ID, which is also in this table. That is the idea here. Now how do you insert a tuple into this table? Well we need to have the father and mother IDs. How do I insert a series of values into this table? One way is to start from the oldest ancestor, insert that first, then their children, then their children and so forth. So if I order the insertions properly, then there would not be a problem because when I insert a particular tuple, the father and mother tuple have already been inserted. But that is more work. If I have a relation already available, I will actually have to sort that relation properly and then insert in order, which is more work. What I would like to say is, here is a set of things. Insert the whole thing. But please don't check for foreign key violation. The moment this tuple is inserted, wait till I am done inserting a whole set of tuples, then go back and check the integrity constraints. If I am allowed to do that, then the ordering is not important. So that is the idea here. So it is possible in SQL, again not all databases implement this properly. But as per the SQL standard, I can give a name for this foreign key constraint and then set, in this case, I have taken these two constraints and declared them as deferred, which means they will not be checked immediately. When the insertion happens, it will not be checked. It will be checked at the end of the transaction. So that is the idea here. Any questions? Suppose I have a very typical situation. Say I am creating library members table and there the members could be faculty or staff, which are faculty or students. There are two separate tables. Now the foreign key needs to refer to either of them. Yes, this is a very good question. I am glad you asked this question. So to repeat this question, there is a very common situation where let us say in the library, in this example, faculty are allowed to withdraw books. Students are in some case even outside institutions and so on. So when I have a particular tuple in the issue relation, the ID there can be a student, can be a faculty, can be one of the other categories. So what I would like to say is this value should reference one of these different tables. That is what I would like to do. Unfortunately, SQL does not allow it. There is a rather complex workaround using table inheritance. So if it is supported in your database, not all databases are supported, but if it is supported, you can create a table which is let us say library member and then student, faculty and whatever other categories can be created as sub-tables of this library member table. And then the foreign key can reference the library member table. So that is workaround in the SQL standard, but implementation is spotty. But that is not pure relational. It's object relational, extension of SQL. So in pure relational, we don't have any... Unfortunately, no.  You wonder why haven't they put it in the standard? It would be so useful. This is one of the examples. Table inheritance, it's not very standardized. Only a few databases support it, and each one which supports it does its own syntax and semantics. It's a mess. But the major ones, I think Oracle DB2 certainly support it. I'm not sure about SQL server. PostgreSQL has a type system, but I don't... Oracle certainly supports. Now, here is another example of a retent in SQL which relates to the schema we have. Now, I don't know if you've seen this relation, but in our university schema which is used in this book, there is a relation called time slot. And that relation has a time slot ID and a specific time. So for example, a particular time slot ID one, it'll say it meets on Monday 8.30 to 9.30, so there are different rows in this table. In the time slot table, there are three or four entries for the same time slot one. Then there'll be again three, four entries for time slot two and so on. So what is happening is this time slot ID is not a primary key of the time slot relation because there are multiple entries. Now, what I would like to say is each section has a time slot. What time does this section meet? Which time slot doesn't meet in? I would like to be able to say that this section meets in time slot one. I can store that, but I would like to say that this is a foreign key referencing the time slot relation. This value one here had better occur in the time slot relation. Unfortunately, in SQL this is not possible because in the time slot relation, time slot ID is not a primary key. It can occur multiple times. So in the time slot relation, I have time slot one, Monday 8.30, 9.30, time slot one, Tuesday 9.30, 10.30. And in the section relation, one of the fields is time slot. There are of course other fields and I'm going to say for a particular time slot one, another one is time slot two. What I would like to say is that this value here must occur in the time slot relation and that's a foreign key or to be a foreign key. Unfortunately, in SQL a foreign key can only reference a primary key over here and in this relation, this is not a primary key. The value one is occurs many times, so it's not a primary key. Therefore, I'm not able to create a foreign key reference. Why don't we do two number to the second time slot? No, I want to say that time slot one meets at these three times. In this case, two times. Twice in the week it meets. So there is another way of doing it which is again not very satisfactory. I could have a time slot ID relation which says time slot one, two and so on are valid time slots. And then this one time slot here can be a foreign key referencing time slot ID. So this will make sure that these values occur here. But how do I make sure that this value occurs here? How do I make sure that every time slot actually meets sometime or the other? Unfortunately, there is no way of enforcing that in SQL. Now, what this first check clause over here is trying to do. Unfortunately, it doesn't work. What it's trying to do is to say that time slot ID is in select time slot ID from time slot. We saw the check clause earlier. So it would be nice if you could just write this as a check clause for a relation. But this check clause is special. What it's doing is it has a sub query referencing another relation. Unfortunately, no SQL implementation today supports this. So this is one of the things which is actually very hard to enforce in the database. You can enforce it out in the application. In the application, you can always make sure that if you put a particular time slot for a section, you can run a query to make sure it is present in the time slot relation. So that can always be done. In positive SQL, I found a solution. We can write a function, and that function can be called here. Check and then function name in positive SQL. I'm not sure it will do the right thing because if the thing is subsequently deleted, let's say you have a reference. So you have a time slot right now. It may not be in particular situation, but instead of using sub query, we can write the function which has the sub query, and we can use that function. So what that would do is when you insert into the section table, you can run the function and make sure it is present. But the catch is that supposing subsequently the time slot is deleted, it may not detect that. So it may check it at insertion time, but it will not enforce that it is always present. Subsequently, the time slot may be deleted and you have a dangling reference that will not be deleted. So that is it for referencing. Now there are a few more small details of SQL. There are built-in data types. I won't get into the details. There is date, time, time stamp. Now time is time of day. Oracle for some reason doesn't support this. Such a basic thing, but others do support time. Then there is time stamp which is date plus time of day. Then there are indices we will see those later on. Create index is reasonably standard syntax. We will look at it later. Then there are large objects. You are familiar with this. If you want to store an attribute, it generally has to be small within a few kilobytes, one or two kilobytes typically. If you want a large object, you have to create a type which is one of C-Lob for character large object or B-Lob for arbitrary binary large object. And then the way you access this is also a little bit different. You won't get into details. To wrap up this chapter, we have authorization specification which is the grant statement and the rework statement. Those are the two basic things. The basic syntax in SQL is you have an authorization. You can grant it to somebody who has the primary authorization. The database administrator has authorization on everything in the database and you can grant it to specific people. If you have an authorization, in certain cases you can grant it to others. That is the authorization model. Let us look at this by example. Before that, the basic syntax is grant a privilege on a relation, view name, procedures. There are a few other categories here. There are two user lists where user lists could be a database user or it could be public or it could be something called a role which we will see in a little bit. So, what are the possible privileges in SQL? Select which lets you read values from that table or a view. Insert the ability to insert tuples, update, delete and all privileges is all of these. If you have granted someone a privilege, you can revoke it by saying revoke in the rest of the syntax is the same. So, revoke select on some relation called branch from these guys. Now, the notion of roles can be useful. But in the interest of time, I think I am going to skip this. I think I will just stop there because it is 1 o'clock. If there are questions on authorization, I can get into it. One of the reasons I am skipping authorization is, well, it is two-fold. One is that the authorization mechanism of SQL was designed in an era where users typically directly connected to the database and run queries. Today, how many applications do you know where users directly connect to a database and run queries? How many times? Outside of courses like this, nobody connects to a database and runs queries directly. So, it is always through an application. And at least in today's scenario, applications have all privileges on all relations which they access pretty much. There are a few cases where this is not true. But in general, the authorization mechanism is useless when you have a web user. So, someone connects to a web application. The database has no idea that there is such a user on the web. There is no connection between the web user and the database user. So, the database authorization mechanism is totally irrelevant for this web application which is handling users connecting through the web. It may not be a web. It can be any other interface. But today, the web is the standard. So, the whole authorization mechanism of SQL today is of limited use in these kinds of scenarios. The one kind of scenario where it is useful is we actually do this in IIT. We have our applications running on our intranet. We do not want to make it available outside because it is susceptible to hacking. We are not completely confident it is secure. We believe there may be some holes. So, we do not expose it outside IIT. On the other hand, when our students go home, they still want to see their grades as and when they are assigned. So, what we did is we built a few of the interfaces which are read-only. We put on an externally visible website. Those things though, those parts of the application, they are not going to modify the database. So, what we did is we created another user with read-only access to those relations and the external application uses that login and password. It does not use the regular login password for the login which has update privileges. So, even if somebody breaks into this external facing system, even if they get the login password, they can only read our data. They cannot update it. So, this is one level of protection which we have used. So, here authorization, select authorization without update was useful. But beyond this, it is not... The complex schemes which SQL supports using roles and so on are no longer that relevant for real-life applications. But it is there in the standard because it was put in. Any questions? Yeah. So, in the database, how can we define a non-primitive data type? Like a fingerprint. Okay. And can it be a primary key? Okay. So, first of all, you know, if fingerprint is a small thing, if it is, you know, you can use a character, if it is characters encoded as characters, then it can be a primary key. But if it is a large object which is more than a few kilobytes, it can only be stored as a B-lob. And that cannot be a primary key. That would not be allowed. So, in general, if you want to store fingerprints as a B-lob, you can. Now, why is this restriction? You know, why does it matter? Who cares if it is a few kilobytes or more? This is to do with the internal storage representation in the database. So, all databases store records in pages in the database. And the assumption is that a single record will fit inside a page. It should not overflow a page. Because if you allow records to overflow a page, managing records becomes a lot more difficult. And a page size typically is of the order of 16 kilobytes. So, pretty much any database will insist that a record should be smaller than a page, and an attribute will be correspondingly even smaller, a few kilobytes. So, it's an implementation restriction. That's the reason you have to declare a B-lob or a C-lob, which is actually stored differently. It's not stored with the tuple. It's actually stored separately, and the tuple has a pointer to it. So, it's not an inline. And the way you access it also. So, when you access a B-lob, supposing this blob is a gigabyte, and you access it, and the whole gigabyte is loaded into memory. Well, of course, today a gigabyte doesn't sound large. But if your machine has one gigabyte of memory, you can't load a gigabyte into memory. There's not enough space. There's other stuff in memory. So, the way you access B-lobs is similar to using a file. So, you can read bytes from the blob, or you can write bytes to the blob, rather than fetching the whole blob at once. So, that's why databases create a new type called blob. And the way to access a blob is also different. I'm not showing you examples, but you would access it programmatically by reading or writing to the blob. Any other questions?


Hello everybody, I'm EvilRabbit, we're here on Assetta Corsa, so if you guys follow the channel you guys know I recently picked up a 2004 WRX and getting it on the road. So I thought it would only be fitting to bring out one of the old DCGP 2020 cars and that of this Subaru, it was in third gear apparently, the Subaru STI drift car here on Assetta Corsa and go full send and have a little fun because well, since I got the WRX, you know I'm building a full spec drift car here on the channel. Make sure you guys follow me on all social media, I'll try to find the description box below, well let's get to it. This was probably one of my favorite cars back when this car pack was out in 2020. The Team Orange WRX was probably one of my favorite cars when I was younger, when they were out drifting, it was just such a cool car that the Evo. I remember the first drift game that I played was D1 GP on I think it was PS1 and it had the Team Orange Subaru on it and I loved that car so much and this car still gets down from being unmodified, I've just re-downloaded the 2020 pack just to find this car again.   I'm not going to need to build myself a left hand drive one for aesthetic purposes of the car that I have, oh all this thing is so much fun, oh we're getting it on this mountain road, oh I don't know if we're going to get that, oh we got it, I love drifting, oh my gosh, and third person for these videos so you can see the whole course and where the car is. So if you guys remember this car pack and the cars that were in it, let me know down in the comments because this like I said was probably one of my favorite cars that was in that car pack and I've always loved this body style Subaru, the iconic, you know, Blabby, just sounds so good too, definitely going to have to keep the engine in the car when I build my drift car to keep the sound here in the center course instead of going V8 door, 2J in it, oh we're going back, yep, we're good, we are good, oh just a little wall tap, we managed to finish this little rally stage without an issue, I think we should flip the other way, oh on the RPF1 which is very traditional for most Subarus, you guys did not check out that first restoration video of the WRX on my channel, make sure you guys check it out because it's definitely kind of cool to have a WRX and have a cool car again, oh my how did we not die there, I'm having so much fun bringing back the memories of this car, wish I could find the original download with the Team Orange livery, I may just have to make that Team Orange livery myself to make this fully iconic because the download now has the of course the DCGP ones and used to have the Team Orange ones so if anybody has the Team Orange livery from before they changed it, let me know down in comment section below, I'd really like to get that one off you, oh up the wall, I think that was our first real big mistake, oh so if you guys are excited for all the drift content and everything that's a big things coming with some new products and things like that going to be released here soon, so big thank you to those companies so definitely look forward to seeing that here on the channel bringing you guys that stuff as well as new games coming out with the Forza around the corner, I'm super excited to get back into some motorsport but we are just annihilating this hill, this car is so good, I forgot how good this car was, the giant wing, big wing gang, so if you guys are also excited for FD this weekend let me know down below which who you think is going to win FD here this weekend, super excited, oh have more action on the course in real life, oh that was a hard lock, we got this, I think this car drives so good, modulate the left of the brakes there, I can't, yeah this car is too good, definitely going to I think leave this one as it is, maybe get the team orange livery on it, like I said if you have it let me know down in the comments I would like to pick that up from you because I would love to get the team orange livery back on this car and then probably start the project of building my own drift Subaru here in the center course, so if you guys enjoyed this episode make sure you guys follow me on all social media, all of which are found in the description box below, as always I thank you guys for coming back and watching, I'm the full rabbit, I'll see you guys on the track, oh well that's a wall


Today I'd like to talk to you about solutions, particularly as solutions relate to electrolytes. And as we do this, let's just review a little bit about what we have when we have a solution. Solutions are homogeneous mixtures of two or more substances. When we have a solution, we typically will have a solute and a solvent. There can be more than one solute in a solution. The solution is defined as that which is present in greater quantity. It dissolves solutes. Solutes are dissolved, they're present in lesser quantity. So literally what we're talking about here then if we skip down here to concentration, concentration is the amount of solute that's in a given amount of solvent. It can also be expressed as the amount of solute that's in a given amount of solution. So in doing that, we basically have defined and reviewed what we need to review. Let's talk about electrolytes for just a second. Electrolites are a topic that we hear a lot about because electrolytes are items that we need in our body. There are producers of sports drinks and other types of drinks that will essentially replace the salt solutions, the electrolytes that our body loses during the day whether we're exercising or just walking around. These electrolytes are important because they actually allow our body to conduct business the way it's supposed to. Electrolites by definition are going to be conductors of electricity. They are essentially solutions which have ions in them. Our bodies are filled with these. If we do not have enough ions, we can't get the flow of electrons through our body as we need and it can result in actual death if we don't correct that. If we look at these two equations, I have listed here sodium chloride which is salt When sodium chloride is dissolved in water, it forms sodium ion and the chloride ion and you have your water. These are solutions that are essentially what we call strong electrolytes. These electrolytes are completely dissociated in the solution. If you put a meter in the solution, you would find that there would be conduction of electricity through that solution. There's also a really neat experiment where you put essentially a light bulb in and you can see how the solution conducts the electric current and allows the bulb to light. If you do the same thing for sugar and you dissolve a certain amount of sugar in water, what you find is that the sugar becomes liquid. It mixes with the water. It dissolves but the sugar does not ionize. So the sugar solution will not conduct electricity. If you do the same test with the sugar solution that you did with the salt solution, the light bulb will not light up because there's no electrons flow within that solution. You have to have an electrolyte to do that. As I mentioned earlier, this is a strong electrolyte. Strong electrolytes are completely dissociated. There is such a thing as a weak electrolyte. Essentially what happens there is that in a solution of water, the acid will dissociate into ions but it will never completely dissociate because as these ions form, they tend to recombine and form the reactant again or the acid again. In instances where you were comparing the two solutions, this solution which was a strong electrolyte and this solution which was a weak electrolyte, if you were using a light bulb test, you would find that the light bulb would be much brighter here because you have more stable ions than it would here. When we talk about concentration in solutions, we're primarily or at least if not primarily a good bit of the time, we're talking about molarity. And molarity is defined with a capital M or it symbols a capital M. It is defined as moles of solute per liter of solution. Moles of solute per liter of solution. Now a lot of people are mixed on this but I love these triangles because the triangles are so useful in teaching this concept. They work this way. If you cover up molarity, you can see that molarity is defined by moles over liters. If you wanted to calculate the number of moles that are in a solution, if you cover up moles, essentially what it's telling you to do is to multiply molarity times liters. And if we were interested in the volume, you would cover up volume and you would determine that molarity divided, I'm sorry, moles divided by molarity would give you your volume. Three reactions or three mathematical manipulations you can do using this. For people who are good with mathematics, good with algebra, all you need is that molarity is equal to moles over liters and you can manipulate that to solve for whatever you need. So that's certainly an important thing. Now suppose you have a solution and that solution has a concentration which is not what you need and you add solvent to that concentration. The question is, what have you done to that solution? Think about it another way. Suppose you have Kool-Aid that has too much sugar in it, what are you going to do? Well most people if you had a little bit more Kool-Aid mix would add more Kool-Aid mix and then dilute the sugar with solvent which is water. In chemistry we do pretty much the same thing. When we do it, it's called dilution and the equation listed here M1B1 equals M2V2 is known as the dilution equation and this equation is used only in instances where you are diluting a material into something that is more dilute but you can also use it in another direction to determine the amount of concentrated solution that is needed to form a large quantity of diluted solution. So what if I told you that you have two liters of solution that has one mole of sodium chloride and I ask you to determine the molarity. Looking at our molarity triangle if we cover up molarity it tells us to divide moles by volume. In this case we have the one mole of NaCl divided by two liters of solution and we find out that the molarity would be 0.5M which is basically 0.5 molar. So that would be an example of a calculation done from the triangle. Okay suppose we took this 0.5 molar solution in NaCl and that we originally had two liters of solution and we actually added another liter of solvent so that we would now have three liters. What would our concentration be of the new solution? We can calculate this using our dilution equation. This is going to be our first molarity M1. This will be our first volume. That's where we start it. When we dilute it our new volume by adding one liter of solvent will give us the second volume of three liters. So the question becomes what would our second molarity be? If we manipulate the equation we find that M2 would equal the molarity of the first volume and that's molar over two times two liters divided by the final volume which is three liters. And when we do that we find that the new molarity M2 is 0.33 molar. Now I want you to be sure that you understand this. The original solution that we had, the original solution that we had contained one mole of the sodium chloride. Diluting it to three liters did not change the quantity of the original solvent. We still have one mole of that solute. We have one mole of the solute, sodium chloride. We have increased the volume and so the concentration of that material is less meaning that it's gone from a half molar to 0.33 molar. Let's finish up with the discussion of solution properties. Let's talk a little bit about these. Solution properties are sometimes called colligative properties and what that means is that the amount of solute in a solution will change the properties of that solution. Now we all know that water freezes at zero degrees Celsius. We know that water boils at 100 degrees Celsius. So why is it in the winter time that engine blocks don't freeze up in Minnesota when the temperatures are well below freezing? The answer is antifreeze. Antifreeze. And antifreeze is added to water and it lowers the freezing point of the water below where the freezing point would be during the winter so that your water in your radiator doesn't freeze and your car doesn't get messed up from that. Causeless, think about it. Water when it freezes expands. When it expands it can break things, i.e. it doesn't do well in your car. When it's that cold. You can do the same thing with water if you add salt to it. Adding salt to water, adding salt to ice when you're making a homemade ice cream lowers the freezing point of that mixture so that you can freeze your ice cream. While adding a solute to a solution will lower its melting point or freezing point, adding that same solute will also elevate the boiling point. Let's think about this. If you're out in New Mexico and Texas during the summer or other areas where it's very hot. Your car has to really work hard to keep itself cold. Think about it. Water boils at 100 degrees Celsius, 212 Fahrenheit. The temperatures inside an automobile engine are much higher than that. So why doesn't your water all evaporate? Well, it's under pressure, yes, but the antifreeze not only will decrease the freezing point, it will also elevate the boiling point so that you don't have boil over quite as much as you would in other situations if it was not there. There are people and companies that have made their fortunes selling these kind of things to consumers and it's a good thing. Now, aside from this, what other things, well, if you are familiar with viscosity which has to do with the thickness or the resistance of flow to a material, viscosity can also be changed by adding a little bit of solute to it as can osmotic pressure. So we have this morning talked a little bit about solutions. We've talked about electrolytes. We've talked about solution properties and I hope that this will benefit you as you move through your daily life.


Ethiopian Prime Minister Abiy Ahmed has urged all citizens to join the army to fight the rebels in the northern region of Tigray. Fighting has escalated since June when the rebels recaptured much of Tigray in an offensive. This came after the Federal Army had withdrawn and declared a unilateral humanitarian ceasefire. The rebels are made up of the Tigray People's Liberation Front and its allies. Mr. Abiy said the whole country had to get behind the battle to defeat the Tigray People's Liberation Front. A TPLF has been designated a terrorist organization by the government. What the group says it is the legitimate regional government of Tigray.


So, you've saved up for a couple of months now and you're so ready na to upgrade your rig. The problem is, all of these upgrades are so overpriced right now due to COVID, yung silicon shortage, and among many other things. But that doesn't mean naman na you can upgrade meaningfully right now. I'm Rocky the Programmer and in this video, we're going to give you the top five most overlooked upgrade pads na you can purchase right now. Ang video na to ay handog ni CDKoffers.com Marami kang mahanap na iba't ibang uri nung software dito. May games, apps, activation codes, or Windows 10. Check out our video on CDKoffers in the video description. Mabilis, mura, and, of course, legit dito. Madalil ang mag-order, search for the software you need, add to cart, check out, dan ka sa payment options nila, wala pa isang minuto, finished. May legit working CDK ka na sa software na pinilimo. Kamitin ang aming promo code para makakahuha pa ng extra 20% discount sa purchase mo. Kung naghanap ka ng mura, legit, and original software, check out CDKoffers.com. Okay, for scope lang, these items are either cheap or still available in SRP while also still being a meaningful upgrade and by that, we mean getting any of these items will significantly boost your PC or improve your quality of life sa pagamit ng PC mo. So mag-apply to dun sa mga, nagaharap ng performance boost, pero yung wala mabili kasi lahat overpriced. And also yung mga magaganda na yung PC, pero they're still looking for that something na pwede pang makapag-upno ka nilang experience. We've always said this and we won't get tired of recommending this, but if you're still on HDDs or hard-describes, it's really about tayo na yung move on to SSDs na. SSDs are way faster, more reliable and they are more durable talaga dun HDDs. You can stop watching the video now and just go ahead and buy yourself an SSD. They come in a variety of forms, but even the most basic SATA SSD is leagues better than any HDD in terms of speed. If you make it your boot drive, meaning the drive where ko nasan yung OS mo na ka-install, you're going to have literally boot times in seconds and the overall OS will be smooth and snappy. Sobrang iba nung experience talaga niya. You can also combine SSDs and HDDs.   So SSDs range from 3,000 pesos up to 12,000 depending on the spec and the capacity. Just make sure you're getting one that has a DRAM chip, as DRAM-less SSDs while cheaper are more prone to failure and are generally slower. So upgrade number two, switch to a mechanical keyboard.  We can't recommend this enough. You know, I've been a fairly recent MKB convert or mechanical keyboard, and the quality of life improvement is comparable to an SSD upgrade. MKBs are smoother, have a more consistent feel, and are just all-around better keyboards thanks to the mechanical switches. I really just can't go back to the gooey, marshy and consistent feeling of membrane keys. That consistency will also save you from wrist injuries and hand strains.  Other than your chair, that's the most interactive item when you use your PC. I would say that the improvement is comparable to running on a track in field oval while wearing steel toe construction shoes versus wearing an Adidas Ultra Boost. Ganon siya ka drastic. Now, there's a stigma around MKBs that makes them seem like a luxury elitist item that is only for the snobiest, richest bourgeoisie. And that's just not true. Mechanical keyboards come in different configurations and in turn different prices as well. A decent mechanical keyboard can be had for as low as $2,500. Now, the price goes way up as you add more features like RGB, better keycaps, or more solid bass, et cetera. But that's up to you. I'm currently using a GMMK TKL. I bought it for $6,000. It's got RGB and modular switches and the caps are PBT which just means they're more durable. All of the benefits I've said so far can be had by even the lowest-pect mechanical keyboard. There's another myth that all mechanical keyboards are noisy and are for gamers only. That's not true. Yes, the most popular switch, the Cherry MX Blues, are what we call clicky. But there are a ton of other switches all having different types. Clicky, linear, or tactile, and actuation forces and points. For Jay, who is a gamer, he prefers the clicky blues. I, on the other hand, prefer browns as I am a light typist. There's a plethora of switch and cap combinations out there that you can find specifically for your needs and preferences. Upgrade number three, grab a mouse that fits you.  Don't be swayed by the specs, though.  Don't mind that it only has 8,000 DPI and not 25,000. The most important thing here is that you get a mouse that won't hold you back and won't injure you as you use it. Take note of the weight, the profile, the shape, the click feel, and the surface paint, how it glides when you move it and that's very important. And finally, read reviews for durability. I'm personally using a Deathadder Elite and it's around 3,200 pesos. It's the perfect mouse shape and wait for my hand. But now I'm thinking of replacing it since it's getting double-clicking issues now. I used to have an MX Master but it also broke and that goes for around 6,000 pesos now. So yun, the Deathadder Elite hindi naman siya yung sobrang ganda no spec. Like, actually isang action sa mga like mid to high-end range. Hindi naman siya super high-end and mas marami talagang better specs sa kanya. Pero yun talagay yung maganda sa hands ko. So that should also how you look at getting a mouse. Ano yung pinakaokay sa hands mo? Ano yung pinakaokay yung feel? And yun, wag lang kayo magpadalakong baga dun sa numbers or dun sa specs. Upgrade number 4, look for your end-game monitor. Similar to gaming mice, monitors have had buzzwords and silly marketing from outrageous contrast ratios to unrealistic response times. You really don't have to deep-dive into these specs, however. What you want to do is find a monitor that reproduces the best image and experience for your use. And remember, whenever you use your PC, it's the monitor that you are looking at. So if there's anything that's going to benefit from an upgrade, it's the thing that sure I see 100% of the time. It's time that you get yourself and it's in monitors that we actually recommend you splurge a bit because having a really good monitor makes all the difference. We've reviewed quite a few monitors here in the channel. There's even one of Anton's where I think he kind of forgot the main selling point of the monitor because he was so blown away by the picture quality. Good monitors start at around $17,000 and above. It's a bit pricey but we do think that it's worth it. If you're a competitive gamer, go for a monitor with a T and panel so you'd have lesser input lag and faster response times at the expense of image quality.  Pero if you're a gamer naman who wants to be immersed looking at the site smelling the flowers, get a 1440p 27 inch VA panel with high refresh rate. That would be even more expensive if you handle 1440p you'd never go back to 1080. Trust me. If you're a multimedia professional or just an all-around movie file get a 34 inch IPS 4K monitor. Look for specs like Adobe or sRGB 100% color support for professionals or HDR support for media consumption assuming of course that you have content with HDR. Upgrade number 5, here what you've been missing. Whether you're a professional from home right now or a gamer trying to rank up on your current game we can all agree that we can never pay too much for great audio and luckily we don't have to. If you're someone who loves listening to music while working or a gamer who's about to play Red Dead Redemption 2 for the very first time or just someone who's going to binge watch Loki a decent pair of headphones is a must. It's almost half of the experience. It's about time that we move on from our beat up, barely working earphones with the horrible mics that came free from our phones years ago and get yourself a real headset. You know, decent headsets go for around 2000 up to 10,000 or more depending on the brand and the features like wireless connectivity RGB, noise cancelling, etc. The highlight of this upgrade though is the mic. Having the ability to communicate clearly whether at work or with your squadmates in your game is such a game changer. Actually, yun nga yung parang nagpurs talaga sa akin to to play with my friends kasi mas maganda na kawa larumi mga friends mo tapos nakadiscord kayo and you can really cooperatively play kaya ano pa ang mga game yun. I'll just be ever in your favor. Ren, pasok ako din sa ano. Bokopasok pa rin actually so like chill na. Let's go. No guys, no guys. Lapit na to. Touch it. Dalawa pa. Sa nalang kayo ako. Ayun. Good job. I personally use this mh630 actually 670 to pero yung 630 na ginagamit ko halos pa reo din pero wired yun. It's surprisingly good and in fact it's such a great product and yun yun reason ko kong bakit ginawa akong fifth upgrade. The ear cushions are super comfy that you can wear these 24 hours a day without hurting your ears. The build quality is very solid but most importantly the audio is superb for around 2500. This headset is just so good. So yun na yung 5 pero mayro pa tayong honorable mentions kasi hindi namin na talaga masali kasi nami. So number one get a decent chair. I reviewed a few here in the channel make sure it's sturdy, adjustable and comfortable. Also consider getting a DS4 or Xbox One controller for your PC. So you can play a broader spectrum of games. Hindi ka lang puro FPS like fighting games or arcade racing games. Makakalaro ka nung ganun. Kami currently pinakaka-addikan namin ngayon dito sa hardware sugar yung brol hala and it's just, talaga for me impossible to play at a keyboard. Pero si Ryan for some reason yun mouse yung gamit niya sa fighting game. Also consider getting a decent desk mat. Your desk will instantly look better in your mousing event smoother. Ako ginagamit ko yung, anong ginagamit ko? Yung sapatag and sobrang ganda nang quality niya in ang ganda lang designs and yun marami kang papapagpili ang designs. Talagang ma-personalize mo yung space mo. Support local. And finally consider changing your case. Sometimes all you really need is a visual upgrade to make things fresh again. Di mo naman kailangan talaga mag-upgrade. Pero gusto mo, siyempre na maging exciting ulit na tignan yung PC mo. And changing a case especially kung medyo outdated na yung case mo. It's a really great way to freshen things up. So anyway if you like the video please like it. If you haven't subscribed, please consider subscribing and consider now you visit yung aming physical store dito sa Makati, hardware sugar at gihost feet and i-check out yung aming forum yung pwede magtanong at pm.hwsugar.ph So see you next video.