Due: 11:59 pm on 10/13/2025

Assignment 5

Write a python program using sqlalchemy to access the baseball database. Use a configuration file named csi3335,py with a dictionary called mysql which contains 4 keys - location, user, password and database. For example, the dictionary may look like:

mysql = {'host':'localhost','user':'web','password':'mypass','database':'baseball'}. Do not include your file. We will use our own.

The program must update the baseball database to accomodate teams moving from one city to another. Specifically:

  1. A class must conform to the franchises table
  2. A class must conform to the teams table
  3. For each active franchise (franchise.active = 'Y'), update the teams table with a new team for 2026.
  4. The teamID, lgID, divID, franchID and team_name will be the same for each team in 2026 as in 2025.
  5. The other fields may be NULL.
  6. The new teams should be successfully inserted into the teams table.
  7. SQL injection attacks should be prevented.

Your assignment should be a python file meeting the following criteria

Strong recommendation: If you have not used python before, consider using uv. It is a fast python project manager.