0

Here is my ER diagramI have 3 normalized database tables. Employee, Address and employee_has address. When I will Insert (store) data into those should I write three individual query for three of them?

  • It's hard to see why you would need 3 tables - unless employee can have multiple addresses. – P.Salmon Apr 26 '19 at 15:18
  • should I reduce tables? – Jafrul Hossain Apr 26 '19 at 15:41
  • Yes, and order matters, so, be sure to insert into employee and address first, then get their primary keys to insert into employee_has_address (which you could simplify the name with the conventional employee_address naming convention). – Michael Dougan Apr 26 '19 at 15:47

1 Answers1

0

welcome on stackoverflow.

Looks like the answer is yes.

By the way, have a look at selected answer on that post : MySQL Insert into multiple tables? (Database normalization?)

Hope it helps.

Flo
  • 936
  • 1
  • 8
  • 19