-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprojection.py
More file actions
48 lines (41 loc) · 1.44 KB
/
projection.py
File metadata and controls
48 lines (41 loc) · 1.44 KB
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
import MiniWorld
import subprocess as sp
import colours
def a():
query = """
SELECT
CONCAT(Employee.First_Name, " ", Employee.Last_Name) AS Name
FROM Employee
INNER JOIN Money_Front
ON Employee.Employee_ID = Money_Front.Acc_Emp_ID
WHERE Money_Front.Amount_Laundered >= 4800;
"""
MiniWorld.executeQuery(query)
def b():
territory = input("Enter Territory ID: ")
query = f'SELECT Number_of_Employees FROM Territory WHERE Territory_ID = "{territory}";'
MiniWorld.executeQuery(query)
def projection():
while(1):
tmp = sp.call('clear', shell=True)
print("Choose an operation:")
print(f"{colours.bcolors.OKCYAN}")
print("1. List all managers of who laundered amount greater than 4800")
print("2. Number of Employees in a Territory")
print(f"{colours.bcolors.ENDC}{colours.bcolors.WARNING}")
print("3. Back")
print("4. Exit")
print(f"{colours.bcolors.ENDC}")
ch = input("Enter choice: ").lower()
tmp = sp.call('clear', shell=True)
if ch == '1' or ch == 'a':
a()
elif ch == '2' or ch == 'number of employees in a territory':
b()
elif ch == '3' or ch == 'back':
return
elif ch == '4' or ch == 'exit':
exit()
else:
print(f"{colours.bcolors.RED}Invalid Option{colours.bcolors.ENDC}")
input("Enter any key to continue: ")