-
Notifications
You must be signed in to change notification settings - Fork 0
/
moviesBD.py
42 lines (29 loc) · 1.17 KB
/
moviesBD.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
import sqlite3
# connect to database
conn = sqlite3.connect('ctmovie.db')
#create a cursor
na = conn.cursor()
#create a table
na.execute("""CREATE TABLE ctmovie (
name text,
lead_actor text,
lead_actress text,
year_of_release integer,
director text
) """)
#Adding records into the table
an =[
('Vishnuvardhana ','Sudeep ','Priyamani ',2011,'Pon Kumarana'),
('Kempe Gowda ','Sudeep ','Ragini ',2011,'Sudeep'),
('Bachahan ','Sudeep ','Bhavana ',2013,'Shashank'),
('Maanikya ','Sudeep ','Ramya ',2014,'Sudeep'),
('Veera Madakari ','Sudeep ','Ragini ',2009,'Sudeep'),
('Huchha ','Sudeep ','Rekha Vedavyas ',2001,'Om Prakash Rao'),
('Kotibba-3 ','Sudeep ','Shraddha Das ',2020,'Shiva Karthik'),
('Hebbuli ','Sudeep ','Amala Paul ',2017,'S Krishna'),
]
na.executemany("INSERT INTO ctmovie VALUES (?,?,?,?,?)",an)
#commit our commnd
conn.commit()
#close our connection
conn.close()