The data collection script poses the survey questions to the user and saves their answers as variables. The variables are then written into a temp CSV file. The script then links to a script that creates a database and writes the data into it. A backup CSV is then created when the temp files contents are written into it. The temp file is then removed.

The database script has a list of bash MySQL commands that create a database and table with the relevant variables and variable types. The contents of the temp file is then loaded into the table. The current database is then dumped into an export file and the temp file from the MySQL system is removed.

Here is a link to the repository that holds the scripts and back-up files: Repository