-
Notifications
You must be signed in to change notification settings - Fork 0
/
totocreate.py
45 lines (37 loc) · 921 Bytes
/
totocreate.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import sqlite3
######### CREATE SQLITE TABLE ############
conn = sqlite3.connect('toto.sqlite')
cur = conn.cursor()
cur.executescript('''
DROP TABLE IF EXISTS date;
DROP TABLE IF EXISTS jackpot_no;
DROP TABLE IF EXISTS place;
CREATE TABLE date (
draw_no INTEGER UNIQUE,
day TEXT,
date TEXT UNIQUE,
scanned INTEGER DEFAULT 0
);
CREATE TABLE jackpot_no (
draw_no INTEGER,
no_type TEXT,
number INTEGER
);
CREATE TABLE place (
draw_no INTEGER,
raw_data TEXT,
location TEXT,
address TEXT,
quickpick TEXT,
system TEXT
);
CREATE TABLE placeall (
location TEXT,
address TEXT,
postal_code TEXT,
latitude FLOAT,
longitude FLOAT,
scanned INTEGER DEFAULT 0
)
''')
print 'Database and tables Created'