I have been searching about this, and still didn't get satisfying answer. My problem is, I have 2 tables, for example table A and table B.
Table A consists of: id (pk), name, address Table B consists of: b_id (pk), id(fk - from table A), tools
The relationship between these 2 tables is one to many. So each row of A could have more than one items in table B.
Commonly, I always use this way:
I select one row from table A
SELECT * FROM A WHERE id = 1
Then I select more data from table B
SELECT * FROM B WHERE b.id = 1
Is this way effective? Is that better than using JOIN, like
SELECT A.id, A.name, A.address, B.b_id, B.tools FROM a LEFT JOIN b ON a.id = b.id WHERE a.id = 1
should I better use JOIN instead?