Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 907301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:32:02+00:00 2026-05-15T16:32:02+00:00

How would I go around creating a MYSQL table schema inspecting an Excel(or CSV)

  • 0

How would I go around creating a MYSQL table schema inspecting an Excel(or CSV) file.
Are there any ready Python libraries for the task?

Column headers would be sanitized to column names. Datatype would be estimated based on the contents of the spreadsheet column. When done, data would be loaded to the table.

I have an Excel file of ~200 columns that I want to start normalizing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T16:32:03+00:00Added an answer on May 15, 2026 at 4:32 pm

    Just for (my) reference, I documented below what I did:

    1. XLRD is practical, however I’ve just saved the Excel data as CSV, so I can use LOAD DATA INFILE
    2. I’ve copied the header row and started writing the import and normalization script
    3. Script does: CREATE TABLE with all columns as TEXT, except for Primary key
    4. query mysql: LOAD DATA LOCAL INFILE loading all CSV data into TEXT fields.
    5. based on the output of PROCEDURE ANALYSE, I was able to ALTER TABLE to give columns the right types and lengths. PROCEDURE ANALYSE returns ENUM for any column with few distinct values, which is not what I needed, but I found that useful later for normalization. Eye-balling 200 columns was a breeze with PROCEDURE ANALYSE. Output from PhpMyAdmin propose table structure was junk.
    6. I wrote some normalization mostly using SELECT DISTINCT on columns and INSERTing results to separate tables. I have added to the old table a column for FK first. Just after the INSERT, I’ve got its ID and UPDATEed the FK column. When loop finished I’ve dropped old column leaving only FK column. Similarly with multiple dependent columns. It was much faster than I expected.
    7. I ran (django) python manage.py inspctdb, copied output to models.py and added all those ForeignkeyFields as FKs do not exist on MyISAM. Wrote a little python views.py, urls.py, few templates…TADA

    Created https://blocl.uk/schools
    based on data from https://www.get-information-schools.service.gov.uk/Downloads

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 490k
  • Answers 490k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer With a Java EE 5 container, you get JPA 1.0… May 16, 2026 at 9:12 am
  • Editorial Team
    Editorial Team added an answer my problem solved by using TAdvPicture componenet. May 16, 2026 at 9:12 am
  • Editorial Team
    Editorial Team added an answer Something like ((int)Math.Round(value*100)).ToString() + "%";. May 16, 2026 at 9:12 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm creating a MySQL table in Rails which has about 170 boolean fields, each
I'm creating an MySQL call using PHP, I'm calculating distance using the haversine forumula:
I have a database model diagram created in MS Visio which I would like
I am a fairly new MySQL developer and am starting on a project that
I have a user system set up in a 'users' table, and I have
I'm writing a php-mysql application. The application allows the user to run a search
I've just wasted the past two hours of my life trying to create a
I am working to use django's ContentType framework to create some generic relations for
OK, I'm always trying to improve the way I code, because it's my passion.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.