Question: Consider the following CSV file 4 rows shown: quote|source|dob-dod|category There is no remedy but to love more.|Henry David Thoreau|1817-1862|romantic Work is the curse of the

Consider the following CSV file 4 rows shown:

quote|source|dob-dod|category

There is no remedy but to love more.|Henry David Thoreau|1817-1862|romantic

Work is the curse of the drinking classes.|Oscar Wilde|1854-1900|humourous

The paradise of the rich is made out of the hell of the poor.|Victor Hugo|1802-1885|political

Religion is what keeps the poor from murdering the rich.|Napoleon Bonaparte|1769-1821|political

a) Not using any external modules, write a PYTHON script to transform the above data to a valid XML structure using the header fields as element names. You should also generate a row-id as an attribute for each row in the file,

b) Only using the pymysql & csv modules, write a PYTHON script to create the three required tables and insert the CSV data above to a MySQL database.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!