Your task to write a single Python function `runPsy()` function, in
file `psy.py`, that reads in a JSON file and updates the database
appropriately. `runPsy()` should take three parameters:
-`conn`: the database connection, already opened and initialized
-`curs`: a *cursor* for the connection.
-`jsonFile`: the JSON file name
Database cursors implement the notion of a *session* with respect to a single
connection. Cursors are used to execute commands and return results, whether
one by one or all at once.
Each line in the input file will consist of a single JSON object in one of the following two formats:
-**New customer**, where information about a customer is provided in the following format
(though our example file has each input in a single line). You can assume that the
frequent flier airline name matches exactly what is there in the 'airlines' table.
```
{ "newcustomer": {
"customerid": "cust1000",
"name": "XYZ",
"birthdate": "1991-12-06",
"frequentflieron": "Spirit Airlines"
}
}
```
-**Flew On**, where information about the passengers in a flight is
provided. Create new rows in `flewon` for each customer, as well as the `customers`
table if the `customerid` does not already exist.
- In some cases the `customerid` provided may not be present in the database (cust1000 as seen below). In this case, first update the `customers` table (all the info is guaranteed to be
there), and then add tuples to the `flewon` table.
Add code in `runORM` to update `NumberOfFlightsTaken` as in assign4, which has
already been defined (but not populated). In other words, clear out the table and repopulate it from scratch each time runORM() is called. Worth 5 points on the first midterm if correct.
## Notes
- You must add `.save(force_insert=True)` for new tuples or they will not be committed to the
database.
-`python3 SQLTesting.py` is once again your last step. Run this and it will call both
of your functions. Getting this to work means that your code will probably
also work on Gradescope.
- You might or might not need to eliminate blank lines before " class Meta:" lines in
order to avoid syntax errors, i.e. get rid of any blank lines
within class definitions (or ensure that proper indentation is maintained by adding spaces).
## Submit Instructions
Submit `psy.py` and `orm.py` files by compressing (zip: on a mac
select them both and right-click "select") them to an archive with two
files, and then dropping that archive on to the <ahref="https://www.gradescope.com/courses/535193/assignments/2852224">Assignment 4 submission</a>.