Upload files to "source/DataBank"

This commit is contained in:
2025-04-01 08:46:48 +00:00
parent f937978ecb
commit 237b9a7467
3 changed files with 126 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
import sqlalchemy as db #somehow pyodbc does not work in container
from sqlalchemy.sql import text
from sqlalchemy_utils import database_exists, create_database
'''
creates the table Mitarbeiter
IN:
the cursor/engine which is the connection object to the db
'''
def createMitarbeiter(cursor):
#write the SQL command to create the table
create = text('''CREATE TABLE IF NOT EXISTS "Mitarbeiter"
(
kuerzel varchar(50) primary key,
vorName varchar(50),
nachName varchar(50),
geschaeftsStelle varchar(50),
eintrittsDatum date,
eMail varchar(50),
telefonNummer int
)''')
cursor.execute(create)
cursor.commit()
'''
deletes the table Mitarbeiter
IN:
the cursor/engine which is the connection object to the db
'''
def dropMitarbeiter(cursor):
#write the SQL command to create the table
create = text('''DROP TABLE IF EXISTS "Mitarbeiter" ''')
cursor.execute(create)
cursor.commit()
if __name__ == '__main__':
pass