1
00:00:00,720 --> 00:00:02,250
Hello and welcome.

2
00:00:02,270 --> 00:00:16,770
Came this video we will be using the rescue ELDs cell lect command to read and filter data from a database

3
00:00:17,370 --> 00:00:18,870
because Q Was there live.

4
00:00:18,880 --> 00:00:23,760
Mine is the busiest off or the school commands.

5
00:00:23,850 --> 00:00:26,080
It's the one you used.

6
00:00:26,130 --> 00:00:32,370
Mostly cause it's the one you need to retrieve data from a database.

7
00:00:32,490 --> 00:00:42,870
Is why you need to read relevant information from a database so the rescue select statement I would

8
00:00:42,870 --> 00:00:54,190
see you would use almost 60 or 70 percent more than the other rescue a select command.

9
00:00:54,280 --> 00:01:02,730
Ask you also what command all saw works with other parts of the obscure language.

10
00:01:02,730 --> 00:01:13,020
It also works in combination with the WHERE clause they where clause is used to act as a filter to filter

11
00:01:13,410 --> 00:01:17,900
the data that is returned by the select command.

12
00:01:18,150 --> 00:01:28,440
All saw you have the order by the order by can be used to use the date that has been retrieve puts them

13
00:01:28,500 --> 00:01:31,950
in some kind of sorting order.

14
00:01:31,980 --> 00:01:41,460
So this has got the leg is used in combination with all the key words like the WHERE clause and the

15
00:01:41,550 --> 00:01:42,730
Order barc.

16
00:01:42,750 --> 00:01:52,530
So we are going to use it as glue a Select Tool or pull information out of a database and also use the

17
00:01:52,580 --> 00:02:01,140
other clauses like the WHERE clause and the order by to field to the information that is returned from

18
00:02:01,140 --> 00:02:02,650
the database.

19
00:02:02,750 --> 00:02:12,830
We are going to use this select command to view data from the employees table the employees table is

20
00:02:12,840 --> 00:02:21,740
a table in the char scheme so I have called or a call to add 24 hour edit or open.

21
00:02:21,810 --> 00:02:30,150
Were going to use this to query and retrieve some information from the database table so to do that

22
00:02:30,150 --> 00:02:42,290
you use the Select keyword you type in select and then hysterics Asterix means bring back all the columns

23
00:02:42,300 --> 00:02:47,520
so bring back everything and then into a front.

24
00:02:48,060 --> 00:02:51,530
You need to specify where you get the data from.

25
00:02:51,690 --> 00:02:52,840
So are you from.

26
00:02:52,960 --> 00:02:57,120
Will specified the table and the table name its employees

27
00:02:59,690 --> 00:03:02,310
and they up with a semicolon.

28
00:03:02,550 --> 00:03:03,120
So what.

29
00:03:03,130 --> 00:03:11,280
This skill on combined this saying is that bringing back all the records from this table I want order

30
00:03:11,310 --> 00:03:13,480
columns or the rows.

31
00:03:13,590 --> 00:03:20,730
So by using this as serax here you are specify you want everything returned.

32
00:03:20,730 --> 00:03:24,250
No data filter just bring back everything.

33
00:03:24,510 --> 00:03:25,800
So fact execute.

34
00:03:25,830 --> 00:03:29,950
This is was retimed everything from that table.

35
00:03:30,180 --> 00:03:37,470
These are all the columns from the table and the tables got three hundred and seven rows in total.

36
00:03:37,470 --> 00:03:39,730
So is back everything.

37
00:03:39,840 --> 00:03:45,730
So the select statement can be used to retrieve data from a table.

38
00:03:45,960 --> 00:03:53,790
But they can also be used to filter the information that is returned from the table.

39
00:03:53,790 --> 00:04:02,910
You can also specify specific information you want and then bring back everything to do that you have

40
00:04:02,910 --> 00:04:17,520
to use with clocks or write say we've had a request to find out how many employees earn more than twelve

41
00:04:17,850 --> 00:04:21,420
thousand dollars or pounds a year.

42
00:04:21,690 --> 00:04:28,720
So the seller let come out is what we'll use to get that information.

43
00:04:28,740 --> 00:04:36,960
We also need to use the where clause to act as a filter so that we don't get all the data returned and

44
00:04:36,960 --> 00:04:43,520
then we need to put data in some kind of order using the order by command.

45
00:04:43,780 --> 00:04:50,260
So the data we need query we need to write this.

46
00:04:50,530 --> 00:04:56,800
We do select.

47
00:04:59,000 --> 00:04:59,750
We meet us.

48
00:05:00,130 --> 00:05:06,600
Ify the column names so we wonder first name last name and salary.

49
00:05:06,600 --> 00:05:09,910
All right so go first name.

50
00:05:12,120 --> 00:05:16,490
Always write the columns the way they'll specify on the table.

51
00:05:16,490 --> 00:05:19,790
This is the first name you see is caught on the score.

52
00:05:20,090 --> 00:05:26,630
And then you separate the columns with a comma sort of first column his first name and the last name

53
00:05:26,630 --> 00:05:27,550
as well here.

54
00:05:27,790 --> 00:05:29,180
So you type your last name

55
00:05:32,930 --> 00:05:39,160
comma and then next one salary.

56
00:05:39,280 --> 00:05:45,390
All right you don't need a comma with a last column just the columns that precede that.

57
00:05:45,410 --> 00:05:48,640
So I've got all the columns I want next.

58
00:05:48,710 --> 00:05:56,500
I need to specify from what table table name is employees.

59
00:05:59,060 --> 00:06:04,420
And then I need to add a to cause I don't want all the records returned.

60
00:06:04,490 --> 00:06:13,100
So you use a where clause 2 and a filter where salary

61
00:06:16,130 --> 00:06:23,870
remember the request was for data relating to people who earn more than 12000 Dulux.

62
00:06:23,960 --> 00:06:28,300
So where's salary is greater.

63
00:06:28,340 --> 00:06:31,990
This is doing great and downsizing this symbol here.

64
00:06:32,000 --> 00:06:35,330
So where is salary is greater than 12000.

65
00:06:39,640 --> 00:06:40,180
Okay.

66
00:06:40,180 --> 00:06:46,480
So was this this was this daytime's return we need to filter it.

67
00:06:46,510 --> 00:06:48,160
So you used the order by

68
00:06:50,830 --> 00:06:52,840
order by salary

69
00:06:55,780 --> 00:07:01,710
descending descending means once you returned the salary.

70
00:07:01,850 --> 00:07:06,700
I want you to filter it or order it in a sense in descending order.

71
00:07:06,710 --> 00:07:10,370
Now this from high to low.

72
00:07:10,370 --> 00:07:11,010
All right.

73
00:07:11,030 --> 00:07:20,940
We end this statement with a semicolon So the whole lot of this is known as Eskew will query or statement.

74
00:07:21,240 --> 00:07:27,700
The entire block here highlighted is known as an obscure query or statement.

75
00:07:27,700 --> 00:07:35,870
So now I can execute that and is giving me a total total of eight rules.

76
00:07:35,920 --> 00:07:44,560
So there are eight people in this organization in the Employees Table that earn more than twelve thousand

77
00:07:44,560 --> 00:07:46,160
dollars each year.

78
00:07:46,540 --> 00:07:53,940
So I'll commit the day to comment that to date I now committed to the table.

79
00:07:53,950 --> 00:08:00,620
So I've got this information so to export this information to someone else.

80
00:08:00,630 --> 00:08:04,950
I just go to export data set.

81
00:08:05,500 --> 00:08:15,490
You type in the name you give in the type of format so you can export it as an Excel file or hastier

82
00:08:15,490 --> 00:08:16,960
mail any of this relevant.

83
00:08:16,960 --> 00:08:22,950
Once I get weichsel I give in name of salary's and click balki.

84
00:08:23,590 --> 00:08:29,340
So if I open my desktop I should have afford a cord sub.

85
00:08:29,600 --> 00:08:36,580
So this is the spreadsheet that was extracted from the table so I opened this up.

86
00:08:39,840 --> 00:08:40,580
And there you go.

87
00:08:40,570 --> 00:08:47,670
So that's the dust the record of eight people who earn more than twelve thousand dollars.

88
00:08:47,820 --> 00:08:57,070
So I can now email this spreadsheet to the finance director or wherever I requested that information.

89
00:08:57,090 --> 00:09:02,970
So this is how you would retrieve data from the database.

90
00:09:02,970 --> 00:09:04,720
So in this feed you.

91
00:09:04,770 --> 00:09:13,980
We use this rescue us select key word command to retrieve data from a database table.

92
00:09:13,980 --> 00:09:24,750
We all saw filtered data use in the where clause and then put the data in salary order in distending

93
00:09:24,750 --> 00:09:29,960
way from high to low using the order by clause.

94
00:09:30,030 --> 00:09:30,800
So it is.

95
00:09:30,810 --> 00:09:35,350
By here you can order by any on the table columns more.

96
00:09:35,370 --> 00:09:39,890
In this case I have ordered by the salary sense.

97
00:09:39,960 --> 00:09:48,840
The salary is ordered in the order of specified descend in taxes from high to low.

98
00:09:49,080 --> 00:09:52,170
I hold information in his view has been helpful.

99
00:09:52,350 --> 00:10:02,420
So you should be able to use the as Google com said Let command to retrieve data from a database.

100
00:10:02,610 --> 00:10:04,740
Thank you so much for watching.

101
00:10:04,740 --> 00:10:05,430
Take care.

102
00:10:05,430 --> 00:10:06,360
Bye for now.

103
00:10:06,370 --> 00:10:09,540
TRAMP practice as much as you can.

104
00:10:09,660 --> 00:10:15,260
Please feel free to contact me if you've got any issues relating to these.

105
00:10:15,390 --> 00:10:16,720
Feed your course.

106
00:10:16,770 --> 00:10:17,790
Thanks so much.

107
00:10:17,790 --> 00:10:18,590
Bye for now.
