0
1
00:00:04,560 --> 00:00:05,800
<v Volkan>Hello again, in this lesson</v>
1

2
00:00:05,800 --> 00:00:06,853
what we are going to do? We are going to display our statistics
2

3
00:00:08,464 --> 00:00:10,046
display our statistics this page
3

4
00:00:10,046 --> 00:00:12,033
we are going to create this tab actually
4

5
00:00:12,033 --> 00:00:14,143
So what we need to do
5

6
00:00:15,100 --> 00:00:17,586
How we can do that to do that i need to come here
6

7
00:00:17,586 --> 00:00:18,720
and I need to create a new function
7

8
00:00:18,720 --> 00:00:20,240
a new function
8

9
00:00:20,240 --> 00:00:23,460
This time i will say def display
9

10
00:00:23,460 --> 00:00:25,180
statistics OK
10

11
00:00:25,180 --> 00:00:27,540
statistics OK
11

12
00:00:27,540 --> 00:00:29,900
And after that here i will say
12

13
00:00:29,900 --> 00:00:31,650
for now
13

14
00:00:31,650 --> 00:00:33,010
by the way I will say self
14

15
00:00:33,010 --> 00:00:36,383
ok and after that we need to change it because we need to use bind method
15

16
00:00:37,760 --> 00:00:39,720
for this function ok
16

17
00:00:39,720 --> 00:00:42,210
and that's why we need to change self
17

18
00:00:42,210 --> 00:00:45,720
But now its fine so what I will do
18

19
00:00:45,720 --> 00:00:46,553
I need here
19

20
00:00:46,553 --> 00:00:47,386
let' say pass
20

21
00:00:49,430 --> 00:00:51,000
What i need to find I need to
21

22
00:00:51,000 --> 00:00:51,833
come here
22

23
00:00:51,833 --> 00:00:53,380
my
23

24
00:00:53,380 --> 00:00:55,000
labels
24

25
00:00:56,270 --> 00:00:57,103
lbl_book_count
lnl_member_count
25

26
00:00:58,620 --> 00:01:00,110
and lbl_taken_count
26

27
00:01:00,110 --> 00:01:01,190
and
27

28
00:01:01,190 --> 00:01:02,440
So what i need to do
28

29
00:01:02,440 --> 00:01:05,720
here firstly I need to create my queries
29

30
00:01:07,812 --> 00:01:10,410
books ok
30

31
00:01:10,410 --> 00:01:12,810
this is my first query and
31

32
00:01:12,810 --> 00:01:15,730
I will say here cursor dot
32

33
00:01:15,730 --> 00:01:17,273
execute
33

34
00:01:20,430 --> 00:01:24,437
Here I will say "SELECT"
34

35
00:01:24,437 --> 00:01:26,483
count ok this is a new function
35

36
00:01:27,630 --> 00:01:29,770
function we will use
36

37
00:01:29,770 --> 00:01:31,010
What I will count
37

38
00:01:31,010 --> 00:01:32,380
I will count book ID OK
38

39
00:01:32,380 --> 00:01:35,980
and close parentheses and after that what I need to say 
39

40
00:01:35,980 --> 00:01:39,160
I need to say From my table name is books
40

41
00:01:39,160 --> 00:01:41,300
Right and here I will say
41

42
00:01:41,300 --> 00:01:43,668
fetchall OK
42

43
00:01:43,668 --> 00:01:46,110
The second one I will say count
43

44
00:01:46,110 --> 00:01:48,010
members OK
44

45
00:01:48,010 --> 00:01:52,770
is equal to cursor dot execute
45

46
00:01:52,770 --> 00:01:56,120
and here very similar let's copy this guy
46

47
00:01:56,120 --> 00:01:59,030
and until here
47

48
00:01:59,030 --> 00:02:01,590
Copy and paste it here
48

49
00:02:01,590 --> 00:02:04,380
Copy and paste it here
49

50
00:02:04,380 --> 00:02:07,903
This time what I will say I will say count member ID ok this time
50

51
00:02:10,000 --> 00:02:13,100
and member_id
51

52
00:02:13,100 --> 00:02:15,040
and from members Ok
52

53
00:02:15,040 --> 00:02:16,910
My table name is members
53

54
00:02:16,910 --> 00:02:18,500
My table name is members
54

55
00:02:18,500 --> 00:02:20,430
members
55

56
00:02:20,430 --> 00:02:23,680
OK so other one is
56

57
00:02:23,680 --> 00:02:27,370
taken books right
57

58
00:02:27,370 --> 00:02:30,170
is equals 
58

59
00:02:30,170 --> 00:02:33,550
cursor dot again execute
59

60
00:02:33,550 --> 00:02:36,730
I will use something different here and here I will say again
60

61
00:02:36,730 --> 00:02:40,170
SELECT
61

62
00:02:40,170 --> 00:02:42,670
SELECT count again
62

63
00:02:42,670 --> 00:02:44,270
SELECT count again
63

64
00:02:44,270 --> 00:02:46,330
But here I will say book
64

65
00:02:46,330 --> 00:02:50,150
status OK
65

66
00:02:50,150 --> 00:02:52,680
and here what I will say from
66

67
00:02:52,680 --> 00:02:54,713
and here what I will say from
67

68
00:02:55,600 --> 00:02:57,630
Books Again books but
68

69
00:02:57,630 --> 00:02:58,463
I need to say here
69

70
00:02:58,463 --> 00:02:59,296
I need to say here
70

71
00:02:59,296 --> 00:03:00,963
where
71

72
00:03:00,963 --> 00:03:02,370
book_status
72

73
00:03:02,370 --> 00:03:04,550
book_status
73

74
00:03:04,550 --> 00:03:06,460
book_status
74

75
00:03:06,460 --> 00:03:09,610
book_status let me
75

76
00:03:09,610 --> 00:03:12,230
here book
76

77
00:03:12,230 --> 00:03:14,540
status is
77

78
00:03:14,540 --> 00:03:16,850
status is
78

79
00:03:16,850 --> 00:03:18,100
equal to one
79

80
00:03:18,100 --> 00:03:20,380
remember
80

81
00:03:20,380 --> 00:03:22,300
In our table
81

82
00:03:22,300 --> 00:03:25,440
book table right we have a field its name is
82

83
00:03:25,440 --> 00:03:27,730
book status the default value is zero
83

84
00:03:28,670 --> 00:03:30,490
Zero meas the book is in my library
84

85
00:03:30,490 --> 00:03:35,490
But if status is 1 that means this book borrowed by someone
85

86
00:03:35,660 --> 00:03:37,993
it is taken OK and here of course i need to say fetchall OK
86

87
00:03:40,700 --> 00:03:42,420
And after that
87

88
00:03:42,420 --> 00:03:44,130
What I need to do I need to configure my labels
88

89
00:03:44,130 --> 00:03:45,692
Right
89

90
00:03:45,692 --> 00:03:46,860
and how can I do that
90

91
00:03:46,860 --> 00:03:47,693
I will show it 
91

92
00:03:47,693 --> 00:03:50,640
But before that I want to show you something print
92

93
00:03:50,640 --> 00:03:52,530
I will say count books
93

94
00:03:52,530 --> 00:03:53,363
ok.
94

95
00:03:53,363 --> 00:03:55,230
But If I want to ...
95

96
00:03:56,220 --> 00:03:58,180
Display my statistics
96

97
00:03:58,180 --> 00:04:01,080
I need to call this function so to do that I will go 
97

98
00:04:01,080 --> 00:04:01,913
here
98

99
00:04:01,913 --> 00:04:02,973
I have here functions right
