-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
49 lines (32 loc) · 1.48 KB
/
test.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 database
import register
import cv2
import keras
def create_db(database_name, host_name = 'localhost',
user_name = 'root', password = 'Pattern'):
db = database.Database(host_name, user_name, password)
db.create_db(database_name)
print("Database Created Successfully")
def connect_db(database_name, host_name = 'localhost', user_name = 'root',
password = 'Pattern'):
db = database.Database(host_name, user_name, password)
db.connect_db(database_name)
print("Successfully connected to Database")
def create_table(table_name, variables, database_name,
host_name = 'localhost', user_name = 'root',
password = 'Pattern'):
db = database.Database(host_name, user_name, password)
db.create_table(name = table_name, features = variables, database = database_name)
print(f'{table_name} table successfully created')
#Create Workers information Table
name = "Workers Information"
variables = "(id int not null, name varchar(50), gender char(6), address varchar(30),\
position varchar(20), employment_date date, resumption_date date,\
salary_per_hr float, daily_work_hrs int, primary key (id))"
database_name = "Dark"
create_table(name, variables, database_name)
#Create register Table
name = 'Register'
variables = "(id int not null, date date, name varchar(50), \
time_in time, time_out time)"
create_table(name, variables, database_name)