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: 
Your query is wrong it should be:

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

```

See here for more help: [Sql Insert Wiki](http://en.wikipedia.org/wiki/Insert_%28SQL%29)

---

**Edit:**

Your query and error:

> 
> insert into t\_category\_values
>  (CategoryCode, CategoryValueCode,
>  CategoryValue) values(2, 1, 1); 
> 
> 
> no primary key
> 
> 
> 

In insert while specifying to insert in few column instead of all in table you must have to include primary key. That means in your one of CategoryCode, CategoryValueCode, CategoryValue should be primary key or include fourth column that is primary key in table.
Insert query eg:-

```
Insert into `tableName`(field1, field2, field3) values ('value1', 'value2', 'value3');

```