TIF_E41253310/scripts/checks/check_current_status_in_db.py

16 lines
558 B
Python

import sys
sys.path.append('Backend')
from app.config.database import engine
from sqlalchemy import text
with engine.connect() as conn:
res = conn.execute(text("SELECT status_kerja, COUNT(*) FROM alumni GROUP BY status_kerja;")).fetchall()
print("Alumni status_kerja:")
for r in res:
print(f" {r[0]}: {r[1]}")
res2 = conn.execute(text("SELECT status_pekerjaan, COUNT(*) FROM pekerjaan GROUP BY status_pekerjaan;")).fetchall()
print("\nPekerjaan status_pekerjaan:")
for r in res2:
print(f" {r[0]}: {r[1]}")