datacharmer / test_db

A sample MySQL database with an integrated test suite, used to test your applications and database servers
4.06k stars 2.59k forks source link

Inserting data on employees table #23

Closed jamols09 closed 4 years ago

jamols09 commented 4 years ago

When making employee auto_increment. I do get error such as `cannot change column 'emp_no': used in a foreign key constraint 'dept_emp_ibfk_1' of table employees.dept_emp'

Do I have to manually specify the emp_no to be able to correctly insert data?

Also when trying to insert data I get error such as "Duplicate entry "11001" for key 'Primary'

Query

INSERT INTO employees 
VALUES 
(11001,
'1953-09-02',
'Oliver',
'Maglana',
'M',
'1994-09-15',
'2020-05-29 23:41:26');
datacharmer commented 4 years ago

What do you expect? A "duplicate key" error means that you should use a different key. And the example that you posted has a wrong number of fields. None of this can be solved by making changes to this project.