Question: I have recently started to work with MySQL for my study job and now face following problem:

My predecessor created a textmining table of the following structure:

```
+------------+--------------+------+-----+---------+-------+
| Field      | Type         | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| TokenId    | int(11)      | NO   | PRI | 0       |       |
| Value      | varchar(255) | YES  |     | NULL    |       |
| Frequency  | int(11)      | YES  |     | NULL    |       |
| PMID       | int(11)      | YES  | MUL | NULL    |       |
+------------+--------------+------+-----+---------+-------+

```

In the context of restructuring, I added the following column:

```
+------------+--------------+------+-----+---------+-------+
| NewTokenId | int(11)      | YES  |     | NULL    |       |
+------------+--------------+------+-----+---------+-------+

```

If I now run the query:

```
insert into TitleToken(NewTokenId) select t.TokenId from Token as t, TitleToken as tt where t.Value = tt.Value

```

or even the query:

```
insert into TitleToken(NewTokenId) values(1);

```

I get following output:

> 
> ERROR 1062 (23000): Duplicate entry '0' for key 'PRIMARY'
> 
> 
> 

As I said, I am relatively new to (hands-on) \*SQL and it feels like a stupid mistake, but since the column NewTokenId is no primary key, not unique and even Null is YES, I thought I'd be able to insert basically anything I want.

Any hint would be appreciated... thanks in advance :)

Answer: 
You're missing a semi-colon after the following:

```
chomp $choice

```

Keep in mind that the following is a valid statement:

```
chomp $choice if ($choice = "Ruby")

```

---

By the way, 

```
$choice = "Ruby"

```

should be

```
$choice eq "Ruby"

```

`=` is the scalar assignment or list assignment operator.

`==` is the numerical comparison operator.

`eq` is the string comparison operator.
You are missing a `;` after the line `chomp $choice`

Always include `use strict;` and `use warnings;` in your scripts.