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`;

```
Insert query eg:-

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

```