الصباح الخير إنه رحيبو بكم هل تعلمون أنكم يأتيون إلى هذه الأسئلة؟ ما نحاول أن نحاول أن نضع بك as much important discussion into as short a time as possible نأخذ الأشياء and matters of great importance ونحن نأخذ أشياء أفضل من الناس في المجتمع ونحاول أن نضع بك as quickly as possible They're very brief in terms of time They're 30 minutes, we have a lot of ground to cover I encourage as much dynamism amongst you all for a Friday morning as possible We also have an audience watching us live online and via Facebook Live as well So we'll have questions coming in from here We're a true meritocracy here at the World Economic Forum So if you want your question answered stick your hand up quickly because you're competing with several million people out there in the great wide world This session is possibly one of the most important ones and something we're all passionate about trying to develop further in terms of our knowledge Tolerance at the tipping point Globalisation and multiculturalism used to be regarded as two sides of the same coin But now we're witnessing a growing backlash against minorities, migrants and refugees and has humanity reached a peak tolerance Now I mention this because we had a series of articles and essays on our own website earlier in the year discussing this and it was recognized and accepted with such a huge degree of interaction engagement from our audience that we felt we really had to discuss this in more detail with some really leading thinkers in this subject here in Davos That's my talking out of the way And I'm going to hand over to my panel I'm going to ask them a brief question each and then we'll hopefully get into the question and answer round Brendan, I'd like to start with you, if I may Brendan Cox, you're the director of More in Common You've been an activist and looking into issues around intolerance and opposition to hatred and populism for several years now Are we at peak tolerance or have we reached it already? I think what we're definitely witnessing and I think what's apparent is there is a backlash I think that backlash is being fed by a range of factors I don't think there's any one individual factor which is causing all of this but I think there is a sense talking mainly about Europe and North America but there is a sense of insecurity and that's partly physical insecurity it's partly economic insecurity it's partly cultural insecurity and I think those are combining in a very worrying manner which means that people who previously may have when you sort of dug in to a level of detail had concerns about diversity concerns about other groups those concerns are coming much to the fore so we're activating that group of people and I think the question is can we deactivate that instinct can we maintain that central view of open and tolerant societies my view is that we absolutely can but we will only do that if we can bring together the forces that already on the side of liberalism and diversity currently they're very fractured and secondly if we get much better speaking to and engaging with people who have those insecurities we can't dismiss them they are real, they are felt and we need to engage in a way that responds to those concerns that reassures people about the societies in which they live but also I think one of the critical things we need to get much better at celebrating what binds us together rather than just talking about what divides us why is there, why are we losing why is this backlash happening in the first place so as I say I think it is that range of facts I think there is this sort of it's the economics it's the cultural threat that people feel but I think we also need to be careful not to get too depressed in terms of I don't think we have lost this I don't think we're at a stage where the centre of society in most European countries still generally is not in the camp of extremism or hatred people remain committed and supportive of communities with diversity in them but as I say what we I think have been very bad at is we spend a lot of time celebrating diversity not enough talking about what binds us together and what that's meant is that we've ceded patriotism which is a very powerful instinct in people's identity we've ceded that to the extremes and now to take that back to define patriotism in an inclusive way rather than an exclusive way and I'd love to know some of the tactics you intend to employ and I will come to that later for sure Senator Ratna Omidvar you're a Canadian national you've been in government for a while you've just passed a bill through parliament and what are the greatest challenges you encountered in that process so I think Canada has no challenges in this conversation and that's not entirely true but I want to start off by talking a little bit about the use of the word tolerance in this context so in my lexicon and to a large extent in the Canadian lexicon tolerance is a word of yesterday tolerance means to endure with to put up with as opposed to engaging with and being curious about other people and I think we've moved in Canada to be a post-tolerant society and our challenge is now inclusion so having said that I will admit that there are societies and jurisdictions that are not there yet and maybe it is a trajectory and a narrative that builds over time and certainly in Canada too we are seeing sort of louder forces I would say not as loud as those in the United States but a certain social license seems to have been granted to talk about things a certain way to express racist statements and misogynist statements and that too finds itself into our discourse but I want to get back to the question of has tolerance reached its tipping point I think human beings have the DNA of compassion and empathy and love and if we say we've reached our tipping point on tolerance I think we're putting limitations around humanity so I can't accept that I do accept that we have to do better and I think one of our mistakes the big global our mistake is that we have been prone to a certain kind of political correctness a certain kind of baffle gap and we do a lot of telling and we don't do enough showing so I'm talk I would like all of us who are in this discussion to show not to show the evidence show the success show when diversity results in shared prosperity as it has in Canada the wonderful work and the visualization work at the world congress center about how people are moving and where they're going there's lots and lots of evidence from the United States from Great Britain from Nordic countries from Canada that every euro invested in a refugee multiplies itself many times over 5 years beyond there's a lot of evidence from immigrants and so on and so forth but we seem to have rested more on the aspirational benefits of diversity as opposed to the real tangible benefits I'm just reminded of a session we had on Tuesday I believe it was but it was on forecasting failures and we're trying to explore the difficulty experts have in predicting so we talked about economics we're also in terms of psychological perspective and I believe it was Molly Crockett from Oxford University who was talking about the the difficulty of the bias that forecasts have when it comes to economic self-interest rather than powerful emotional drivers and I'm just wondering maybe it's more of a comment that all this evidence based statistics on the benefits of migration sometimes it doesn't work and it's not hitting home at the moment but connecting the heart and the mind I think issues of national identity are incredibly important I think a certain amount of social engineering is required I read a blog on the World Economic Forum which spoke to me by Naira Woods and the easiest part the easiest way of helping people understand each other is to learn another language now if all of us in schools and colleges started to learn another language opens up a whole different world so I would say there are things we can do but it is it is making that connection between the heart and the mind and we often miss that and it's fantastic having you here as somebody who has helped push through this this citizenship but I want to move now to our third panelist who's also created a huge amount of progress in his part of the world Shaykh Abdullah Bayer for promoting peace in Muslim societies and I have here the Marrakesh Declaration which is the on the rights of religious minorities in predominantly Muslim majority communities and my question to you sir is how difficult was this process and what is it achieving now now that it's in operation thank you to the moderator and also to my fellow participants and the audience the difficulty always in this life and the challenges they're always there several years ago we thought that the value of tolerance was something firmly rooted in people and thought that it was really axiomatic and an accepted principle especially in America in the Islamic world to a large degree but in these last years we've seen humanity really falling back and seeing them just regressing in these values that had been beginning to practice because they're absolutely necessary there has to be really a select group of people that think deeply about these things and in the rest of the world in America and Europe they have to really think about the benefit of these virtues because these are the most important virtues for human society if you have a society you have to have the toleration of others without toleration of others wars are the result sometimes tolerance can lead to a recognition of the other recognition of the other it's a higher it's a higher virtue the Quran says we made you nations and peoples in order to know one another so this idea of knowing each other of engaging the other this is a mutual thing it engages the other tolerance it's something that you bear the other but this idea of acknowledging the other it's something higher because you have to know the other and if you know the other then you'll see that he's equal to you as a human being and then these difficulties begin to dissipate when we saw a lot of these protests and the Arab Spring in 2011 I got together a group of scholars to really think deeply about this problem of conviviality in the Muslim world because we saw this problem with the minorities minorities that they weren't with because they weren't part of the majority of the religious community of Muslims they were persecuted and so we wanted to think how can we treat this but we needed to do it from within the religion itself because the problem was a misunderstanding of the religion so we looked how could we do this from within the religion itself so we began to study this deeply and I got a group of scholars together to do this and in the end what we came to the conclusion that this idea of equal citizenship this also the social contract this contractual citizenship that this is the most appropriate way to work in the time that we're living in and we have from 1400 years ago a covenant from the prophet that actually established equality of the different religions in the city of Medina and so we brought Christians we brought Jews we brought Yazidis we brought Hindus we brought all of these different groups came and and so we brought them together to really present this covenant and it's similar to Helsinki's declaration and so this took a lot of time we really worked hard on it and we had to first convince the others that this is actually sound and it's from the matrix of our own religion and it's appropriate for this time and it's a very high level of tolerance it's not the low level of tolerance it's not the indifference where you don't think about just going against the other but it's looking at the other as equal to you and the other person doesn't need to be acknowledged by you because God created him equal to you already but you have to acknowledge that so this is what we did and thank you for the opportunity equal citizenship social contract is tolerance universal and uniform across the world or are there regional differences that we need to bear in mind you talked about the trajectory where do you view that trajectory going and how much gap is there between societies around the world I think the gaps are significant in different parts of the world for different reasons societies where education is more generally available the gaps may well be closer but I think I want to make the point that there is no end to this journey because the minute you think you've arrived at Nirvana you're actually in a box and tolerance if I may use the word continues to reinvent itself because so for instance in Canada 20 years ago we never talked about the rights of transgendered people we now have legislation before our houses of parliament and the senate in Canada that will deal with the rights of transgendered people so I think it continues to reinvent itself and the core lessons are openness and engagement and curiosity about each other as opposed to a passive acceptance of existence I have one from facebook from why did capitalism fail to end poverty slightly off subject any of these on capitalism and economic growth and living standards in terms of tolerance maybe we'll leave that one I'm not an expert in capitalism if we say capitalism if we talk about humanity as opposed to capitalism it's not capitalism or Marxism but rather justice social justice if we talk about justice then we won't fail but if we just talk about capitalism there's always going to be losers by its nature it's just by the nature of the system Adam Smith even recognizes this that people benefit from others and there's going to be losers by a zero sum game so this is my opinion there's so I apologize but I just want to say so if we look at the difference between Smith and Kant for instance then you'll see that Kant was more concerned with social justice but there is even though there is more prosperity in societies there's also greater inequality and we know that when societies are unequal they are less tolerant of each other so I think A does equal B and economic prosperity that is shared by all that's not in the hands of a certain elite whichever way you describe it but it's spread across through either tax redistributive measures or legislation that is where you create a sort of foundation for equality and justice and tolerance we have to be careful here to not cast Kant as a complete nirvana because we have a tendency to lord and like a lot of the a lot of the policies that Kant has right now but we're talking about tolerance and openness and inclusion being fairly well advanced compared to other countries including across your border in fact is it economic inclusion, is that the key or are there any other factors? I think it goes to something much more amorphous than intangible and that is identity Brendan talked about patriotism as a key part of national identity Canada is a new country, we're protected because we're on top of the world we share a border the safest secure border with a very wealthy country so we have to have we've found ways of defining ourselves differently multiculturalism is one of our symbols it ranks up there with maple syrup and the RCMP and this is important, there's no proof but when Canadians feel proud of themselves and they stand up tall it's normally long a vision of Canada being multicultural, open and inclusive and that's hard for me to back up with evidence and science, it's more emotion and I think that's where we have connected the heart and the mind together somewhat accidentally but still Brendan, maple syrup marmite and multiculturalism how can we elevate tolerance and openness as part of the British national identity and what are the tools you're talking about because this is what you're focused on right now yeah, I'd firstly put on the record I really don't like marmite but I do like maple syrup so I might have to move move country at some stage so there's probably very obscure cultural references to the people watching so I think that one of the reasons to be optimistic is that I do think there's a huge pent-up desire for people to celebrate what binds us together in the UK when we have opportunities to do that whether it's in response to a natural disaster a birth of a new member of the royal family the Olympics, the country comes together and celebrates what binds us together what we're very bad at is finding opportunities to do that and again as we were saying earlier actually during on the work of Jonathan Hayes here what we tend to do much more on the sort of liberal side of the spectrum is to talk about the difference we celebrate diversity and there's definitely a role for that but it's just as importantly we need to be talking about the different bits of our culture that bind us together what it is to be British what it is to be Canadian and part of that should absolutely be an openness, a tolerance and ideals of countries that is hardwired in it's true in the case of Canada true in the case of the US in terms of its nation of immigrants it's true in the case of the UK this outward looking country it's true in the case of France and the ideas of the Republic so there's a lot in that patriotism that can move us in that direction but I also think that we need to think about this from a frame which isn't just economics but the economy is going to solve this problem this is as much about culture and identity as it is about economics I think we have a question here can we have a microphone? thank you, this is a fascinating discussion and I certainly echo Brendan's sentiments about the importance of looking at what binds people together as well a question for Senator Omidvar speaking as an American Canada certainly seems to be more successful in its immigration policies in multiculturalism and so much of that is because you have what seems to be an intelligent and thoughtful immigration policy and you have much more high skilled immigrants probably much easier to assimilate than in the United States do you think it is wise for countries in Europe and North America to be looking at the immigrant flow and deciding that this group these people, these individuals yes we'll take them and they'll be easier to assimilate but those no that's a very good question but the recipe for success is I think made up of a number of really powerful ingredients one of course is the lack of boundaries we put around our national identity and how we think of ourselves but the second is a very carefully managed migration policy we pick, we select every immigrant, every refugee every parent, every spouse everyone who deserves our compassion so it's a very high touch system now our geography lends itself to that but what we do and so I can't lend you my geography in Europe but what I can lend you is an aggressive integration strategy we back up our investment in selection with a highly articulated investment in integration close to 900 million dollars a year now we're a small country so that's a big figure and that's only the federal figure it does not take into account what provincial levels of government will invest in migrant education, immigrant labor market integration does not take into account what local governments have done in terms of re-engineering their police forces to look more like the people who they are supposed to police so this I think it's been a trickle down investment that is hard for me to put a figure value to but I think that is the secret we can't export and if I can just build on that I think it is, it's definitely partly the who but it's also the how as you're saying and that how the thing which is most disconcerting to the public about migration when it feels there isn't process there isn't order, it's out of control it's that that particularly resonates and scares people and where you can show process, fairness and order you tend to have much higher levels of confidence in migration and you also then tend to have much higher levels of confidence in integration it's such a shame we've run out of time so quickly in these sessions because we could go on for a long time I'm just going to sum up I've been keeping an eye on Facebook Live it's Hewney and Ali saying respect each other's culture that's my point of view and I'd say 99% of the comments have been around that particular line for the next couple of minutes I just want to look ahead 5 years from now and think about what kind of society we'll be living in whether it's more inclusive, more open, more tolerant or less so maybe shake, perhaps you could give your view of how you view society in your part of the world as far as the future goes it's difficult now to talk about the future we say only God knows what's coming but we can say the future it will it will be good if we can stop these wars are these wars going to stop this is an important question I think if we spread a culture of peace especially amongst the youth things are going to change but let me say one thing in the 1950's he's a French intellectual I'm not a French speaker I apologize it's not important that you're optimistic or pessimistic but what's important is determination and we're determined to spread peace and so we should be optimistic if we're determined to spread peace 5 years time how will there more in common have changed the world I think the thing that I'd say is that there is no predetermined path on which we are there are a whole series of forces which are being unleashed but our reaction to them is as important to that there are a few elections in the US it was a few thousand votes in a few states if you look at the election in Austria the first election there was incredibly close so it depends on how we organize ourselves and our agency so if we sit back and wait for the next 5 years to unfold I think we have a lot of reasons for pessimism I think a lot of the trends that we've talked about whether that's migration whether that's economic insecurity whether that's the fourth industrial revolution will create huge challenges but I also think there's a lot of reasons to be optimistic I think we do that younger people tend to be more progressive and tend to be more tolerant as you become more educated and more diverse as a country you tend to become more tolerant so it's big demographic things on our side I also think that we're nowhere near tapping into the strength of the political center that sort of sense of open societies at the moment the structures are very diffuse and very disorganized what you've got on the populace right is a resurgence of organization and activism and we need to create that equivalent in the political center to reassert that and if we do that I'm very confident that in 5 years time we can be living in a world where we look back on 2016 not as the beginning of a decline but as a wake-up call that pushed us back together Senator you passed your bill in September this year I believe it's still before the Senate it's still being contested and that's why even in a country like Canada we cannot take support for multiculturalism for granted all the indicators tell us in Canada 30% of Canadians are fully in support of immigration and diversity inclusion that whole basket of public goods 30% absolutely are not that's big and 30% are what we would call conditional multiculturalists which means people who are inclined to be pro-multicultural but need evidence need more pushing and nudging I'm not in the business of making predictions if I were I'd be richer than I am but I can see some trends and the trends I think one of the most hopeful trends in Canada is the slow but steady increase in interracial marriages especially in urban Canada you see couples and friendships that span races and religion and ethnicity etc but I am also somewhat pessimistic especially after listening to everything at Davos about the huge displacement that seems to be coming our way through artificial intelligence where more people will lose their jobs and it seems to me that no one has the answer to how those who will be displaced by technology yet again will be re-trained, will be redeployed I do worry about inequality fraying at the edges of all our societies Canada or not well it's been the main theme of this year this year's meeting how do we move to a model which is inclusive and sustainable thank you very much for joining I know you will have important meetings to go to thank you for joining us over here of course I just want to say one word I want to take this opportunity this meeting I want to just call all the people of good intentions that we have to organize we have to join together to fight this hatred and this war I don't say like Mark said workers of the world unite I say good people of the world unite thank you very much indeed all of you for joining us


I'm Professor William Oakes. I'm a professor in engineering education, director of the EPICS program, and a graduate of Purdue's mechanical engineering school. I teach and support black engineers. I like to think of myself as an advocate and ally of black engineers. Recent information that's come to light and recent events have shown me that there are things that I had not seen, things I was not aware of, and things that I've not done. I commit to addressing these and doing better to make Purdue and the world a better place.


Well, with a new year, many people are looking to make some healthy lifestyle changes. Josh Peterson spoke with some local experts on what your first steps should be. With the start of a new year, area gyms are seeing an uptick in their memberships. For many, it's a chance to start fresh and make some self-improvements. But just how and where to start can be intimidating. For most, just taking the first step and joining a gym is an accomplishment. If they want something more specialized, then we'll just, you know, set up training sessions right away and get that going. But it's usually a good way for them to start for the first three, four weeks, you know, just something basic to start with. Many local gyms recommend starting out small and starting with smaller goals while building momentum and setting up your routine. I think you need to start off with becoming consistent and trying to get into the gym two or three times a week. Just smaller goals and then going from there. For those hitting the gym, it's important to understand your gains and realize everyone's body will react differently to fitness and timelines. You don't want to set goals that are unobtainable. So just small baby steps, especially for someone who has never been a member of a gym. Just become comfortable with the equipment, the facility. At times, a gym can be overwhelming. Trainers recommend asking plenty of questions and set up a game plan for developing your routine. We kind of will help them figure out a starting point and how many days a week they should work out and that type of thing. While some people tend to give up by February, making a routine of working out two to three times per week will likely see you through your first goal and beyond. In Bemidji, Josh Peterson, Lakeland News. If you've enjoyed this segment of Lakeland News, please consider making a tax-deductible contribution to Lakeland Public Television.


Dear students, today we are going to discuss lecture number 37 of the database management system course. The course code is CS403. In the lecture number 36, we discussed different file organization. We discussed the sequential file organization, index sequential file organization and the hash file organization. We also studied different advantages and disadvantages of these file organizations. At the end of the previous lecture, we were discussing the indexes. Index is basically created on a database file and purpose of the index file is to facilitate in the data access. When you store the database, you have to access the data for different purposes and different uses. If you do not have an indexes facility, the only option that you have got is to search for your required record sequentially one after another. If you want to access the database based on any condition, you have the option to read all records carefully from the database file, database, table and then you compare your desired value within every record unless you reach your own desired record. Or your desired record is lying at the end of the file or it is not there at all. When will you find out that when all records have been read, you will finally find out that the record is not there? So, indexes basically help you to make your data access efficient, relatively low accesses. We have just touched on the topics of indexes in the previous lecture and today we are going to read its details. So, let's start today's lecture. Any subset of the fields of a relation can be the search key for an index on the relation. This means that all the attributes that you have in a table, one of them is a combination of two or three attributes. Any combination of attributes can be used to create an index. And the thing is that what will you do on it? You can access the value of the attribute on which you can read the data. You will create an index on it. Search key is not the same as key. This means that the search you are searching for is not necessary to be key, it can also be a duplicate. And index contains a collection of data entries and supports efficient retrieval of all records with a given search key value k. For example, if we have a student's record and we want that we have a key, that is student ID. But still we may not always need the access on the basis of key only, on the basis of student ID only. In fact, it is possible that we need to access the data on the basis of name, let's say, or area. Let's say we say that those people who are related to DG Khan, whose domicile is of DG Khan, or whose domicile is of let's say Lahore. So the way we can read the data access, it can be your key value. You have to search for records based on that key value. For example, you say that those people whose CGPA is between 3 and 3.2. Again, you are giving a search condition on the basis of CGPA. So the purpose of all these examples is that in the real life examples, in the real life situations, it is not that you only need to access the data on the basis of key only. No. Apart from the key, in the other attributes, if we say non-key and it is not unique, you can also read the records on their basis. So all the fields that you need to access on their basis, they can be your search keys. Another factor is that in some cases, you need to access the records on the basis of a particular key value very frequently. But in some cases, some cases that you need to access at any time, let's say, let's say in the basis of name, you may have to access 200 of them in one day. So on the basis of address, you may have to access one or two or three times. So the frequency of access, on which value basis, how frequently do you need to access the data? That is also one of the criteria on which you decide whether you should create an index or not. Let's move on. Indexes also contain auxiliary information that direct searches to the desired data entries. This means that what you have an index file contained, I have already told you that an index file does not contain all the data, that is, what you have in relation to your table, an index file does not contain all of that in a particular order. No, it contains the value of key, yes, because on its basis, it has to help you in accessing one thing. But apart from this, there may be some other information in it. What can that information be? It depends upon the implementation approach of the index. We will read in this lecture that there may be different ways to implement indexes. So the way an index file is being implemented, according to that, the key values you have, apart from that, there may be other entries. We will see what they can be. We can have multiple or different indexes per file, for example, file sorted by STID with a hash index on CGPA and a B plus tree index on screw name. As I just told you, the relation of your table is that it is always stored in a particular order. You define that. If you don't define it, then by default, the primary key order will be stored in your record store. First of all, the student table we have got our key as the student ID. So practically, the record store in the record store is stored in the order of student ID. But what you have is different attributes. As I told you, you need to access data on the basis of values of different attributes. On the basis of value, you need to access the data very frequently. On that basis, you create index files. For example, the names given here, a hash, a B plus tree, these are basically different implementation approaches of the index files. The meaning of these sites is that you have records stored in the table on the basis of value of student ID. They are stored in that order. You have an index file which is made on the student name and it can be implemented through the B plus trees. Similarly, we have an index file created on the CGPA. It can be implemented through the hash. This way, you can have multiple different index files on the same table. Or, theoretically, you can have the indexes on all the attributes, not only all the attributes, but on different combinations of the attributes. The etiquette is possible. Or, DBMS, you will not even deny it. But definitely, there are some negative sides of this thing as well. Let us go ahead. Indexes on primary key and on attributes in the unique constraints are automatically created. You have declared the primary key and the attribute while defining the table is declared as unique through the constraint. So, on those attributes, your DBMS generally automatically creates indexes. And still, we can add more. How do we classify different types of indexes? What selections does it support? In this, you have an index type. Which type supports that selection? Remember, as I told you earlier, when you select rows, you select rows always on the basis of a certain condition. When we read the SQL condition, we studied different formats of the conditions. We used the wear clause. There are different types. We have to see that the index classification can also be seen that which type of index supports which type of selection. This could be one approach. Representation of data entries index. What kind of information is the index actually storing? We will have to see that what kind of information is stored in the index and how much space the index itself is taking. The data that you are storing is going in the table or the relation. Whatever physical record you have, it will be its space. But apart from that, the index file itself is going to take some space. We have different index approaches. We have to see which index methodology stores what extra information and how much space it is going to take. Apart from that, the classification we have can be done on these three basis. One of them is that clustered or unclustered or non-clustered indexes can be done. Single key versus composite key indexes. What is your index key? Single key or multiple attributes. It is tree-based. It has inverted files or pointers. These are different. The final one that we have studied is different implementation approaches that we will discuss. The next topic is How do we create index? As I just said, whatever is your primary key and your unique attributes that you have declared as unique through your DDL, Data Definition Language, you declared them as unique and the indexes DBMS automatically created. After that, as I just said, we still need to study some other attributes to create indexes. For that, we have an accurate statement and it is also part of the DDL, Data Definition Language. You will remember that we used the create table statement to create a table. Now we will see how we use create statement to create an index. Now look at the create statement which is a syntax. If you look at it, the create statement is written in capital. It means you have to give it as such. After that, the unique is optional. That is why it is written in square brackets. But if you write it, you will write it as such. Non-clustered. From these, you will give one option. After that, what is required is index. Since index is written in capital, you have to give it as such. After that is index name which you will provide yourself. On again, this is required. And where you have two options in curly braces, you will give table or view. You will give its name here. You have to produce it yourself. After that, what you have to give is column. Column means you have to give column's name here. Whether it is from the table or from the view. We are going to read about view, but what is the table in terms of table? And again, there is an optional thing in which it is said ascending, descending. You have to create an index here. Whether it is in ascending order or descending order. Your values are in increasing order or decreasing order. This means if it is by default then it is ascending. If you are doing it on the name, then the names starting from A will be from B to C and like that. And if you are descending, then it will start from Z and after that it will decrease and it will go to A. And after that it is comma and dot on N. This means that what you are giving column and ascending, descending you can repeat it. Now look, this means the column on which you are indexing your table it can be a column and it can be a multiple column. Now the question is what is the logic or reason for giving column or multiple column index? The reason is that if we know that the value we are going to index that is unique. If it is unique whether it is unique or primary key then in such cases when you have that attribute that your index is creating that is unique. In that case, there is no chance of the duplication of the value. The value which is coming which will create the index which will attribute all its values there is no chance that you are going to have the duplicate value. So it is obvious that every value has to exist at once and it will come in the same order. But in some cases it is quite frequently agreed to arrange the data on a non-unique attribute. Definitely the same value can be duplicated. What should the dbms do if it finds the same values for two different records? For example, if we talk about name we said that on the basis of name you create its index. First of all we have a new name and by chance the institute for which we are creating the database we have 7, 8, 10 10 different names. So the logic of having the multiple attributes is that you are guiding the dbms that if you encounter the same value for this index then what you have to do on that basis is that you have to arrange the same values on the basis of the other attribute. So what do we mean by this? First of all we have a student name and we have 10 different classes in our institute. What is the difference between those 10 records? We are guiding that if our name is the same then what you decide between them that you will decide let's say on the father name. So the 10 different names that will be arranged further will be on the basis of their father name. First of all since the different names were the same now we have said on the father name which means the alphabet is the smallest it will be the first after that the father name it will be the end like that. So the second attribute will be needed when you are not in a position to decide on the basis of the first attribute. If the decision is made generally there will be no confusion there will be no use of the second attribute. Why? Because the decision can be made on the value of the first attribute only. There is no use of the second attribute of the second column in case of Babar and Jamil. But if we are going to have 2 or 3 Babars or let's say we have got 10 Jamils what will we do in that situation in that case second attribute or it will be interesting if you keep the first attribute let's say ascending then the second attribute you are giving you can still change the order of the second attribute. For example, you say you should do the name in ascending but if the name is the same then on the basis of the father name but it is in descending then what will happen? But the name of the father which is the biggest factor in the order if the name of the father is Zubair then the name of Zubair is Jamil and if the name of the father is Valayat Hussain then it will come after that. It means that the order that you are giving for the first column and for the second column they are not required to be the same they can be different and they can be the same and this principle the value of the second attribute will also be the same so if we don't specify if we don't specify then generally the order in which the records are entered will be the same for example, we had Jamil Ahmad we have only given the name so if the same value of 10 records is called Jamil Ahmad then the 10 records of the own recorders will be the same in the relation of table but when you said that the father name will go to the base of the father name but suppose that we have got 3 such Jamil Ahmads who have got the same father name as well so based on the first attribute you were not able to decide on the basis of the second attribute Jamil Ahmad was Fiaz Ahmad so what happened that Jamil Ahmad is the same so what is going to be the order now either again you will give the third attribute in a normal real life situation the order that does not matter in that case or you will say to yourself that you will leave the order in which you had entered the record now these 3 records they will appear in the order in which they were entered into the database table but first of all if you go to many courses you are a perfectionist if you are a perfectionist you will say okay here is the third attribute you will say on the address what happened you will say name, father name, address if you decide on the name no need to consult the father name or the address if you decide on the name then the father name and address does not matter because name was the first attribute then you go to the second attribute which was your father name if you decide on the name then you move to the third attribute so this concept is to give or to create the index on a single attribute or on the multiple attribute let us go ahead here is the example you said create unique index and you said program underscore program name again this is a naming convention there were two letters you took them from the table the table you are creating underscore and then you gave the name of the attribute on which you are creating the index so the project name is basically attribute and it is programmed so you did it on the program and the attribute on which you are creating the index is called program name and the index is the name of the index file so you said pr underscore pr name what will be the benefit of this now you knew the name of the table on which you are creating the index plus the name of the attribute of that table on which you are creating the index so this is your index file name and when you said on the program you gave the name of the table or in the bracket the attribute name you want to create the index another example can also be created on composite attributes or multiple attributes and if you remember what we have studied one of the classification was that either it is created on a single attribute or on the multiple attribute you just saw the index on a single attribute now we are seeing example of the index that is created on multiple attributes create unique index unique again it is optional it is not necessary it is optional ST name ST again we have mentioned ST means student table and name means name attribute here we said student ST name ascending as I gave you example you said create on student table that attribute student name ascending and then you said ST father name descending meaning you will arrange name of student in ascending order in increasing order but if name is same then you will decide on the basis of the father name but in the descending order I hope you have clear example properties of indexes indexes can be defined even when there is no data in the table or existing values are checked on execution of this command the first thing is when you have created a file even then if you already know that I will need the indexes on these attributes then you can give the command and you can create the indexes now your index files are on attributes those index files will be created based on the values of those attributes even when there is no data in the database table because now that structure as you have table structure and there is no data in it similarly you have got index file as well although there is no data there to arrange but still you have got the structure so as soon as you start populating your database table automatically index file also gets populated the values will automatically move and it starts working just fine the second thing is you do not need to be tense that when I have created a table I need to know all the index files that I have to create on this table and if I miss then what will happen nothing will happen you have created a table you have created some indexes some indexes you have created automatically and on your unique attributes on them indexes are created automatically now let us say you have populated your table and in that let us say 1000, 2000, 10,000 records have come and now you realize now there is a need that you need to create index on an attribute why because you need to access that on the value of that attribute very frequently when we create an index the access becomes efficient on this basis you realize that you need an index on a flat attribute first we say on the phone number on student phone number or let us say on the qualification of the employer we need an index now although the table is populated you will create the index the same command we have given we will give that command and your index file will be created and as many of your existing records they will be arranged in this index file automatically and after that your index file it will start helping you to have an efficient access of the data from this database table second thing is as all the constraints are if the table is populated and you apply a constraint then your existing data will first check on that whether this constraint can be imposed or not if you say on the qualification of the employer or you say on the student phone number you created an index and you said now the unique if you created an index before putting the data in the table in that situation this index file or the DBMS won't let you enter the duplicate value in that particular attribute this will be one situation but if the data was already present and now you said if you create a unique index then your unique index will create if your existing data is that follows this constraint because in future it won't let you enter a duplicate value but what about existing data the veridity the applicability of this constraint on your existing data will also be checked so if your existing data is that was unique then your index it would be successfully created otherwise the DBMS will give you error message that this index cannot be created or the unique constraint of this index it can't be implemented and first if you do not give a unique constraint if you create an index and you don't give a unique constraint in that case if there are duplicate values I hope this is clear to you come on indexes support selections of the form field operator constant when we were studying the select statement we said that the where clause has a condition and that is basically the form of the condition what is the name of the category then you can have operator and there is a long list of different operators and each operator has its own behavior constant means that you can give an expression that will compare so your indexes help you to access such select conditions for example I gave you an example where select star from student where CGPA between 3 and 3.2 you have given a select condition and you have specified a range now it is obvious that if you have created the index on the CGPA it has arranged all the records in the CGPA value in the order of CGPA value now it will say that the range specified in the order from 3 to 3.2 especially continuously means that when you got 3 then any record that does not fall in this condition and where 3.2 is after that any record does not fall in that condition so if you start the 3rd entry in your index file from there and the point where 3.2 is end will you access the records between them those are the only records within your database access this is confirmed that there is no other record that satisfies this condition or that fall between this range this way your indexes they help you to access or to perform the search conditions efficiently then it says that support equality selections either tree or hash indexes help there means where you have equality you said that CGPA is equal to 3.5 this is an equal airport term so this will help you tree and hash will help you but when you give range when you said that less than equal to, greater than equal to between less than greater than the things that fall in your range in that situation the tree based both will help you but when you have hash based it does not support and you know the reason because in the case of in the situation of hash you always compute the value for the individual record you apply the hash algorithm on individual and search for the basis so hash will not help you from now on we are going to discuss specifically because till now our discussion was either it was focused on primary key or on unique key or general key from this point on we are discussing only the secondary key dear students so far we have discussed the secondary key so many times that you do not need much explanation but do win by the secondary key obviously that attribute on its basis you need the access but that is not necessarily unique and I have told you again that in the database applications in the database you need to access a lot of values in which the value is not unique because look what is the difference in this the difference is that on the basis of unique key when you search for a value then you will not get the record if you do not get it if you get it then you will get one and that is your required or desired record but when you talk about the secondary key in the case of secondary key the data you will get that is not necessarily unique you can get multiple records that means in that case if you get a good record then it is possible that all your records were required or it is also possible that one of them was required so this means that on the basis of secondary key in that case you may need to further clarify to further make it sure which one is your desired record either all of them that you have got one of them, two or three so this is possible but I have said that this is also possible that you need all of them and the other thing is that keep in mind that in the case of secondary key you are always going to have multiple records no this is quite possible that when you search for secondary key then it is possible that if you give a secondary let us say name it is possible that 40 times you get a single record and interesting thing is it is possible that you give a name for 100 times the state of your database is such that all the 100 times you get a single record but on this basis because we gave 100 times 100 times we got a single record does this mean that name is a unique attribute or it is a primary key no about your database or your data about such decisions such rules never ever try to define them on the basis of the state of the database on the basis of the data in the database because the data you have that is a time-oriented thing time-based thing that at this time something else can happen I told you that 100 times you gave a query on the basis of the name 100 times you got a unique name but it is also possible that 50 times you are getting multiple entries so I have to say that the decision you have to take whether something is unique or not you have to define the business rules the environment the database you are developing by looking at the rules whether the name is unique or not the name can also be unique it is not a big deal that it is not an unexpected thing that it cannot happen that you should not imagine no there can be some organization that says that we do not allow two employees or two items fine the name can still be unique but what I mean is when I say that in the case of secondary key you may have this it does not mean that if you are getting unique values on an attribute or if you are getting single values in the case of secondary key you should always expect multiple outputs no the thing is whether some attribute is unique or not whether something is primary key or not whether something is secondary key or not it can also be decided on the basis of the business rules you will see the rules of the organization where you are developing the database that says that it should be unique you will declare that as unique not this one whether by coincidence the data I am showing you yes like student name program name program etc. these are different examples on the basis of which you may need to access the data but you will not get the unique output you will get multiple records so this is what we call secondary key that you know records are stored on the basis of key attribute as I told you generally the records stored are stored on the basis of search sorted on the basis of name sort for command execution problematic these three the three options we have discussed what is the meaning of this and what is the problem look we have discussed that our records they are stored in the file on the basis of the value of the primary key now we need the data on the basis of a secondary key now the thing is what are the possibilities we have the first possibility is that we perform the sequential search and you have read that sequential file or sequential access is inefficient in that you have all records records on the table relation records you will have to read all of them and in that the field on which you have searched the search condition first you have said that let's say the student name is equal to Jameel Ahmad so you will have to compare the name of every record and then you have to compare all the records in the number of lakhs you have records in that file you will have to search a lot of records and another interesting thing is that you can after reading all records that is there were 1 lakh records after reading 1 lakh records you will know that there was not a single record but desired or if it was then you will have to look for it so that is the sequential search but you have a sequential search especially in the case of big files where there are more records in that case sequential access is inefficient it will be time consuming so the first problem is this the second question is that if you do that your records are stored on the basis of ID if you need a name you can sort this file change it on the basis of name and on the basis of name you can store it that means you have duplicate copies of the same data you have one copy on the basis of ID and the other copy on the basis of name and in one way the solution is fine but along with the drawbacks I hope they will click in your mind the first thing is there is a lot of redundancy if you have 1 lakh records then now you have got 200,000 records 2 lakh records in one way on the basis of name and the other thing is whenever you have to enter a record you will have to place that record both in the original table in the original sense because it is on the basis of ID it has all the records we call it original in that table and that file that you have sorted on the basis of name you will have to place that record same thing happens when you delete a record you will have to delete it from there you will have to delete it from here well, it is the first thing if you do an updation then again movement will be on both sides this is affordable the other thing is we have just discussed we can have index on multiple fields on the basis of name we need it on father name we need it on cgp we need it on address because we need to access the data on the values of these attributes so this means on all these attributes or on the combination of BAS we need indexes so if we start sorting then think what is happening that data that we have should be once what we have stored we have got 10 different copies of that same data instead of 1 lakh records we have stored a million records because we have sorted that same file in 10 different orders and saved so 10 copies are done and all the examples like delete, update, move all those operations will have to be performed on all these copies so sorting on the basis of that particular attribute is also problematic the third option is that the command we are executing on the basis of when we gave the exact statement we said select star from student where name is equal to Jimmy Ahmed you must be very surprised because we are naming him so now you have said that Jimmy Ahmed show me the record so third option is write the moment when you need to execute this statement you sort your file at that time again I hope that you are fine as theoretically it is fine but at the same time you must be able to identify the problem with this especially in the case of huge files sorting is going to take time obviously if you swap 1 lakh record then it will take time then the second thing is if you want multiples on the field then you will have to swap time consuming and another thing is if you need it repeatedly if you need it on your name then you need different access based on ID or attributes and after 10 accesses you need it again on the basis of name then you have to perform the same activity again time consuming so I hope that the 3 alternatives that we have discussed in front of you the problems in these 3 you must have realized so obviously the solution is that you create index file let's see how index on secondary key is the solution instead of saying that the 3 we have discussed instead of that you create on secondary key that remains in original order however secondary key index maintains ordered sequence of records and provides direct access any attribute you have created on the basis of attribute then you will keep that attribute's value in an order and that record in which this value is present will guide you to that so this means that if you have indexed a record on your name then you have an index on your name all your names are present on your record so you will search for the record on your name in the index because it is in order and after that along with that there will be information on which you can directly approach to the record having this value as the name of the attribute the value of the attribute name so you will get to that record this is simply the approach by which the index files makes it easier makes it convenient, makes it efficient to access the records on the basis of the values of certain attributes now secondary key index implementation approaches are three one is inverted files or inversions the other is linked lists or 3C has B plus trees the purpose of studying these implementation approaches is that you have an idea in your mind if we are using a particular facility if we are using a particular feature of the DBMS of the database how is it being implemented what is the cost involved what is the benefit of this feature see most of the time implementation things they are managed by the DBMS itself most of the time there are certain situations, certain states certain points where you can guide the DBMS but the thing is most of the time implementation thing is they are handled by the DBMS itself and that is one of the beauties of the three level scheme architecture that you do not have physical details they are handled by the DBMS itself but the thing is as a computer professional as a database person as a database man as a database expert you should know that these are different features fine but how they are implemented what is the cost of using these features is that you should not do blind decision you should see an optimal situation see a small thing we say index they make the access quicker fine it is a simple rule, simple statement that is valid also it is not wrong but the thing is there is a cost if you are simply a DBMS user then you create index on all the attributes on all the combination of attributes go for it and you say why I have made the access efficient I will make it efficient by creating the indexes but as a computer professional as a database expert you should know that the indexes when they are implemented there is no extra cost there is no extra storage there is no extra execution involved so that you do not do that decision you should take that decision where you see that it is fine here I know that it has over head but its benefit it outweighs its over head so what should you decide especially in the lectures you will feel that we are not using it directly but mind it for a database expert it is it is not a must I would say but it is very useful it is very beneficial to know these things so we read the implementation so that you can use the features of the database thoughtfully efficiently the approaches here to implement the index files especially the secondary index basically they involve different data structures and the course of data structures you have read and all the things that you have discussed in detail we are not going to discuss about these data structures in detail we will not talk about those data structures or if we will do it just for the sake of introduction or revision here our emphasis will be on how we can use them in indexes and it is also possible that when you read your data structures course at that time you used these things to implement the index you may have read it so if it was like that then it will be revision in your class how you can use it to implement index files and as you know the link list and the trees they are very useful very popular data structures and especially when you do the data structure course you do the different assignments and the implementation here we do not do the implementation here because normally you do it in the same course in C++ we do the assignments here just we will see their implementation how they are implemented and we will discuss this in our next lecture so today's lecture we will wind up here as you have seen what we have discussed is the topic of index and in index we have seen that the purpose of creating index and we are trying to link it that your database or your table has a relation the records the physical storage in that the reference in that order or in an index what is the difference so we will continue this discussion in our next lecture now I would like to say goodbye