Question: (Closed) create a mysql table with repetitive key values
0
gravatar for ahmedakhokhar
4.0 years ago by
ahmedakhokhar110
Belgium
ahmedakhokhar110 wrote:

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 • 783 views
ADD COMMENTlink written 4.0 years ago by ahmedakhokhar110

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

ADD REPLYlink written 4.0 years ago by Pierre Lindenbaum129k

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!

ADD REPLYlink written 4.0 years ago by Pierre Lindenbaum129k

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? :)

ADD REPLYlink written 4.0 years ago by John12k
Please log in to add an answer.
The thread is closed. No new answers may be added.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1552 users visited in the last hour