This project contains CSV files representing a sample medical database. Here is the process followed for generating the data:
- The database structure drew inspiration from the table names provided by the Medical Laboratories with Payments.
- ChatGPT suggested columns based on the table names and context, contributing to the comprehensive database design.
- Once the database was created on PostgreSQL, dbSchema facilitated the random generation of values.
- The resulting database was efficiently exported to CSV files using the export_to_csv.py script.
- By leveraging the generate_sql_files.py script, SQL scripts were generated, capturing the structure and data of the database.
- To ensure accuracy and reliability, the generated scripts underwent execution against MySQL, PostgreSQL, and SQL Server databases. This verification process was facilitated by the run_sql_files.py script.
Below is the directory structure for the test data:
test_data
└── medical
├── CSV files
├── mysql
│ ├── SQL scripts generated for MySQL
├── postgresql
│ ├── SQL scripts generated for PostgreSQL
└── sqlserver
├── SQL scripts generated for SQL Server
Please refer to Project Readme.MD for environment setup.
python export_to_csv.py --db-type PostgreSQL --host localhost --database postgres --username postgres --schema medical --folder .\test_data\medical
python export_to_csv.py --db-type MySQL --host localhost --database mysql --username root --schema medical --folder .\test_data\medical
python export_to_csv.py --db-type SQLServer --host 10.96.143.92 --database master --username sa --schema medical --folder .\test_data\medical
python generate_sql_files.py --folder .\test_data\medical --db-type PostgreSQL --schema medical
python generate_sql_files.py --folder .\test_data\medical --db-type MySQL --schema medical
python generate_sql_files.py --folder .\test_data\medical --db-type SQLServer --schema medical
python run_sql_files.py --folder .\test_data\medical\postgresql --db-type PostgreSQL --host localhost --database postgres --username postgres
python run_sql_files.py --folder .\test_data\medical\mysql --db-type MySQL --host localhost --database mysql --username root
python run_sql_files.py --folder .\test_data\medical\sqlserver --db-type SQLServer --host localhost --database master --username sa