-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_db.py
More file actions
22 lines (15 loc) · 832 Bytes
/
create_db.py
File metadata and controls
22 lines (15 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import sqlite3
def create_db():
con = sqlite3.connect(database=r'ims.db')
cur = con.cursor()
cur.execute("CREATE TABLE IF NOT EXISTS employee(eid INTEGER PRIMARY KEY AUTOINCREMENT , name text, email text, gender text, contact text, dob text, doj text, pass text, utype text, address text, salary text)")
con.commit()
cur.execute("CREATE TABLE IF NOT EXISTS customer(invoice INTEGER PRIMARY KEY AUTOINCREMENT , name text, contact text, desc text)")
con.commit()
cur.execute(
"CREATE TABLE IF NOT EXISTS category(cid INTEGER PRIMARY KEY AUTOINCREMENT , name text)")
con.commit()
cur.execute(
"CREATE TABLE IF NOT EXISTS product(pid INTEGER PRIMARY KEY AUTOINCREMENT , Customer text, Category text, name text, price text, qty text, status text)")
con.commit()
create_db()