howdy3 commited on
Commit
3652bdf
·
verified ·
1 Parent(s): e9bcde7

Upload 3 files

Browse files
Files changed (3) hide show
  1. requirements.txt +3 -0
  2. sqlite.py +37 -0
  3. student.db +0 -0
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ google-generativeai
2
+ streamlit
3
+ python-dotenv
sqlite.py ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import sqlite3
2
+
3
+ connection = sqlite3.connect("student.db")
4
+
5
+ # Create a Cursor object to execute queries (e.g. insert, record, create table)
6
+ cursor = connection.cursor()
7
+
8
+
9
+ # create table
10
+ table_info = """
11
+ CREATE TABLE student (
12
+ NAME VARCHAR(25),
13
+ CLASS VARCHAR(25),
14
+ SECTION VARQCHAR(25)
15
+ );
16
+ """
17
+
18
+ cursor.execute(table_info)
19
+
20
+
21
+ # insert data
22
+ cursor.execute("""Insert Into STUDENT values("Hazem", "AI", "A")""")
23
+ cursor.execute("""Insert Into STUDENT values("Khaled", "AI", "C")""")
24
+ cursor.execute("""Insert Into STUDENT values("Essam", "AI", "A")""")
25
+ cursor.execute("""Insert Into STUDENT values("Ahmed", "Data Science", "A")""")
26
+ cursor.execute("""Insert Into STUDENT values("Mohamed", "Machine Learning", "B")""")
27
+ cursor.execute("""Insert Into STUDENT values("Mahmoud", "Data Warehouse", "A")""")
28
+ cursor.execute("""Insert Into STUDENT values("Abdelrahman", "Data Engineering", "C")""")
29
+
30
+
31
+ print("Inserted records are")
32
+ data = cursor.execute("""SELECT * FROM STUDENT""")
33
+ for row in data:
34
+ print(row)
35
+
36
+ connection.commit()
37
+ connection.close()
student.db ADDED
Binary file (8.19 kB). View file