Hi! I'm completely new to SQL and having some trouble.
I have tried altering data types in a table in MySQL after importing a csv file into MySQL on my Mac and I end up with 2 scenarios where I either lose my data or keep my data from the imported file, but I cannot change the data types. I have tried 2 different methods below.
Method #1: After creating a database in MySQL, I use the the "Table Data Import Wizard" option to import my excel csv file into the table.
By default, the data types are automatically inputted as "text" but some columns are meant to be integers (e.g.: sales numbers or percentages).
Before completing the import process using the wizard table tool, I have tried to use the dropdown icon to alter the data types into "int".
When I execute this, the data import fails, but the table updates with the correct column names, but there is no data.
Method #2: After creating a database in MySQL, I use the the "Table Data Import Wizard" option to import my excel csv file into the table.
I use all default settings using the wizard tool and my data uploads successfully into my chosen database table.
I try to then alter my table by clicking the wrench icon that appears on the left side panel when hovering over the table name.
Then, I attempt to change the first column by checking the "primary key" box and "NN". I alter the rest of my column's data types accordingly.
When I apply this, it always returns an error message.