1
00:00:05,420 --> 00:00:07,570
in this section we're going to look at

2
00:00:07,570 --> 00:00:09,940
databases and the sqlite database

3
00:00:09,940 --> 00:00:11,690
that's included with the python

4
00:00:11,690 --> 00:00:14,470
standard modules now if we are going to use a

5
00:00:14,470 --> 00:00:16,880
database in our programs it's very

6
00:00:16,880 --> 00:00:18,710
important to understand specifically

7
00:00:18,710 --> 00:00:21,320
what a databases is s think of a

8
00:00:21,320 --> 00:00:23,240
database is just an organized collection

9
00:00:23,240 --> 00:00:25,450
of data that can be used to store

10
00:00:25,450 --> 00:00:27,770
information on a computer or access from

11
00:00:27,770 --> 00:00:31,470
a web server over the Internet

12
00:00:31,470 --> 00:00:34,080
also though if you've used an android or

13
00:00:34,080 --> 00:00:36,810
iOS phone or tablet and run an app on one of

14
00:00:36,810 --> 00:00:38,900
those devices chances are really high

15
00:00:38,900 --> 00:00:41,430
that a sqlite database has been used in

16
00:00:41,430 --> 00:00:44,240
some capacity Android itself uses many

17
00:00:44,240 --> 00:00:46,310
databases to store things like your

18
00:00:46,310 --> 00:00:48,840
contact info text messages and your

19
00:00:48,840 --> 00:00:51,570
browser history search history is also

20
00:00:51,570 --> 00:00:53,570
stored in the database which is how the

21
00:00:53,570 --> 00:00:55,590
Google search on your android phone if

22
00:00:55,590 --> 00:00:57,780
you've got one knows watching search for

23
00:00:57,780 --> 00:00:59,670
previously can then offer suggestions

24
00:00:59,670 --> 00:01:01,710
anything that stores and retrieves

25
00:01:01,710 --> 00:01:03,600
information can really be called a

26
00:01:03,600 --> 00:01:05,810
database these days though the term

27
00:01:05,810 --> 00:01:08,250
database is normally used to refer to

28
00:01:08,250 --> 00:01:13,050
more structured data

29
00:01:13,050 --> 00:01:16,020
now vendor such as Microsoft Oracle and

30
00:01:16,020 --> 00:01:18,710
IBM produce database management systems

31
00:01:18,710 --> 00:01:21,990
based on a relational database over here

32
00:01:21,990 --> 00:01:24,530
data is stored in rows and columns with

33
00:01:24,530 --> 00:01:26,940
a row corresponding to a single record

34
00:01:26,940 --> 00:01:29,840
and the columns representing the fields

35
00:01:29,840 --> 00:01:32,090
that make up a record such as the name

36
00:01:32,090 --> 00:01:34,440
address and date of birth in the case of

37
00:01:34,440 --> 00:01:36,630
a person's record or stock number

38
00:01:36,630 --> 00:01:39,120
description qty in a stock keeping

39
00:01:39,120 --> 00:01:43,240
application

40
00:01:43,240 --> 00:01:45,040
now theirs a huge number of database

41
00:01:45,040 --> 00:01:46,810
systems out there probably the most

42
00:01:46,810 --> 00:01:48,640
well-known of the traditional databases

43
00:01:48,640 --> 00:01:52,510
being sql server oracle and db2 the

44
00:01:52,510 --> 00:01:55,540
Oracle own the Java language after

45
00:01:55,540 --> 00:01:57,850
buying sum micro systems but they were

46
00:01:57,850 --> 00:02:00,030
originally created as a database company

47
00:02:00,030 --> 00:02:02,320
now these traditional databases

48
00:02:02,320 --> 00:02:04,270
typically use structured query language

49
00:02:04,270 --> 00:02:07,630
shortened to sql or SQL depending how

50
00:02:07,630 --> 00:02:09,550
you want to pronounce it and use these

51
00:02:09,550 --> 00:02:11,560
for performing or use a sql for

52
00:02:11,560 --> 00:02:14,280
performing operations such as query and

53
00:02:14,280 --> 00:02:17,020
updating data but is now also a growing

54
00:02:17,020 --> 00:02:19,510
interest in no sql databases used for

55
00:02:19,510 --> 00:02:24,500
storing and processing big data

56
00:02:24,500 --> 00:02:27,410
getting back to android the android

57
00:02:27,410 --> 00:02:28,790
operating system includes a public

58
00:02:28,790 --> 00:02:30,590
domain database engine called sqlite

59
00:02:30,590 --> 00:02:32,990
and Python includes support for

60
00:02:32,990 --> 00:02:34,700
sqlite databases in the standard

61
00:02:34,700 --> 00:02:37,220
library now unlike traditional database

62
00:02:37,220 --> 00:02:38,960
management systems such a sql server

63
00:02:38,960 --> 00:02:41,900
or oracle sqlite is completely

64
00:02:41,900 --> 00:02:43,790
self-contained it doesn't actually need

65
00:02:43,790 --> 00:02:46,610
a separate server to run on now sqlite

66
00:02:46,610 --> 00:02:48,590
was designed to be embedded into systems

67
00:02:48,590 --> 00:02:50,390
originally actually missile guidance

68
00:02:50,390 --> 00:02:53,030
systems so it uses the sql language

69
00:02:53,030 --> 00:02:55,730
which makes it very easy to use if you

70
00:02:55,730 --> 00:02:58,040
already know a bit about databases and

71
00:02:58,040 --> 00:02:59,450
it really means that you can move on to

72
00:02:59,450 --> 00:03:02,030
use another sql database or other

73
00:03:02,030 --> 00:03:04,430
databases once you've learned the basics

74
00:03:04,430 --> 00:03:09,230
of sql with sqlite

75
00:03:09,230 --> 00:03:11,000
and getting back to the history of

76
00:03:11,000 --> 00:03:13,220
sql it was developed originally from

77
00:03:13,220 --> 00:03:15,710
Edgar F Codds work on relational

78
00:03:15,710 --> 00:03:18,080
databases in the nineteen seventies and

79
00:03:18,080 --> 00:03:21,370
became an ansi standard in 1986 now

80
00:03:21,370 --> 00:03:22,940
sqlite implements most of the

81
00:03:22,940 --> 00:03:25,970
features of sql 92 and although their has

82
00:03:25,970 --> 00:03:28,010
been for revisions of the standard since

83
00:03:28,010 --> 00:03:30,010
sql 92 includes everything needed

84
00:03:30,010 --> 00:03:32,930
for most database tasks and just as an

85
00:03:32,930 --> 00:03:35,900
aside text messages on iphone are also

86
00:03:35,900 --> 00:03:38,150
stored in a sqlite database so really

87
00:03:38,150 --> 00:03:39,710
sqlite is used quite

88
00:03:39,710 --> 00:03:44,230
heavily out there

89
00:03:44,230 --> 00:03:46,040
now if you freaking out about now at

90
00:03:46,040 --> 00:03:47,480
the prospect of having to learn yet

91
00:03:47,480 --> 00:03:48,710
another language

92
00:03:48,710 --> 00:03:51,130
don't worry sql is the language but

93
00:03:51,130 --> 00:03:53,350
it's nowhere near as complicated as Java

94
00:03:53,350 --> 00:03:55,730
or Python in fact you can actually do a

95
00:03:55,730 --> 00:03:57,710
lot of database work with only the four

96
00:03:57,710 --> 00:04:01,300
commands select insert update and delete

97
00:04:01,300 --> 00:04:04,540
if you are going to do a lot of database

98
00:04:04,540 --> 00:04:06,650
work then you will need to learn sql

99
00:04:06,650 --> 00:04:08,930
more fully than what we need here and

100
00:04:08,930 --> 00:04:10,010
you'll also need to learn about things

101
00:04:10,010 --> 00:04:12,550
like normalization but the basics that

102
00:04:12,550 --> 00:04:14,960
i'm going to cover will allow you to create programs

103
00:04:14,960 --> 00:04:17,350
that can do basic storage update and

104
00:04:17,350 --> 00:04:22,270
retrieval of information in a database

105
00:04:22,270 --> 00:04:24,260
so sqlite itself has been around

106
00:04:24,260 --> 00:04:26,860
since around the year 2000 it's a very

107
00:04:26,860 --> 00:04:29,780
fast and very stable standalone database

108
00:04:29,780 --> 00:04:32,570
in fact it's the most widely deployed

109
00:04:32,570 --> 00:04:35,200
database engine in the world actually

110
00:04:35,200 --> 00:04:36,760
close to being the most widely deployed

111
00:04:36,760 --> 00:04:38,780
piece of software any kind which is

112
00:04:38,780 --> 00:04:40,130
pretty impressive if you think about it

113
00:04:40,130 --> 00:04:42,470
so if you want to go and check out some

114
00:04:42,470 --> 00:04:44,660
examples of its use in justifications for

115
00:04:44,660 --> 00:04:46,280
the claim that it's the most widely

116
00:04:46,280 --> 00:04:48,380
deployed database engine in the world

117
00:04:48,380 --> 00:04:50,600
check out....

118
00:04:50,600 --> 00:04:55,220
....

119
00:04:55,220 --> 00:04:57,290
you can also find more information out

120
00:04:57,290 --> 00:04:59,180
about sqlite that same website

121
00:04:59,180 --> 00:05:01,430
just visit...

122
00:05:01,430 --> 00:05:03,140
or if you happen to have

123
00:05:03,140 --> 00:05:04,610
been on the other pages click on the

124
00:05:04,610 --> 00:05:06,470
sqlite logo to get back there good

125
00:05:06,470 --> 00:05:07,820
information on that site you want to

126
00:05:07,820 --> 00:05:09,650
find out more about sqlite

127
00:05:09,650 --> 00:05:10,880
alright so let's start off in the next

128
00:05:10,880 --> 00:05:12,680
video by having a look at some basic

129
00:05:12,680 --> 00:05:15,110
database terminology for things like

130
00:05:15,110 --> 00:05:18,230
tables records and fields recordsets and

131
00:05:18,230 --> 00:05:20,840
why they're important and after we've

132
00:05:20,840 --> 00:05:22,550
done that we'll then move onto actually

133
00:05:22,550 --> 00:05:24,500
using sqlite to create databases

134
00:05:24,500 --> 00:05:26,690
and store information but in the next

135
00:05:26,690 --> 00:05:28,280
video as i mentioned we'll go ahead and

136
00:05:28,280 --> 00:05:30,470
start looking at that terminology see

137
00:05:30,470 --> 00:05:36,220
you in the next video

