Jan-15-2022, 03:52 PM
How does one clean a populated table in MySQL/MariaDB? Copying values across tables?
I was using python, pandas, pymysql, sqlalchemy, openpyxl, odfpy, requests and bs4 to aggregate data from Wikipedia and payload it into MariaDB databases.
I am working on getting my countries Cities, Towns and corresponding Counties organized.
This is what I currently have in one example (the table has both Cities and Towns; I want to separate them by copying all the Cities to a new Table in the same order they are set in the aggregated database and I want to copy all the Towns to a new Table in the same order as they are set in the aggregated database). *I hope that makes sense*.
Current Table: NJ_Cities_CSV
Columns:
Tables for Towns (NEW): NJ_Only_Towns
Tables for Cities (NEW): NJ_Only_Cities
How would I go about achieving this?
I was hoping it would be as easy as a few SQL Statements and then write a python script to execute them using PyMySQL?
Below is screenshots of the mixed table as aggregated from the following Wikipedia Article: https://en.wikipedia.org/wiki/List_of_mu...New_Jersey
upload image online
Thank you everyone for this forum!
Best Regards,
Brandon Kastning
I was using python, pandas, pymysql, sqlalchemy, openpyxl, odfpy, requests and bs4 to aggregate data from Wikipedia and payload it into MariaDB databases.
I am working on getting my countries Cities, Towns and corresponding Counties organized.
This is what I currently have in one example (the table has both Cities and Towns; I want to separate them by copying all the Cities to a new Table in the same order they are set in the aggregated database and I want to copy all the Towns to a new Table in the same order as they are set in the aggregated database). *I hope that makes sense*.
Current Table: NJ_Cities_CSV
Columns:
- number
- name
- type
- county
- population_2020_census
- population_2010_census
- change
- sq_mi
- km2
- population_density
- form_of_government
- incorporated_year
Tables for Towns (NEW): NJ_Only_Towns
Tables for Cities (NEW): NJ_Only_Cities
How would I go about achieving this?
I was hoping it would be as easy as a few SQL Statements and then write a python script to execute them using PyMySQL?
Below is screenshots of the mixed table as aggregated from the following Wikipedia Article: https://en.wikipedia.org/wiki/List_of_mu...New_Jersey
upload image online
Thank you everyone for this forum!
Best Regards,
Brandon Kastning
“And one of the elders saith unto me, Weep not: behold, the Lion of the tribe of Juda, the Root of David, hath prevailed to open the book,...” - Revelation 5:5 (KJV)
“And oppress not the widow, nor the fatherless, the stranger, nor the poor; and ...” - Zechariah 7:10 (KJV)
#LetHISPeopleGo
“And oppress not the widow, nor the fatherless, the stranger, nor the poor; and ...” - Zechariah 7:10 (KJV)
#LetHISPeopleGo