-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreateDB.py
56 lines (40 loc) · 2.4 KB
/
createDB.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
46
47
48
49
50
51
52
53
54
55
56
import sqlite3
conn = sqlite3.connect('medicine_db.db')
c = conn.cursor()
# c.execute('''CREATE TABLE meds
# (uid integer, med_name text, expiration_date text, amount real,
# is_closed integer, city text, owner_mail text, owner_name text)''')
#c.execute("INSERT INTO meds VALUES (1, 'Malarone', '2018-05-01', 10, 0, 'Haifa', '[email protected]')")
# values = [(2, 'Acamol', '2018-06-22', 20, 1, 'Jerusalem', '[email protected]'),
# (3, 'Advil', '2019-01-01', 15, 0, 'Jerusalem', '[email protected]')]
# c.executemany("INSERT INTO meds VALUES (?,?,?,?,?,?,?)", values)
# c.execute('''CREATE TABLE meds_data
# (med_name text, picture text)''')
# values = [('Malarone', 'https://www.doctorfox.co.uk/imgs-products/zoom/malarone-pills.jpg'),
# ('Acamol', 'http://www.pilula.co.il/~pilula5/images/stories/virtuemart/product/acamol%20caps.jpg'),
# ('Advil', 'https://images-na.ssl-images-amazon.com/images/I/917DL6AA0PL._SY355_.jpg'),
# ('Meliane', 'http://www.drug.co.il/ps/109-12-29094-00.jpg'),
# ]
# c.executemany("INSERT INTO meds_data VALUES (?,?)", values)
#c.execute("INSERT INTO meds VALUES (4, 'Malarone', '2018-07-04', 15, NULL, 'Raanana', '[email protected]')")
#c.execute('''ALTER TABLE meds ADD COLUMN owner_name text;''')
# values = [(2, 'Acamol', '2018-06-22', 20, 1, 'Jerusalem', '[email protected]', 'avi'),
# (3, 'Advil', '2019-01-01', 15, 0, 'Jerusalem', '[email protected]', 'netta'),
# (1, 'Malarone', '2018-05-01', 10, 0, 'Haifa', '[email protected]', 'shahar'),
# (4, 'Malarone', '2018-07-04', 15, 1, 'Raanana', '[email protected]', 'netta')]
# c.executemany("INSERT INTO meds VALUES (?,?,?,?,?,?,?,?)", values)
#
# c.execute('''ALTER TABLE meds_data ADD COLUMN amount real;''')
# c.execute('''ALTER TABLE meds_data ADD COLUMN description text;''')
# c.execute('''ALTER TABLE meds_data ADD COLUMN manufacturer text;''')
# values = [('[email protected]',"אבי", "acamol"), ('[email protected]',"נטע", "acamol"),
# ('[email protected]', "שחר", "acamol")]
#
# c.executemany("INSERT INTO waiting VALUES (?,?,?)", values)
# c.execute('''CREATE TABLE waiting
# (mail text, name text, med_name text)''')
# c.execute('''drop table meds''')
#
c.execute('''delete from meds where uid between 5 and 14''')
conn.commit()
conn.close()