Question: I can't insert a value using this code:

```
 insert into t_category_values (CategoryCode,
 CategoryValueCode, CategoryValue) values(2, 1, 1);

```

error msg

```
no primary key

```

Answer: 
The INSERT goes like this:

```
INSERT INTO `DBA`.`t_category_values`
(CategoryCode, CategoryValueCode, CategoryValue) 
VALUES (1, 1, "aaa");

```

1. No "double quotes" around table names, backticks are allowed. `DBA` is the database, `t_category_values` is the table.
2. Name the columns you want to fill
3. Add 'values' followed by the values for those columns.

If you want to insert data **from another table**, use a SELECT:

```
INSERT INTO `DBA`.`t_category_values`
(CategoryCode, CategoryValueCode, CategoryValue) 
SELECT (CategoryCode, CategoryValueCode, CategoryValue) 
FROM `DBA`.`old_category_values`;

```
You are getting the error "No Primary Key" because you have not specified a valid unique primary key. 

Your table must be 4 columns. 

```
INSERT INTO t_category_values (PRIMARY_KEY, CategoryCode, CategoryValueCode, CategoryValue) 
VALUES(pkey_value_here, 2, 1, 1);

```

The only time you dont need to specify the primary key column is when the primary key is an auto increment value. If it is an auto increment column the INSERT will automatically fill in that value for you and you dont need to worry about it.