This is a test version of Biostars. For the public version, visit https://www.biostars.org.
create a mysql table with repetitive key values

Question: (I am learning MySQL and PHP) I want to create a MySQL table with repetitive primary keys on mac system.

I have CSV file like following with over 1000 rows;

a;1;bit;4

a;3;bit;7

b;1;bit;1

b;2;bit;10

b;4;but;1

and I tried following commands:

create table new ( P VARCHAR(8) int NOT NULL AUTO_INCREMENT primary key, P VARCHAR(8), Pposition VARCHAR(30), Ptype VARCHAR(30)) ENGINE=InnoDB;

load data local infile '/Users/admin/Desktop/ab.csv' INTO TABLE new COLUMNS TERMINATED BY';';

Query OK, 1 row affected, 1 warning (0.03 sec)

Records: 1 Deleted: 0 Skipped: 0 Warnings: 1

Can you please suggest me the right and efficient way to solve this problem. Thanks !

msql

don't use a primary key for the 1st column. closing as it is not related to bionformatics.

Hello ahmedakhokhar!

We believe that this post does not fit the main topic of this site.

not related to bioinformatics.

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

You didn't paste the warning, so we don't know what the problem you want solving is.

Also: you define the P column twice, try not to use capital letters for table names if you can help it, and an AUTO_INCREMENT on a VARCHAR seems odd - why not just an int?

Finally, what does any of this have to do with Bioinformatics? :)

0 answers

No answers yet.

Log in to answer this question.