1 00:00:00,960 --> 00:00:02,250 Hello and welcome. 2 00:00:02,250 --> 00:00:09,400 Thank you for signing lobb to this course this really means a lot to me in this video. 3 00:00:09,420 --> 00:00:16,330 I will explain what the where clause does and the importance of the WHERE clause. 4 00:00:18,000 --> 00:00:24,690 The main purpose of the work laws is to restrict or limit off field. 5 00:00:24,690 --> 00:00:30,150 To date that is returned from the database. 6 00:00:30,240 --> 00:00:39,010 So you know extract data from a table rather than bring back all the data from that table. 7 00:00:39,150 --> 00:00:48,840 You can use the WHERE clause to act as a field to specify the conditions that the work laws we use to 8 00:00:48,870 --> 00:00:52,520 return only data that you require. 9 00:00:53,190 --> 00:00:56,280 I have got tored for Oracle editor. 10 00:00:56,290 --> 00:01:06,510 Whole point I am going to be using be work laws in combination with this select statement to return 11 00:01:07,020 --> 00:01:10,620 a salary range from the Employees Table. 12 00:01:10,740 --> 00:01:16,850 I only want insert in salary range return either want the whole salary. 13 00:01:16,960 --> 00:01:21,200 So this is the query I would write to achieve that. 14 00:01:21,420 --> 00:01:24,510 So you begin with a select and 15 00:01:27,570 --> 00:01:33,760 type in select followed by the name of the column to the column I'm interested in. 16 00:01:33,770 --> 00:01:40,240 If salary you can specify several columns you don't know. 17 00:01:40,280 --> 00:01:46,500 You're not restricted to just one column you specify whatever columns you need or you can even specify 18 00:01:46,560 --> 00:01:50,170 all the column using the asterisk symbol. 19 00:01:50,340 --> 00:01:59,040 So I am going to use a salary column source and select salary and then you need to specify the table 20 00:01:59,230 --> 00:02:08,640 salary come in front of the Sulla column resides in the Employees Table. 21 00:02:11,520 --> 00:02:20,130 So this is why I've said select salary from employees so I'm going to use a WHERE clause to act as a 22 00:02:20,130 --> 00:02:27,540 filter because without the WHERE clause it will return all the salaries from the employee's table. 23 00:02:27,840 --> 00:02:29,530 That is not what I want. 24 00:02:29,730 --> 00:02:37,960 I only want a certain range so I have to tell the WHERE clause what range to return. 25 00:02:38,070 --> 00:02:39,350 So this is what I'll do. 26 00:02:39,360 --> 00:02:40,650 You type in where 27 00:02:43,210 --> 00:02:44,250 salary 28 00:02:48,660 --> 00:02:49,770 is great. 29 00:02:49,830 --> 00:02:54,600 This is the symbol for the greater than sign is created then 30 00:02:57,810 --> 00:02:59,640 this is the amount I've chosen. 31 00:02:59,640 --> 00:03:01,130 Dunno why I chose this amount. 32 00:03:01,170 --> 00:03:12,750 I just like this a month or so select salary from employees where the salary range is greater than 1 33 00:03:12,750 --> 00:03:14,610 6 5 0 0. 34 00:03:14,980 --> 00:03:16,950 Okay sixteen thousand five hundred. 35 00:03:17,130 --> 00:03:20,740 So what is without the WHERE clause. 36 00:03:20,780 --> 00:03:28,370 The query will return all salaries so is where closed now is acting as a filter. 37 00:03:28,370 --> 00:03:35,460 He is in this condition so the where clause needs a condition to act with so the condition I was specified 38 00:03:35,760 --> 00:03:41,520 is any salary greater than sixteen thousand five hundred. 39 00:03:41,790 --> 00:03:49,730 So the fair run this it will only return the salary range that matches that so let me execute this. 40 00:03:50,390 --> 00:03:53,390 So is returned a total of three roles. 41 00:03:53,400 --> 00:04:03,420 Saw the cell where clause as active as a filter using this criteria and returns only three rules which 42 00:04:03,420 --> 00:04:14,100 is which is a criteria set on one salary ranges that matches this so these employees table as only got 43 00:04:14,100 --> 00:04:22,790 three rows of three records where people earning over sixteen thousand five hundred dollars. 44 00:04:22,870 --> 00:04:26,410 All right so this is how you would use the where clause. 45 00:04:26,410 --> 00:04:33,750 The main Pop or the main function of the where clause is to act as a filter because without the where 46 00:04:33,750 --> 00:04:37,530 clause audit details have returned the where clause. 47 00:04:37,560 --> 00:04:43,830 Also in hand where you tried to delete on a date is record from a table. 48 00:04:43,860 --> 00:04:49,970 You need to specify she does specify the where clause and you tried to delete certain records. 49 00:04:50,120 --> 00:04:57,920 It will delete everything you need to specify the where clause where the law is very important. 50 00:04:57,930 --> 00:05:01,830 I cannot stress that enough without the work laws. 51 00:05:02,010 --> 00:05:11,520 It will just go Bizzack and delete or if you specify to delete something without the work lot other 52 00:05:11,520 --> 00:05:13,480 filter is gone. 53 00:05:13,800 --> 00:05:16,630 So the work clause acts as a filter. 54 00:05:18,950 --> 00:05:28,640 In this video I explain why the where clause does the importance of the where clocks are so show an 55 00:05:28,640 --> 00:05:33,340 example of how to use beware clocks. 56 00:05:33,470 --> 00:05:35,190 Thank you so much for watching. 57 00:05:35,210 --> 00:05:38,140 I hope the video has been helpful. 58 00:05:38,150 --> 00:05:43,290 I have enjoyed doing the video and hope it was good for you. 59 00:05:43,430 --> 00:05:44,840 Thank you so much. 60 00:05:44,840 --> 00:05:45,800 Take care. 61 00:05:45,800 --> 00:05:47,140 You have a good day. 62 00:05:47,330 --> 00:05:48,400 Bye for now.